use of com.sequenceiq.environment.environment.domain.EnvironmentView in project cloudbreak by hortonworks.
the class EnvironmentDeletionServiceTest method setup.
@BeforeEach
public void setup() {
environmentView = new EnvironmentView();
environmentViewDto = new EnvironmentViewDto();
when(environmentService.findNameWithAccountIdAndParentEnvIdAndArchivedIsFalse(any(), any())).thenReturn(emptyList());
}
use of com.sequenceiq.environment.environment.domain.EnvironmentView in project cloudbreak by hortonworks.
the class SdxDeleteServiceTest method deleteSdxClustersForEnvironmentFail.
@Test
void deleteSdxClustersForEnvironmentFail() {
PollingConfig pollingConfig = getPollingConfig();
EnvironmentView environment = getEnvironmentView();
String sdxCrn1 = "crn:cdp:datalake:us-west-1:tenant:datalake:crn1";
String sdxCrn2 = "crn:cdp:sdxsvc:us-west-1:tenant:instance:crn2";
when(environmentResourceDeletionService.getAttachedSdxClusterCrns(environment)).thenReturn(Set.of(sdxCrn1, sdxCrn2));
when(platformAwareSdxConnector.getAttemptResultForDeletion(any(), any(), any())).thenReturn(AttemptResults.breakFor(new IllegalStateException()));
assertThatThrownBy(() -> underTest.deleteSdxClustersForEnvironment(pollingConfig, environment, true)).isInstanceOf(UserBreakException.class).hasCauseInstanceOf(IllegalStateException.class);
verify(platformAwareSdxConnector).delete(eq(sdxCrn1), eq(true));
verify(platformAwareSdxConnector).delete(eq(sdxCrn2), eq(true));
verifyNoMoreInteractions(platformAwareSdxConnector);
}
use of com.sequenceiq.environment.environment.domain.EnvironmentView in project cloudbreak by hortonworks.
the class SdxDeleteServiceTest method getEnvironmentView.
private EnvironmentView getEnvironmentView() {
EnvironmentView environment = new EnvironmentView();
environment.setName("envName");
environment.setResourceCrn(CrnTestUtil.getEnvironmentCrnBuilder().setAccountId("asd").setResource("asd").build().toString());
return environment;
}
use of com.sequenceiq.environment.environment.domain.EnvironmentView in project cloudbreak by hortonworks.
the class SdxDeleteServiceTest method deleteSdxClustersForEnvironmentNoSdxFound.
@Test
void deleteSdxClustersForEnvironmentNoSdxFound() {
PollingConfig pollingConfig = getPollingConfig();
EnvironmentView environment = getEnvironmentView();
when(environmentResourceDeletionService.getAttachedSdxClusterCrns(environment)).thenReturn(Set.of());
underTest.deleteSdxClustersForEnvironment(pollingConfig, environment, true);
}
use of com.sequenceiq.environment.environment.domain.EnvironmentView in project cloudbreak by hortonworks.
the class EnvironmentStackConfigUpdateService method updateAllStackConfigsByCrn.
public FlowIdentifier updateAllStackConfigsByCrn(String envCrn) {
String accountId = Crn.safeFromString(envCrn).getAccountId();
EnvironmentView environmentView = environmentViewService.getByCrnAndAccountId(envCrn, accountId);
String userCrn = ThreadBasedUserCrnProvider.getUserCrn();
return reactorFlowManager.triggerStackConfigUpdatesFlow(environmentView, userCrn);
}
Aggregations