### Question:
UmaEnabledFilter implements Filter { @Override public Promise<ResourceResponse, ResourceException> filterDelete(final Context serverContext, final DeleteRequest request, final RequestHandler requestHandler) { return enabled(serverContext) .thenAsync(new AsyncFunction<Void, ResourceResponse, ResourceException>() { @Override public Promise<ResourceResponse, ResourceException> apply(Void value) { return requestHandler.handleDelete(serverContext, request); } }); } @Inject  UmaEnabledFilter(UmaProviderSettingsFactory umaProviderSettingsFactory); @Override Promise<ActionResponse, ResourceException> filterAction(final Context serverContext,
            final ActionRequest request, final RequestHandler requestHandler); @Override Promise<ResourceResponse, ResourceException> filterCreate(final Context serverContext,
            final CreateRequest request, final RequestHandler requestHandler); @Override Promise<ResourceResponse, ResourceException> filterDelete(final Context serverContext,
            final DeleteRequest request, final RequestHandler requestHandler); @Override Promise<ResourceResponse, ResourceException> filterPatch(final Context serverContext,
            final PatchRequest request, final RequestHandler requestHandler); @Override Promise<QueryResponse, ResourceException> filterQuery(final Context serverContext,
            final QueryRequest request, final QueryResourceHandler queryResultHandler,
            final RequestHandler requestHandler); @Override Promise<ResourceResponse, ResourceException> filterRead(final Context serverContext,
            final ReadRequest request, final RequestHandler requestHandler); @Override Promise<ResourceResponse, ResourceException> filterUpdate(final Context serverContext,
            final UpdateRequest request, final RequestHandler requestHandler);  }### Answer:
@Test(dataProvider = "factories") public void testFilterDelete(UmaProviderSettingsFactory factory, boolean expectFailure) throws Exception { UmaEnabledFilter filter = new UmaEnabledFilter(factory); DeleteRequest request = Requests.newDeleteRequest("test"); Promise<ResourceResponse, ResourceException> promise = filter.filterDelete(context, request, requestHandler); checkResult(expectFailure, promise); if (expectFailure) { verifyNoMoreInteractions(requestHandler); } else { verify(requestHandler).handleDelete(context, request); } }