Search in sources :

Example 36 with Workspace

use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.

the class OpdbServiceEndpointCollectorTest method createClusterWithComponents.

private Cluster createClusterWithComponents(GatewayType gatewayType) {
    Cluster cluster = clusterWithOrchestrator("ANY");
    GatewayTopology topology1 = gatewayTopology("proxy");
    topology1.setGateway(cluster.getGateway());
    cluster.getGateway().setTopologies(Collections.singleton(topology1));
    cluster.getGateway().setGatewayType(gatewayType);
    Workspace workspace = new Workspace();
    Tenant tenant = new Tenant();
    tenant.setName("tenant");
    workspace.setTenant(tenant);
    cluster.setWorkspace(workspace);
    return cluster;
}
Also used : Tenant(com.sequenceiq.cloudbreak.workspace.model.Tenant) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) GatewayTopology(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.GatewayTopology) Workspace(com.sequenceiq.cloudbreak.workspace.model.Workspace)

Example 37 with Workspace

use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.

the class ServiceEndpointCollectorTest method mockBlueprintTextProcessor.

private void mockBlueprintTextProcessor() {
    Blueprint blueprint = new Blueprint();
    blueprint.setBlueprintText("{\"Blueprints\":{}}");
    Workspace workspace = new Workspace();
    Tenant tenant = new Tenant();
    tenant.setName("tenant");
    workspace.setTenant(tenant);
    blueprint.setWorkspace(workspace);
    when(blueprintService.getByNameForWorkspaceId(any(), anyLong())).thenReturn(blueprint);
    CmTemplateProcessor cmTemplateProcessor = mock(CmTemplateProcessor.class);
    when(cmTemplateProcessorFactory.get(any())).thenReturn(cmTemplateProcessor);
}
Also used : Tenant(com.sequenceiq.cloudbreak.workspace.model.Tenant) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) Workspace(com.sequenceiq.cloudbreak.workspace.model.Workspace)

Example 38 with Workspace

use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.

the class ServiceEndpointCollectorTest method createClusterWithComponents.

private Cluster createClusterWithComponents(ExposedService[] topology1Services, ExposedService[] topology2Services, GatewayType gatewayType) {
    Cluster cluster = clusterkWithOrchestrator("ANY");
    GatewayTopology topology1 = gatewayTopology("topology1", topology1Services);
    topology1.setGateway(cluster.getGateway());
    GatewayTopology topology2 = gatewayTopology("topology2", topology2Services);
    topology2.setGateway(cluster.getGateway());
    cluster.getGateway().setTopologies(Sets.newHashSet(topology1, topology2));
    cluster.getGateway().setGatewayType(gatewayType);
    Workspace workspace = new Workspace();
    Tenant tenant = new Tenant();
    tenant.setName("tenant");
    workspace.setTenant(tenant);
    cluster.setWorkspace(workspace);
    return cluster;
}
Also used : Tenant(com.sequenceiq.cloudbreak.workspace.model.Tenant) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) GatewayTopology(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.GatewayTopology) Workspace(com.sequenceiq.cloudbreak.workspace.model.Workspace)

Example 39 with Workspace

use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.

the class AuditEventServiceTest method testGetEventsForUserWithTypeAndResourceIdByWorkspaceWhenResourceCrnIsEmpty.

@Test
public void testGetEventsForUserWithTypeAndResourceIdByWorkspaceWhenResourceCrnIsEmpty() {
    Workspace workspace = new Workspace();
    long resourceId = 0L;
    when(legacyStructuredEventDBService.findByWorkspaceAndResourceTypeAndResourceId(workspace, null, resourceId)).thenReturn(Collections.emptyList());
    underTest.getEventsForUserWithTypeAndResourceIdByWorkspace(workspace, null, resourceId, "");
    verify(legacyStructuredEventDBService).findByWorkspaceAndResourceTypeAndResourceId(workspace, null, resourceId);
}
Also used : Workspace(com.sequenceiq.cloudbreak.workspace.model.Workspace) Test(org.junit.Test)

Example 40 with Workspace

use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.

the class AuditEventServiceTest method testGetEventsForUserWithTypeAndResourceIdByWorkspaceWhenResourceCrnIsNull.

@Test
public void testGetEventsForUserWithTypeAndResourceIdByWorkspaceWhenResourceCrnIsNull() {
    Workspace workspace = new Workspace();
    long resourceId = 0L;
    when(legacyStructuredEventDBService.findByWorkspaceAndResourceTypeAndResourceId(workspace, null, resourceId)).thenReturn(Collections.emptyList());
    underTest.getEventsForUserWithTypeAndResourceIdByWorkspace(workspace, null, resourceId, null);
    verify(legacyStructuredEventDBService).findByWorkspaceAndResourceTypeAndResourceId(workspace, null, resourceId);
}
Also used : Workspace(com.sequenceiq.cloudbreak.workspace.model.Workspace) Test(org.junit.Test)

Aggregations

Workspace (com.sequenceiq.cloudbreak.workspace.model.Workspace)75 User (com.sequenceiq.cloudbreak.workspace.model.User)26 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)24 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)18 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)17 Tenant (com.sequenceiq.cloudbreak.workspace.model.Tenant)12 CloudbreakUser (com.sequenceiq.cloudbreak.common.user.CloudbreakUser)9 Test (org.junit.jupiter.api.Test)9 HashMap (java.util.HashMap)8 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)7 Before (org.junit.Before)7 Test (org.junit.Test)5 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 StackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)4 Json (com.sequenceiq.cloudbreak.common.json.Json)4 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)4 StackStatus (com.sequenceiq.cloudbreak.domain.stack.StackStatus)4 ClusterTemplate (com.sequenceiq.cloudbreak.domain.stack.cluster.ClusterTemplate)4 HashSet (java.util.HashSet)4 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)4