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;
}
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);
}
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;
}
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);
}
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);
}
Aggregations