CreateServiceInstanceBindingRequest extends AsyncParameterizedServiceInstanceRequest { public static CreateServiceInstanceBindingRequestBuilder builder() { return new CreateServiceInstanceBindingRequestBuilder(); } CreateServiceInstanceBindingRequest();  CreateServiceInstanceBindingRequest(String serviceInstanceId, String serviceDefinitionId, String planId,
			String bindingId, ServiceDefinition serviceDefinition, Plan plan, boolean asyncAccepted,
			BindResource bindResource, Map<String, Object> parameters, Context context, String platformInstanceId,
			String apiInfoLocation, Context originatingIdentity, String requestIdentity); String getServiceInstanceId(); void setServiceInstanceId(final String serviceInstanceId); String getBindingId(); void setBindingId(final String bindingId); String getServiceDefinitionId(); String getPlanId(); @Deprecated String getAppGuid(); BindResource getBindResource(); ServiceDefinition getServiceDefinition(); void setServiceDefinition(final ServiceDefinition serviceDefinition); Plan getPlan(); void setPlan(final Plan plan); static CreateServiceInstanceBindingRequestBuilder builder(); @Override final boolean equals(Object o); @Override final boolean canEqual(Object other); @Override final int hashCode(); @Override String toString();  }
@Test void requestMatchesWithJsonRoundTrip() { CreateServiceInstanceBindingRequest request = CreateServiceInstanceBindingRequest.builder() .serviceDefinitionId("definition-id") .planId("plan-id") .parameters("param1", "value1") .parameters("param2", "value2") .bindResource(BindResource.builder() .appGuid("app-guid") .route("route") .properties("resource-param1", "value1") .properties("resource-param2", "value2") .build()) .context(PlatformContext.builder() .platform("sample-platform") .property("context-property1", "value1") .property("context-property2", "value2") .build()) .build(); CreateServiceInstanceBindingRequest fromJson = fromJson(toJson(request), CreateServiceInstanceBindingRequest.class); assertThat(fromJson).isEqualTo(request); }
@Test void minimalRequestMatchesWithJsonRoundTrip() { CreateServiceInstanceBindingRequest request = CreateServiceInstanceBindingRequest.builder() .serviceDefinitionId("definition-id") .planId("plan-id") .build(); String json = toJson(request); CreateServiceInstanceBindingRequest fromJson = fromJson(json, CreateServiceInstanceBindingRequest.class); assertThat(fromJson).isEqualTo(request); }
@Test void requestSerializesToJsonExcludingTransients() { CreateServiceInstanceBindingRequest request = CreateServiceInstanceBindingRequest.builder() .platformInstanceId("platform-instance-id") .apiInfoLocation("api-info-location") .originatingIdentity(PlatformContext.builder() .platform("sample-platform").build()) .asyncAccepted(true) .serviceDefinitionId("definition-id") .serviceDefinition(ServiceDefinition.builder().build()) .plan(Plan.builder().build()) .build(); DocumentContext json = JsonUtils.toJsonPath(request); JsonPathAssert.assertThat(json).hasPath("$.service_id").isEqualTo("definition-id"); JsonPathAssert.assertThat(json).hasMapAtPath("$").hasSize(1); }
@Test void minimalRequestSerializesToJsonWithoutMissingExcludingTransients() { CreateServiceInstanceBindingRequest request = CreateServiceInstanceBindingRequest .builder().platformInstanceId("platform-instance-id") .apiInfoLocation("api-info-location") .originatingIdentity(PlatformContext.builder() .platform("sample-platform").build()) .asyncAccepted(true) .serviceDefinitionId("definition-id").build(); DocumentContext json = JsonUtils.toJsonPath(request); JsonPathAssert.assertThat(json).hasPath("$.service_id").isEqualTo("definition-id"); JsonPathAssert.assertThat(json).hasMapAtPath("$").hasSize(1); }