ListHandler extends BaseHandler<CallbackContext> { @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Logger logger) { final ListComponentsResponse response = proxy.injectCredentialsAndInvokeV2(RequestUtil.generateListComponentRequest(request.getNextToken()), ClientBuilder.getImageBuilderClient()::listComponents); return ProgressEvent.<ResourceModel, CallbackContext>builder() .status(OperationStatus.SUCCESS) .resourceModels(Translator.translateForList(response)) .nextToken(response.nextToken()) .build(); }  @Override ProgressEvent<ResourceModel, CallbackContext> handleRequest(
        final AmazonWebServicesClientProxy proxy,
        final ResourceHandlerRequest<ResourceModel> request,
        final CallbackContext callbackContext,
        final Logger logger);  }
@Test public void handleRequest_SimpleSuccess() { final ListComponentsResponse listComponentsResponse = ListComponentsResponse.builder() .componentVersionList(COMPONENT_VERSIONS) .build(); doReturn(listComponentsResponse) .when(proxy) .injectCredentialsAndInvokeV2(any(), any()); final ListHandler handler = new ListHandler(); final ResourceModel model = ResourceModel.builder().build(); 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.SUCCESS); assertThat(response.getCallbackContext()).isNull(); assertThat(response.getCallbackDelaySeconds()).isEqualTo(0); assertThat(response.getResourceModel()).isNull(); assertThat(response.getResourceModels()).isNotNull(); assertThat(response.getMessage()).isNull(); assertThat(response.getErrorCode()).isNull(); }