@Test public void postRequiredStringHeader() throws Exception { try { client.getExplicit().postRequiredStringHeader(null); fail(); } catch (ServiceException ex) { Assert.assertTrue(ex.getMessage().contains("Parameter headerParameter is required")); } }
@Test public void postOptionalStringParameter() throws Exception { try { client.getExplicit().postOptionalIntegerParameter(null); fail(); } catch (ServiceException ex) { // Body parameter cannot be null } }
@Test public void postRequiredStringProperty() throws Exception { try { StringWrapper body = new StringWrapper(); body.setValue(null); client.getExplicit().postRequiredStringProperty(body); fail(); } catch (ServiceException ex) { Assert.assertEquals(IllegalArgumentException.class, ex.getCause().getClass()); Assert.assertTrue(ex.getMessage().contains("value is required")); } }
@Test public void postOptionalStringProperty() throws Exception { StringOptionalWrapper body = new StringOptionalWrapper(); body.setValue(null); client.getExplicit().postOptionalStringProperty(body); }
@Test public void postOptionalIntegerHeader() throws Exception { client.getExplicit().postOptionalIntegerHeader(null); }
@Test public void postOptionalIntegerProperty() throws Exception { IntOptionalWrapper body = new IntOptionalWrapper(); body.setValue(null); client.getExplicit().postOptionalIntegerProperty(body); }