/** * Convert this object to its corresponding model * * @return a converted ServiceDefinition * @see org.springframework.cloud.servicebroker.model.catalog.ServiceDefinition */ public org.springframework.cloud.servicebroker.model.catalog.ServiceDefinition toModel() { List<org.springframework.cloud.servicebroker.model.catalog.Plan> modelPlans = this.plans.stream() .map(Plan::toModel) .collect(Collectors.toList()); return org.springframework.cloud.servicebroker.model.catalog.ServiceDefinition.builder() .id(this.id) .name(this.name) .description(this.description) .bindable(this.bindable) .planUpdateable(this.planUpdateable) .instancesRetrievable(this.instancesRetrievable) .bindingsRetrievable(this.bindingsRetrievable) .tags(this.tags) .metadata(this.metadata) .requires(this.requires) .dashboardClient(this.dashboardClient != null ? this.dashboardClient.toModel() : null) .plans(modelPlans) .build(); } }
.description("Service Definition One") .plans(Plan.builder().build()) .bindable(true) .instancesRetrievable(true) .bindingsRetrievable(true)
@Override public Mono<ServiceDefinition> getServiceDefinition(String serviceId) { ServiceDefinition serviceDefinition = ServiceDefinition.builder() .id(serviceId) .name("example") .description("A simple example") .bindable(true) .tags("example", "tags") .plans(getPlan()) .build(); return Mono.just(serviceDefinition); }
@Bean public Catalog catalog() { Plan plan = Plan.builder() .id("simple-plan") .name("standard") .description("A simple plan") .free(true) .build(); ServiceDefinition serviceDefinition = ServiceDefinition.builder() .id("example-service") .name("example") .description("A simple example") .bindable(true) .tags("example", "tags") .plans(plan) .build(); return Catalog.builder() .serviceDefinitions(serviceDefinition) .build(); } }
@Before public void setUp() { serviceDefinition = ServiceDefinition.builder() .id(SVC_DEF_ID) .name("Name") .description("Description") .bindable(true) .build(); catalog = Catalog.builder() .serviceDefinitions(serviceDefinition) .build(); service = new BeanCatalogService(catalog); }
public static ServiceDefinition getSimpleService() { return ServiceDefinition.builder() .id("service-one-id") .name("Service One") .description("Description for Service One") .bindable(true) .plans(getPlanOne(), getPlanTwo(), getPlanThree()) .requires(ServiceDefinitionRequires.SERVICE_REQUIRES_SYSLOG_DRAIN.toString(), ServiceDefinitionRequires.SERVICE_REQUIRES_ROUTE_FORWARDING.toString()) .build(); }