Search in sources :

Example 6 with CloudIdentity

use of com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity in project cloudbreak by hortonworks.

the class CloudFileSystemViewProviderTest method testBuild.

@Test
public void testBuild() {
    List<CloudIdentity> cloudIdentities = getCloudIdentities();
    CloudStorage cloudStorage = getCloudStorage(cloudIdentities);
    FileSystem fileSystem = getFileSystem(cloudStorage);
    Map<String, Set<String>> componentsByHostGroup = new HashMap<>();
    InstanceGroup idBrokerGroup = getIdBrokerGroup(componentsByHostGroup);
    InstanceGroup computeGroup = new InstanceGroup();
    computeGroup.setGroupName(COMPUTE_INSTANCE_GROUP_NAME);
    componentsByHostGroup.put(COMPUTE_INSTANCE_GROUP_NAME, new HashSet<>());
    Optional<CloudFileSystemView> idBrokerGroupResult = cloudFileSystemViewProvider.getCloudFileSystemView(fileSystem, componentsByHostGroup, idBrokerGroup);
    Assertions.assertEquals(idBrokerGroupResult.get().getCloudIdentityType(), CloudIdentityType.ID_BROKER);
    Optional<CloudFileSystemView> computeGroupResult = cloudFileSystemViewProvider.getCloudFileSystemView(fileSystem, componentsByHostGroup, computeGroup);
    Assertions.assertEquals(computeGroupResult.get().getCloudIdentityType(), CloudIdentityType.LOG);
    Mockito.verify(instanceGroupService, Mockito.times(2)).setCloudIdentityType(any(), any());
}
Also used : CloudStorage(com.sequenceiq.cloudbreak.domain.cloudstorage.CloudStorage) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) CloudIdentity(com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity) FileSystem(com.sequenceiq.cloudbreak.domain.FileSystem) CloudFileSystemView(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) Test(org.junit.Test)

Example 7 with CloudIdentity

use of com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity in project cloudbreak by hortonworks.

the class CloudFileSystemViewProviderTest method testBuildWithNullComponents.

@Test
public void testBuildWithNullComponents() {
    List<CloudIdentity> cloudIdentities = getCloudIdentities();
    CloudStorage cloudStorage = getCloudStorage(cloudIdentities);
    FileSystem fileSystem = getFileSystem(cloudStorage);
    Map<String, Set<String>> componentsByHostGroup = new HashMap<>();
    InstanceGroup idBrokerGroup = getIdBrokerGroup(componentsByHostGroup);
    InstanceGroup computeGroup = new InstanceGroup();
    computeGroup.setGroupName(COMPUTE_INSTANCE_GROUP_NAME);
    componentsByHostGroup.put(COMPUTE_INSTANCE_GROUP_NAME, null);
    Optional<CloudFileSystemView> idBrokerGroupResult = cloudFileSystemViewProvider.getCloudFileSystemView(fileSystem, componentsByHostGroup, idBrokerGroup);
    Assertions.assertEquals(idBrokerGroupResult.get().getCloudIdentityType(), CloudIdentityType.ID_BROKER);
    Optional<CloudFileSystemView> computeGroupResult = cloudFileSystemViewProvider.getCloudFileSystemView(fileSystem, componentsByHostGroup, computeGroup);
    Assertions.assertEquals(computeGroupResult.get().getCloudIdentityType(), CloudIdentityType.LOG);
}
Also used : CloudStorage(com.sequenceiq.cloudbreak.domain.cloudstorage.CloudStorage) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) CloudIdentity(com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity) FileSystem(com.sequenceiq.cloudbreak.domain.FileSystem) CloudFileSystemView(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) Test(org.junit.Test)

Aggregations

CloudIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity)7 FileSystem (com.sequenceiq.cloudbreak.domain.FileSystem)5 CloudStorage (com.sequenceiq.cloudbreak.domain.cloudstorage.CloudStorage)5 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)3 S3Identity (com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity)3 StorageLocation (com.sequenceiq.cloudbreak.domain.cloudstorage.StorageLocation)3 HashMap (java.util.HashMap)3 SpiFileSystem (com.sequenceiq.cloudbreak.cloud.model.SpiFileSystem)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 AccountMapping (com.sequenceiq.cloudbreak.domain.cloudstorage.AccountMapping)2 AdlsGen2Identity (com.sequenceiq.cloudbreak.domain.cloudstorage.AdlsGen2Identity)2 EfsIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.EfsIdentity)2 GcsIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.GcsIdentity)2 WasbIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.WasbIdentity)2 InstanceGroup (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 Test (org.junit.Test)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 CloudS3View (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudS3View)1