use of com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto in project cloudbreak by hortonworks.
the class ResourceCreator method createDefaultBlueprintInternal.
public BlueprintTestDto createDefaultBlueprintInternal(TestContext testContext, String accountId, String runtimeVersion) {
try {
String bluepint = ResourceUtil.readResourceAsString(testContext.getApplicationContext(), "classpath:/blueprint/clouderamanager.bp").replaceAll("CDH_RUNTIME", runtimeVersion);
BlueprintTestDto testDto = testContext.given(BlueprintTestDto.class).withAccountId(accountId).withBlueprint(bluepint).when(blueprintTestClient.createInternalV4());
testDto.validate();
return testDto;
} catch (IOException e) {
throw new TestFailException(e.getMessage());
}
}
use of com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto in project cloudbreak by hortonworks.
the class BlueprintV4Action method post.
public static void post(IntegrationTestContext integrationTestContext, Entity entity) {
BlueprintTestDto blueprintEntity = (BlueprintTestDto) entity;
CloudbreakClient client;
client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
Log.log(" post ".concat(blueprintEntity.getName()).concat(" private blueprint. "));
blueprintEntity.setResponse(client.getDefaultClient().blueprintV4Endpoint().post(workspaceId, blueprintEntity.getRequest()));
integrationTestContext.putCleanUpParam(blueprintEntity.getName(), blueprintEntity.getResponse().getCrn());
}
use of com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto in project cloudbreak by hortonworks.
the class BlueprintV4Action method get.
public static void get(IntegrationTestContext integrationTestContext, Entity entity) throws IOException {
BlueprintTestDto blueprintEntity = (BlueprintTestDto) entity;
CloudbreakClient client;
client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
Log.log(" getByName ".concat(blueprintEntity.getName()).concat(" private blueprint by Name. "));
blueprintEntity.setResponse(client.getDefaultClient().blueprintV4Endpoint().getByName(workspaceId, blueprintEntity.getName()));
Log.whenJson(" getByName ".concat(blueprintEntity.getName()).concat(" blueprint response: "), blueprintEntity.getResponse());
}
use of com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto in project cloudbreak by hortonworks.
the class BlueprintV4Action method getAll.
public static void getAll(IntegrationTestContext integrationTestContext, Entity entity) {
BlueprintTestDto blueprintEntity = (BlueprintTestDto) entity;
CloudbreakClient client;
client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
Log.log(" getByName all private blueprints. ");
Collection<BlueprintV4ViewResponse> blueprints = client.getDefaultClient().blueprintV4Endpoint().list(workspaceId, true).getResponses();
Set<BlueprintV4Response> detailedBlueprints = blueprints.stream().map(bp -> client.getDefaultClient().blueprintV4Endpoint().getByName(workspaceId, bp.getName())).collect(Collectors.toSet());
blueprintEntity.setResponses(detailedBlueprints);
}
use of com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto in project cloudbreak by hortonworks.
the class BlueprintV4Action method delete.
public static void delete(IntegrationTestContext integrationTestContext, Entity entity) {
BlueprintTestDto blueprintEntity = (BlueprintTestDto) entity;
CloudbreakClient client;
client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
Log.log(" deleteByName ".concat(blueprintEntity.getName()).concat(" private blueprint with Name. "));
client.getDefaultClient().blueprintV4Endpoint().deleteByName(workspaceId, blueprintEntity.getName());
}
Aggregations