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