use of com.sequenceiq.environment.environment.dto.EnvironmentViewDto 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.dto.EnvironmentViewDto in project cloudbreak by hortonworks.
the class EnvironmentController method deleteByCrn.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_ENVIRONMENT)
public SimpleEnvironmentResponse deleteByCrn(@ValidCrn(resource = CrnResourceDescriptor.ENVIRONMENT) @ResourceCrn @TenantAwareParam String crn, boolean cascading, boolean forced) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
String actualUserCrn = ThreadBasedUserCrnProvider.getUserCrn();
EnvironmentViewDto environmentDto = environmentDeletionService.deleteByCrnAndAccountId(crn, accountId, actualUserCrn, cascading, forced);
return environmentResponseConverter.dtoToSimpleResponse(environmentDto);
}
use of com.sequenceiq.environment.environment.dto.EnvironmentViewDto in project cloudbreak by hortonworks.
the class EnvironmentController method deleteByName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_ENVIRONMENT)
public SimpleEnvironmentResponse deleteByName(@ResourceName String environmentName, boolean cascading, boolean forced) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
String actualUserCrn = ThreadBasedUserCrnProvider.getUserCrn();
EnvironmentViewDto environmentDto = environmentDeletionService.deleteByNameAndAccountId(environmentName, accountId, actualUserCrn, cascading, forced);
return environmentResponseConverter.dtoToSimpleResponse(environmentDto);
}
Aggregations