@Override public Model legal() { return new Model(Model.class.getName()); }
@Test public void modelWithParams() { Model model = new Model(Model.class.getName()); Model response = restApi .modelWithParams(model, 0, "{\"s1\":\"io.victoralbertos.mockery.internal.integration.Model\"}"); assertThat(response.getS1(), is(model.getS1())); }
@Test public void modelWithWrongMockeryParam() { Model model = new Model(Model.class.getName()); exception.expect(RuntimeException.class); restApi.modelWithWrongMockeryParam(model); }
@Test public void modelWithParamsFailsWhenInvalidJson() { Model model = new Model(Model.class.getName()); exception.expect(AssertionError.class); restApi.modelWithParams(model, 0, "{\"s1\":\"\"}"); }
@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 modelWithEnum() { String order = "asc"; Model model = restApi.modelWithEnum(order); assertThat(model.getS1(), is(Model.class.getName())); }
@Test public void modelsWithParamWithoutMockery() { exception.expect(RuntimeException.class); restApi.modelsWithParamWithoutMockery(3); }
@Test public void completableModel_fails() { fails(restApi.completableModel().test()); }
@Test public void modelResponse_fails() { fails(restApi.modelResponse().test()); }
@Test public void modelWithEnumFails() { String order = "invalid"; exception.expect(AssertionError.class); restApi.modelWithEnum(order); }
@Test public void modelsWithParamWithoutMockery() { exception.expect(RuntimeException.class); restApi.modelsWithParamWithoutMockery(3); }
@Test public void modelWithWrongMockeryParam() { Model model = new Model(Model.class.getName()); exception.expect(RuntimeException.class); restApi.modelWithWrongMockeryParam(model); }
@Override public Model legal() { return new Model(Model.class.getName()); }
@Test public void modelWithWrongMockeryParam() { Model model = new Model(Model.class.getName()); exception.expect(RuntimeException.class); restApi.modelWithWrongMockeryParam(model); }
@Override public Model legal() { return new Model(Model.class.getName()); }
@Override public Model legal() { return new Model(Model.class.getName()); }