Search in sources :

Example 1 with Entity

use of com.sequenceiq.it.cloudbreak.Entity 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);
}
Also used : Collection(java.util.Collection) BlueprintV4ViewResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse) BlueprintV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4Response) CloudbreakTest(com.sequenceiq.it.cloudbreak.CloudbreakTest) Log(com.sequenceiq.it.cloudbreak.log.Log) Set(java.util.Set) Entity(com.sequenceiq.it.cloudbreak.Entity) IOException(java.io.IOException) IntegrationTestContext(com.sequenceiq.it.IntegrationTestContext) BlueprintTestDto(com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) Collectors(java.util.stream.Collectors) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) BlueprintTestDto(com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto) BlueprintV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4Response) BlueprintV4ViewResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse)

Aggregations

BlueprintV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4Response)1 BlueprintV4ViewResponse (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse)1 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)1 CloudbreakClient (com.sequenceiq.it.cloudbreak.CloudbreakClient)1 CloudbreakTest (com.sequenceiq.it.cloudbreak.CloudbreakTest)1 Entity (com.sequenceiq.it.cloudbreak.Entity)1 BlueprintTestDto (com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto)1 Log (com.sequenceiq.it.cloudbreak.log.Log)1 IOException (java.io.IOException)1 Collection (java.util.Collection)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1