@Test public void notifiesWhenPluginAlreadyDisabled() { HttpRequest request = put("/foo/off/enabled").body("false", UTF_8).build(); HttpResponse response = Mono.from(handler.handle(request, requestContext())).block(); assertThat(response.status(), is(OK)); assertThat(body(response), is("{\"message\":\"State of 'off' was already 'disabled'\",\"plugin\":{\"name\":\"off\",\"state\":\"disabled\"}}")); 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);  }