### Question:
DeleteHandler extends BaseHandler<CallbackContext> { @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Logger logger) { final ResourceModel model = request.getDesiredResourceState(); final String apiKey = model.getApiKey(); final int conditionId = model.getNrqlCondition().getId(); OperationStatus status = OperationStatus.SUCCESS; try { logger.log( String.format("Attempting to delete alert condition with ID: %d", conditionId)); alertApiClient.remove(apiKey, conditionId); logger.log(String.format("Deleted alert condition with ID: %d", conditionId)); } catch (IOException e) { status = OperationStatus.FAILED; logger.log(ExceptionUtils.getStackTrace(e)); } catch (AlertApiException e) { status = OperationStatus.FAILED; logger.log(e.getMessage()); } return ProgressEvent.<ResourceModel, CallbackContext>builder() .resourceModel(model) .status(status) .build(); } DeleteHandler();  DeleteHandler(AlertApiClient alertApiClient); @Override ProgressEvent<ResourceModel, CallbackContext> handleRequest(
            final AmazonWebServicesClientProxy proxy,
            final ResourceHandlerRequest<ResourceModel> request,
            final CallbackContext callbackContext,
            final Logger logger);  }### Answer:
@Test public void handleRequest_SimpleDeletion() throws IOException, AlertApiException { final DeleteHandler handler = new DeleteHandler(client); int conditionId = this.model.getNrqlCondition().getId(); String conditionType = this.model.getNrqlCondition().getType(); assertThat(conditionId).isEqualTo(1); assertThat(conditionType).isEqualTo("static"); final ResourceHandlerRequest<ResourceModel> request = ResourceHandlerRequest.<ResourceModel>builder().desiredResourceState(model).build(); final ProgressEvent<ResourceModel, CallbackContext> response = handler.handleRequest(proxy, request, null, logger); verify(client).remove(eq(this.model.getApiKey()), eq(conditionId)); assertThat(response).isNotNull(); assertThat(response.getMessage()).isNull(); assertThat(response.getErrorCode()).isNull(); }
@Test public void handleRequest_FailedDeletion() throws IOException, AlertApiException { final DeleteHandler handler = new DeleteHandler(client); Mockito.doThrow(new AlertApiException("test")).when(client).remove(anyString(), anyInt()); int conditionId = this.model.getNrqlCondition().getId(); String conditionType = this.model.getNrqlCondition().getType(); assertThat(conditionId).isEqualTo(1); assertThat(conditionType).isEqualTo("static"); final ResourceHandlerRequest<ResourceModel> request = ResourceHandlerRequest.<ResourceModel>builder().desiredResourceState(model).build(); final ProgressEvent<ResourceModel, CallbackContext> response = handler.handleRequest(proxy, request, null, logger); assertThat(response).isNotNull(); assertThat(response.getStatus()).isEqualTo(OperationStatus.FAILED); }