use of com.sequenceiq.cloudbreak.reactor.api.event.externaldatabase.TerminateExternalDatabaseRequest in project cloudbreak by hortonworks.
the class TerminateExternalDatabaseHandlerTest method acceptDbNone.
@Test
void acceptDbNone() {
when(stackService.getById(anyLong())).thenReturn(buildStack(DatabaseAvailabilityType.NONE));
TerminateExternalDatabaseRequest request = new TerminateExternalDatabaseRequest(STACK_ID, "selector", "resourceName", "crn", false);
Event<TerminateExternalDatabaseRequest> event = new Event<>(EVENT_HEADERS, request);
underTest.accept(event);
verifyNoMoreInteractions(terminationService);
verifyNoMoreInteractions(stackUpdaterService);
ArgumentCaptor<Event<TerminateExternalDatabaseResult>> eventCaptor = ArgumentCaptor.forClass(Event.class);
verify(eventBus).notify(eq("TerminateExternalDatabaseResult"), eventCaptor.capture());
Event<TerminateExternalDatabaseResult> value = eventCaptor.getValue();
assertThat(value.getHeaders()).isEqualTo(EVENT_HEADERS);
assertThat(value.getData().getResourceCrn()).isNull();
}
Aggregations