use of com.sequenceiq.cloudbreak.reactor.api.event.externaldatabase.StartExternalDatabaseRequest in project cloudbreak by hortonworks.
the class StartExternalDatabaseHandlerTest method acceptNonDatahub.
@Test
void acceptNonDatahub() {
DetailedEnvironmentResponse environment = new DetailedEnvironmentResponse();
environment.setCloudPlatform("AWS");
when(environmentClientService.getByCrn(anyString())).thenReturn(environment);
Stack stack = buildStack(DatabaseAvailabilityType.HA);
stack.setType(StackType.DATALAKE);
stack.getCluster().setDatabaseServerCrn(DATABASE_CRN);
when(stackService.getById(anyLong())).thenReturn(stack);
StartExternalDatabaseRequest request = new StartExternalDatabaseRequest(STACK_ID, "selector", "resourceName", "crn");
Event<StartExternalDatabaseRequest> event = new Event<>(EVENT_HEADERS, request);
underTest.accept(event);
verify(startService, never()).startDatabase(any(), any(), eq(environment));
verify(stackUpdaterService, never()).updateStatus(any(), any(), any(), any());
verify(eventBus).notify(eq("StartExternalDatabaseResult"), any(Event.class));
}
Aggregations