@Test public void responseWithAllValuesIsDeserialized() { UpdateServiceInstanceResponse response = JsonUtils.readTestDataFile( "updateResponse.json", UpdateServiceInstanceResponse.class); assertThat(response.getOperation()).isEqualTo("in progress"); assertThat(response.getDashboardUrl()).isEqualTo("https://dashboard.local"); }
@Test public void responseWithDefaultsIsBuilt() { UpdateServiceInstanceResponse response = UpdateServiceInstanceResponse.builder() .build(); assertThat(response.isAsync()).isEqualTo(false); assertThat(response.getOperation()).isNull(); DocumentContext json = JsonUtils.toJsonPath(response); assertThat(json).hasNoPath("$.operation"); }
@Test public void responseWithAllValuesIsBuilt() { UpdateServiceInstanceResponse response = UpdateServiceInstanceResponse.builder() .async(true) .dashboardUrl("https://dashboard.example.com") .operation("in progress") .build(); assertThat(response.isAsync()).isEqualTo(true); assertThat(response.getOperation()).isEqualTo("in progress"); DocumentContext json = JsonUtils.toJsonPath(response); assertThat(json).hasPath("$.operation").isEqualTo("in progress"); assertThat(json).hasPath("$.dashboard_url").isEqualTo("https://dashboard.example.com"); }