@Test public void saysBadRequestWhenNoStateSpecified() { HttpRequest request = put("/foo/on/enabled").build(); HttpResponse response = Mono.from(handler.handle(request, requestContext())).block(); assertThat(response.status(), is(BAD_REQUEST)); assertThat(body(response), is("No such state: only 'true' and 'false' are valid.")); assertThat(initiallyEnabled.enabled(), is(true)); assertThat(initiallyDisabled.enabled(), is(false)); }
@Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return getCurrentOrPutNewState(request, context) .onError(cause -> handleErrors(cause, context)); }
PluginToggleHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return getCurrentOrPutNewState(request, context) .onError(cause -> handleErrors(cause, context)); } }
PluginToggleHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return getCurrentOrPutNewState(request, context) .onError(cause -> handleErrors(cause, context)); } PluginToggleHandler(List<NamedPlugin> plugins); }
PluginToggleHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return getCurrentOrPutNewState(request, context) .onError(cause -> handleErrors(cause, context)); } PluginToggleHandler(List<NamedPlugin> plugins); @Override Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context); }
PluginToggleHandler implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return getCurrentOrPutNewState(request, context) .onError(cause -> handleErrors(cause, context)); } PluginToggleHandler(List<NamedPlugin> plugins); @Override Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context);  }