@Test public void returnsAllProviders() throws IOException { StyxObjectStore<StyxObjectRecord<StyxService>> store = createTestStore(); ServiceProviderHandler handler = new ServiceProviderHandler(store); HttpRequest request = HttpRequest.get("/admin/service/providers").build(); HttpResponse response = Mono.from(handler.handle(request, requestContext())).block(); assertThat(response.status(), equalTo(OK)); List<StyxObjectDefinition> actualProviders = extractProviders(response.bodyAs(UTF_8)); assertThat(actualProviders.size(), equalTo(store.entrySet().size())); for (StyxObjectDefinition actual : actualProviders) { Optional<StyxObjectRecord<StyxService>> rec = store.get(actual.name()); assertTrue(rec.isPresent()); validateProvider(actual, rec.get()); } }
@Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return urlRouter.handle(request, context); }
ServiceProviderHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return urlRouter.handle(request, context); } }
ServiceProviderHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return urlRouter.handle(request, context); } ServiceProviderHandler(StyxObjectStore<StyxObjectRecord<StyxService>> providerDatabase); }
ServiceProviderHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return urlRouter.handle(request, context); } ServiceProviderHandler(StyxObjectStore<StyxObjectRecord<StyxService>> providerDatabase); @Override Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context); static ObjectMapper yamlMapper(); }
ServiceProviderHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return urlRouter.handle(request, context); } ServiceProviderHandler(StyxObjectStore<StyxObjectRecord<StyxService>> providerDatabase); @Override Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context); static ObjectMapper yamlMapper();  }