@Override public Model legal() { return new Model(Model.class.getName()); }
@Override public void validate(Model candidate) throws AssertionError { if (candidate == null) throw new AssertionError("model can not be null"); if (!candidate.getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public void validate(Model candidate) throws AssertionError { if (candidate == null) throw new AssertionError("model can not be null"); if (!candidate.getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public Model legal() { return new Model(Model.class.getName()); }
@Override public void validate(Model candidate) throws AssertionError { if (candidate == null) throw new AssertionError("model can not be null"); if (!candidate.getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public Model legal() { return new Model(Model.class.getName()); }
@Override public void validate(Model candidate) throws AssertionError { if (candidate == null) throw new AssertionError("model can not be null"); if (!candidate.getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public Model legal() { return new Model(Model.class.getName()); }
@Override public void validate(List<Model> candidate) throws AssertionError { if (candidate == null) throw new AssertionError("models can not be null"); if (candidate.size() != 1) throw new AssertionError("models must has one entry"); if (!candidate.get(0).getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public List<Model> legal() { return Arrays.asList(new Model(Model.class.getName())); }
@Override public void validate(List<Model> candidate) throws AssertionError { if (candidate == null) throw new AssertionError("models can not be null"); if (candidate.size() != 1) throw new AssertionError("models must has one entry"); if (!candidate.get(0).getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public List<Model> legal() { return Arrays.asList(new Model(Model.class.getName())); }
@Override public void validate(List<Model> candidate) throws AssertionError { if (candidate == null) throw new AssertionError("models can not be null"); if (candidate.size() != 1) throw new AssertionError("models must has one entry"); if (!candidate.get(0).getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public List<Model> legal() { return Arrays.asList(new Model(Model.class.getName())); }
@Override public void validate(List<Model> candidate) throws AssertionError { if (candidate == null) throw new AssertionError("models can not be null"); if (candidate.size() != 1) throw new AssertionError("models must has one entry"); if (!candidate.get(0).getS1().equals(Model.class.getName())) { throw new AssertionError("model.s1 must be equal to " + Model.class.getName()); } } }
@Override public List<Model> legal() { return Arrays.asList(new Model(Model.class.getName())); }
@Test public void modelsWithParams() { String email = "foo@foo.bar"; List<Model> models = restApi.modelsWithParams(email, null); assertThat(models.size(), is(1)); assertThat(models.get(0).getS1(), is(Model.class.getName())); }
@Test public void modelWithWrongMockeryParam() { Model model = new Model(Model.class.getName()); exception.expect(RuntimeException.class); restApi.modelWithWrongMockeryParam(model); }
@Test public void models() { List<Model> models = restApi.models(); assertThat(models.size(), is(1)); assertThat(models.get(0).getS1(), is(Model.class.getName())); }