CatalogController extends BaseController { @GetMapping({"/v2/catalog", "{platformInstanceId}/v2/catalog"}) public Mono<Catalog> getCatalog() { return catalogService.getCatalog() .doOnRequest(v -> LOG.info("Retrieving catalog")) .doOnSuccess(catalog -> { LOG.info("Success retrieving catalog"); LOG.debug("catalog={}", catalog); }) .doOnError(e -> LOG.error("Error retrieving catalog. error=" + e.getMessage(), e)); } CatalogController(CatalogService service); @GetMapping({"/v2/catalog", "{platformInstanceId}/v2/catalog"}) Mono<Catalog> getCatalog();  }
@Test void catalogIsReturned() { Catalog expectedCatalog = Catalog.builder().build(); given(catalogService.getCatalog()).willReturn(Mono.just(expectedCatalog)); CatalogController controller = new CatalogController(catalogService); Catalog actualCatalog = controller.getCatalog().block(); assertThat(actualCatalog).isEqualTo(expectedCatalog); }