use of org.cloudfoundry.client.v2.serviceplans.Schema in project cf-java-client by cloudfoundry.
the class ReactorServicePlansTest method get.
@Test
public void get() {
Map<String, String> details = new HashMap<>();
details.put("description", "Billing account number used to charge use of shared fake server.");
details.put("type", "string");
Schema testSchema = Schema.builder().parameters(Parameters.builder().jsonSchema("http://json-schema.org/draft-04/schema#").properties(Collections.singletonMap("billing-account", details)).type("object").build()).build();
mockRequest(InteractionContext.builder().request(TestRequest.builder().method(GET).path("/service_plans/test-service-plan-id").build()).response(TestResponse.builder().status(OK).payload("fixtures/client/v2/service_plans/GET_{id}_response.json").build()).build());
this.servicePlans.get(GetServicePlanRequest.builder().servicePlanId("test-service-plan-id").build()).as(StepVerifier::create).expectNext(GetServicePlanResponse.builder().metadata(Metadata.builder().createdAt("2015-07-27T22:43:16Z").id("f6ceb8a2-e6fc-43d5-a11b-7ced9e1b47c7").url("/v2/service_plans/f6ceb8a2-e6fc-43d5-a11b-7ced9e1b47c7").build()).entity(ServicePlanEntity.builder().name("name-462").free(false).description("desc-52").serviceId("8ac39757-0f9d-4295-9b6f-e626f7ee3cd4").uniqueId("2aa0162c-9c88-4084-ad1d-566a09e8d316").publiclyVisible(true).active(true).schemas(Schemas.builder().serviceBinding(ServiceBindingSchema.builder().create(testSchema).build()).serviceInstance(ServiceInstanceSchema.builder().create(testSchema).update(testSchema).build()).build()).serviceUrl("/v2/services/8ac39757-0f9d-4295-9b6f-e626f7ee3cd4").serviceInstancesUrl("/v2/service_plans/f6ceb8a2-e6fc-43d5-a11b-7ced9e1b47c7/service_instances").build()).build()).expectComplete().verify(Duration.ofSeconds(5));
}
Aggregations