@Test void accept() { when(cloudPlatformConnectors.get(any(CloudPlatformVariant.class))).thenReturn(cloudConnector); when(cloudConnector.platformResources()).thenReturn(platformResources); CloudCredential cloudCredential = new CloudCredential("id", "name"); GetPlatformNoSqlTablesRequest request = spy(new GetPlatformNoSqlTablesRequest(cloudCredential, new ExtendedCloudCredential( cloudCredential, "aws", "desc", "crn", "account"), "aws", "region", null)); underTest.accept(new Event<>(request)); verify(platformResources).noSqlTables(eq(cloudCredential), eq(Region.region("region")), isNull()); verify(request).getResult(); }
@Override public void accept(Event<GetPlatformNoSqlTablesRequest> event) { LOGGER.debug("Received event: {}", event); GetPlatformNoSqlTablesRequest request = event.getData(); try { CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant( Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant())); CloudNoSqlTables cloudNoSqlTables = cloudPlatformConnectors.get(cloudPlatformVariant) .platformResources().noSqlTables(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters()); GetPlatformNoSqlTablesResult result = new GetPlatformNoSqlTablesResult(request.getResourceId(), cloudNoSqlTables); request.getResult().onNext(result); LOGGER.debug("Query platform NoSQL tables finished."); } catch (RuntimeException e) { request.getResult().onNext(new GetPlatformNoSqlTablesResult(e.getMessage(), e, request.getResourceId())); } }
GetPlatformNoSqlTablesHandler implements CloudPlatformEventHandler<GetPlatformNoSqlTablesRequest> { @Override public void accept(Event<GetPlatformNoSqlTablesRequest> event) { LOGGER.debug("Received event: {}", event); GetPlatformNoSqlTablesRequest request = event.getData(); try { CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant( Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant())); CloudNoSqlTables cloudNoSqlTables = cloudPlatformConnectors.get(cloudPlatformVariant) .platformResources().noSqlTables(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters()); GetPlatformNoSqlTablesResult result = new GetPlatformNoSqlTablesResult(request.getResourceId(), cloudNoSqlTables); request.getResult().onNext(result); LOGGER.debug("Query platform NoSQL tables finished."); } catch (RuntimeException e) { request.getResult().onNext(new GetPlatformNoSqlTablesResult(e.getMessage(), e, request.getResourceId())); } } }
GetPlatformNoSqlTablesHandler implements CloudPlatformEventHandler<GetPlatformNoSqlTablesRequest> { @Override public void accept(Event<GetPlatformNoSqlTablesRequest> event) { LOGGER.debug("Received event: {}", event); GetPlatformNoSqlTablesRequest request = event.getData(); try { CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant( Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant())); CloudNoSqlTables cloudNoSqlTables = cloudPlatformConnectors.get(cloudPlatformVariant) .platformResources().noSqlTables(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters()); GetPlatformNoSqlTablesResult result = new GetPlatformNoSqlTablesResult(request.getResourceId(), cloudNoSqlTables); request.getResult().onNext(result); LOGGER.debug("Query platform NoSQL tables finished."); } catch (RuntimeException e) { request.getResult().onNext(new GetPlatformNoSqlTablesResult(e.getMessage(), e, request.getResourceId())); } }  }
GetPlatformNoSqlTablesHandler implements CloudPlatformEventHandler<GetPlatformNoSqlTablesRequest> { @Override public void accept(Event<GetPlatformNoSqlTablesRequest> event) { LOGGER.debug("Received event: {}", event); GetPlatformNoSqlTablesRequest request = event.getData(); try { CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant( Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant())); CloudNoSqlTables cloudNoSqlTables = cloudPlatformConnectors.get(cloudPlatformVariant) .platformResources().noSqlTables(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters()); GetPlatformNoSqlTablesResult result = new GetPlatformNoSqlTablesResult(request.getResourceId(), cloudNoSqlTables); request.getResult().onNext(result); LOGGER.debug("Query platform NoSQL tables finished."); } catch (RuntimeException e) { request.getResult().onNext(new GetPlatformNoSqlTablesResult(e.getMessage(), e, request.getResourceId())); } }  @Override Class<GetPlatformNoSqlTablesRequest> type(); @Override void accept(Event<GetPlatformNoSqlTablesRequest> event); }
GetPlatformNoSqlTablesHandler implements CloudPlatformEventHandler<GetPlatformNoSqlTablesRequest> { @Override public void accept(Event<GetPlatformNoSqlTablesRequest> event) { LOGGER.debug("Received event: {}", event); GetPlatformNoSqlTablesRequest request = event.getData(); try { CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant( Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant())); CloudNoSqlTables cloudNoSqlTables = cloudPlatformConnectors.get(cloudPlatformVariant) .platformResources().noSqlTables(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters()); GetPlatformNoSqlTablesResult result = new GetPlatformNoSqlTablesResult(request.getResourceId(), cloudNoSqlTables); request.getResult().onNext(result); LOGGER.debug("Query platform NoSQL tables finished."); } catch (RuntimeException e) { request.getResult().onNext(new GetPlatformNoSqlTablesResult(e.getMessage(), e, request.getResourceId())); } }  @Override Class<GetPlatformNoSqlTablesRequest> type(); @Override void accept(Event<GetPlatformNoSqlTablesRequest> event);  }