use of com.jayway.jsonpath.DocumentContext in project spring-cloud-open-service-broker by spring-cloud.
the class GetLastServiceOperationResponseTest method responseWithAllValuesIsBuilt.
@Test
public void responseWithAllValuesIsBuilt() {
GetLastServiceOperationResponse response = GetLastServiceOperationResponse.builder().operationState(OperationState.SUCCEEDED).description("description").deleteOperation(true).build();
assertThat(response.getState()).isEqualTo(OperationState.SUCCEEDED);
assertThat(response.getDescription()).isEqualTo("description");
assertThat(response.isDeleteOperation()).isEqualTo(true);
DocumentContext json = JsonUtils.toJsonPath(response);
assertThat(json).hasPath("$.state").isEqualTo(OperationState.SUCCEEDED.toString());
assertThat(json).hasPath("$.description").isEqualTo("description");
}
use of com.jayway.jsonpath.DocumentContext in project spring-cloud-open-service-broker by spring-cloud.
the class GetLastServiceOperationResponseTest method responseWithDefaultsIsBuilt.
@Test
public void responseWithDefaultsIsBuilt() {
GetLastServiceOperationResponse response = GetLastServiceOperationResponse.builder().build();
assertThat(response.getState()).isNull();
assertThat(response.getDescription()).isNull();
assertThat(response.isDeleteOperation()).isEqualTo(false);
DocumentContext json = JsonUtils.toJsonPath(response);
assertThat(json).hasNoPath("$.state");
assertThat(json).hasNoPath("$.description");
}
use of com.jayway.jsonpath.DocumentContext in project spring-cloud-open-service-broker by spring-cloud.
the class GetLastServiceOperationResponseTest method responseWithStateIsSerializedToJson.
private void responseWithStateIsSerializedToJson(OperationState stateValue, String stateString) {
GetLastServiceOperationResponse response = GetLastServiceOperationResponse.builder().operationState(stateValue).description("description").build();
DocumentContext json = JsonUtils.toJsonPath(response);
assertThat(json).hasPath("$.state").isEqualTo(stateString);
assertThat(json).hasPath("$.description").isEqualTo("description");
}
use of com.jayway.jsonpath.DocumentContext in project spring-cloud-open-service-broker by spring-cloud.
the class CreateServiceInstanceAppBindingResponseTest method responseWithDefaultsIsBuilt.
@Test
public void responseWithDefaultsIsBuilt() {
CreateServiceInstanceAppBindingResponse response = CreateServiceInstanceAppBindingResponse.builder().build();
assertThat(response.isBindingExisted()).isEqualTo(false);
assertThat(response.getCredentials()).hasSize(0);
assertThat(response.getSyslogDrainUrl()).isNull();
assertThat(response.getVolumeMounts()).hasSize(0);
DocumentContext json = JsonUtils.toJsonPath(response);
assertThat(json).hasNoPath("$.credentials");
assertThat(json).hasNoPath("$.syslog_drain_url");
assertThat(json).hasNoPath("$.volume_mounts");
}
use of com.jayway.jsonpath.DocumentContext in project spring-cloud-open-service-broker by spring-cloud.
the class CreateServiceInstanceRouteBindingResponseTest method responseWithDefaultsIsBuilt.
@Test
public void responseWithDefaultsIsBuilt() {
CreateServiceInstanceRouteBindingResponse response = CreateServiceInstanceRouteBindingResponse.builder().build();
assertThat(response.isBindingExisted()).isEqualTo(false);
assertThat(response.getRouteServiceUrl()).isNull();
DocumentContext json = JsonUtils.toJsonPath(response);
assertThat(json).hasNoPath("$.route_service_url");
}
Aggregations