.serviceDefinitions( ServiceDefinition.builder() .id("service-definition-id-one") .plans(Plan.builder().build()) .build()) .serviceDefinitions(serviceDefinitions) .build();
@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(); } }
/** * Converts this object into its corresponding model * * @return a Catalog model * @see org.springframework.cloud.servicebroker.model.catalog.Catalog */ public org.springframework.cloud.servicebroker.model.catalog.Catalog toModel() { List<org.springframework.cloud.servicebroker.model.catalog.ServiceDefinition> modelServiceDefinitions = this.services.stream() .map(ServiceDefinition::toModel) .collect(Collectors.toList()); return org.springframework.cloud.servicebroker.model.catalog.Catalog.builder() .serviceDefinitions(modelServiceDefinitions) .build(); }
@Bean public Catalog catalog() { return Catalog.builder().build(); }
@Bean public Catalog catalog() { return Catalog.builder().build(); }
@Before public void setUp() { Catalog expectedCatalog = Catalog.builder().build(); given(catalogService.getCatalog()) .willReturn(Mono.just(expectedCatalog)); }
/** * Create a builder that provides a fluent API for constructing a {@literal Catalog}. * * @return the builder */ public static CatalogBuilder builder() { return new CatalogBuilder(); }
@Before public void setUp() { this.client = WebTestClient.bindToController(this.controller).build(); this.serviceDefinition = ServiceFixture.getSimpleService(); Catalog catalog = Catalog.builder() .serviceDefinitions(this.serviceDefinition) .build(); when(this.catalogService.getCatalog()).thenReturn(Mono.just(catalog)); }
@Bean public Catalog catalog() { return Catalog.builder() .serviceDefinitions(ServiceFixture.getSimpleService()) .build(); }
@Override public Mono<Catalog> getCatalog() { return getServiceDefinition("example-service") .map(serviceDefinition -> Catalog.builder() .serviceDefinitions(serviceDefinition) .build()); }
@Before public void setUp() { this.mockMvc = MockMvcBuilders.standaloneSetup(this.controller) .setMessageConverters(new MappingJackson2HttpMessageConverter()) .build(); this.serviceDefinition = ServiceFixture.getSimpleService(); Catalog catalog = Catalog.builder() .serviceDefinitions(this.serviceDefinition) .build(); given(this.catalogService.getCatalog()) .willReturn(Mono.just(catalog)); }
/** * Create a builder that provides a fluent API for constructing a {@literal Catalog}. * * @return the builder */ public static CatalogBuilder builder() { return new CatalogBuilder(); }
@Bean public Catalog catalog() { return Catalog.builder().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); }
@Test public void catalogIsReturned() { Catalog expectedCatalog = Catalog.builder().build(); when(catalogService.getCatalog()).thenReturn(Mono.just(expectedCatalog)); CatalogController controller = new CatalogController(catalogService); Catalog actualCatalog = controller.getCatalog().block(); assertThat(actualCatalog).isEqualTo(expectedCatalog); }
@Test public void emptyCatalogIsSerializedToJson() { Catalog catalog = Catalog.builder().build(); assertThat(catalog.getServiceDefinitions()).hasSize(0); DocumentContext json = JsonUtils.toJsonPath(catalog); assertThat(json).hasListAtPath("$.services").hasSize(0); }
@Bean public Catalog catalog() { return Catalog.builder().build(); } }
@Bean public Catalog catalog() { return Catalog.builder() .serviceDefinitions(ServiceFixture.getSimpleService()) .build(); }
@Bean public Catalog catalog() { return Catalog.builder() .serviceDefinitions(ServiceFixture.getSimpleService()) .build(); }
@Before public void setUp() { Catalog catalog = Catalog.builder().build(); given(catalogService.getCatalog()) .willReturn(Mono.just(catalog)); }