@Test public void handleRequest_SimpleSuccess() { final ListHandler handler = new ListHandler(); final List<ConfigurationSet> existingResources = new ArrayList<>(); ConfigurationSet set1 = ConfigurationSet.builder().name("set1").build(); ConfigurationSet set2 = ConfigurationSet.builder().name("set2").build(); existingResources.add(set1); existingResources.add(set2); final ListConfigurationSetsResponse listResponse = ListConfigurationSetsResponse.builder() .configurationSets(existingResources) .build(); doReturn(listResponse) .when(proxy) .injectCredentialsAndInvokeV2( ArgumentMatchers.any(), ArgumentMatchers.any() ); final ResourceHandlerRequest<ResourceModel> request = ResourceHandlerRequest.<ResourceModel>builder() .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().size()).isEqualTo(2); assertThatModelsAreEqual(response.getResourceModels().get(0), set1); assertThatModelsAreEqual(response.getResourceModels().get(1), set2); assertThat(response.getMessage()).isNull(); assertThat(response.getErrorCode()).isNull(); }
@Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Logger logger) { this.proxy = proxy; this.client = ClientBuilder.getClient(); final List<ResourceModel> models = listConfigurationSets(); return ProgressEvent.<ResourceModel, CallbackContext>builder() .resourceModels(models) .status(OperationStatus.SUCCESS) .build(); }
ListHandler extends BaseHandler<CallbackContext> { @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Logger logger) { this.proxy = proxy; this.client = ClientBuilder.getClient(); final List<ResourceModel> models = listConfigurationSets(); return ProgressEvent.<ResourceModel, CallbackContext>builder() .resourceModels(models) .status(OperationStatus.SUCCESS) .build(); } }
ListHandler extends BaseHandler<CallbackContext> { @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Logger logger) { this.proxy = proxy; this.client = ClientBuilder.getClient(); final List<ResourceModel> models = listConfigurationSets(); return ProgressEvent.<ResourceModel, CallbackContext>builder() .resourceModels(models) .status(OperationStatus.SUCCESS) .build(); }  }
ListHandler extends BaseHandler<CallbackContext> { @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Logger logger) { this.proxy = proxy; this.client = ClientBuilder.getClient(); final List<ResourceModel> models = listConfigurationSets(); return ProgressEvent.<ResourceModel, CallbackContext>builder() .resourceModels(models) .status(OperationStatus.SUCCESS) .build(); }  @Override ProgressEvent<ResourceModel, CallbackContext> handleRequest(
        final AmazonWebServicesClientProxy proxy,
        final ResourceHandlerRequest<ResourceModel> request,
        final CallbackContext callbackContext,
        final Logger logger); }
ListHandler extends BaseHandler<CallbackContext> { @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Logger logger) { this.proxy = proxy; this.client = ClientBuilder.getClient(); final List<ResourceModel> models = listConfigurationSets(); return ProgressEvent.<ResourceModel, CallbackContext>builder() .resourceModels(models) .status(OperationStatus.SUCCESS) .build(); }  @Override ProgressEvent<ResourceModel, CallbackContext> handleRequest(
        final AmazonWebServicesClientProxy proxy,
        final ResourceHandlerRequest<ResourceModel> request,
        final CallbackContext callbackContext,
        final Logger logger);  }