use of com.sequenceiq.environment.api.v1.environment.model.response.SimpleEnvironmentResponses in project cloudbreak by hortonworks.
the class EnvironmentDeleteMultipleByCrnsAction method environmentAction.
@Override
protected EnvironmentTestDto environmentAction(TestContext testContext, EnvironmentTestDto testDto, EnvironmentClient client) throws Exception {
SimpleEnvironmentResponses delete = client.getDefaultClient().environmentV1Endpoint().deleteMultipleByCrns(crns, true, false);
testDto.setResponseSimpleEnvSet(delete.getResponses());
Log.whenJson("Environments delete response: ", delete);
return testDto;
}
use of com.sequenceiq.environment.api.v1.environment.model.response.SimpleEnvironmentResponses in project cloudbreak by hortonworks.
the class EnvironmentServiceDecoratorTest method testPrepareEnvironmentsAndCredentialWithoutNameAndCrnWhenNameProvidedThenShouldCallGetEnvironmentList.
@Test
void testPrepareEnvironmentsAndCredentialWithoutNameAndCrnWhenNameProvidedThenShouldCallGetEnvironmentList() {
SimpleEnvironmentResponses simpleEnvironmentResponses = new SimpleEnvironmentResponses();
SimpleEnvironmentResponse simpleEnvironmentResponse = new SimpleEnvironmentResponse();
CredentialViewResponse credentialViewResponse = new CredentialViewResponse();
NameOrCrn nameOrCrn = mock(NameOrCrn.class);
StackViewV4Response stackViewV4Response = new StackViewV4Response();
stackViewV4Response.setEnvironmentCrn("env-crn");
Set<StackViewV4Response> stackViewResponses = Set.of(stackViewV4Response);
when(nameOrCrn.hasCrn()).thenReturn(false);
when(nameOrCrn.hasName()).thenReturn(false);
credentialViewResponse.setName("credential-name");
simpleEnvironmentResponse.setCredential(credentialViewResponse);
simpleEnvironmentResponse.setName("env-name");
simpleEnvironmentResponse.setCrn("env-crn");
simpleEnvironmentResponses.setResponses(Set.of(simpleEnvironmentResponse));
when(environmentClientService.list()).thenReturn(simpleEnvironmentResponses);
underTest.prepareEnvironmentsAndCredentialName(stackViewResponses, nameOrCrn);
verify(environmentClientService, times(1)).list();
assertEquals(stackViewResponses.iterator().next().getEnvironmentName(), "env-name");
assertEquals(stackViewResponses.iterator().next().getCredentialName(), "credential-name");
assertEquals(stackViewResponses.iterator().next().isGovCloud(), false);
}
use of com.sequenceiq.environment.api.v1.environment.model.response.SimpleEnvironmentResponses in project cloudbreak by hortonworks.
the class EnvironmentDeleteMultipleByNamesAction method environmentAction.
@Override
protected EnvironmentTestDto environmentAction(TestContext testContext, EnvironmentTestDto testDto, EnvironmentClient client) throws Exception {
SimpleEnvironmentResponses delete = client.getDefaultClient().environmentV1Endpoint().deleteMultipleByNames(envNames, true, false);
testDto.setResponseSimpleEnvSet(delete.getResponses());
Log.whenJson("Environments delete response: ", delete);
return testDto;
}
Aggregations