use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ComponentLocatorServiceTest method setUp.
@Before
public void setUp() {
cluster = new Cluster();
cluster.setBlueprint(new Blueprint());
HostGroup hg1 = createHostGroup("hg1", "myhost1");
HostGroup hg2 = createHostGroup("hg2", "myhost2");
Set<String> hg1Components = set("RESOURCEMANAGER", "Service1", "HIVE_SERVER");
Set<String> hg2Components = set("NAMENODE", "Service2", "Service3");
when(hostGroupService.getByCluster(anyLong())).thenReturn(ImmutableSet.of(hg1, hg2));
when(blueprintProcessor.getComponentsInHostGroup(eq("hg1"))).thenReturn(hg1Components);
when(blueprintProcessor.getComponentsInHostGroup(eq("hg2"))).thenReturn(hg2Components);
when(blueprintProcessorFactory.get(anyString())).thenReturn(blueprintProcessor);
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class AmbariClusterSetupServiceTest method testApiAvailableWhenPollerReturnTrueThenApiShouldBeAvailable.
@Test
public void testApiAvailableWhenPollerReturnTrueThenApiShouldBeAvailable() throws CloudbreakSecuritySetupException {
Stack stack = TestUtil.stack();
Cluster cluster = TestUtil.cluster();
stack.setCluster(cluster);
AmbariClient ambariClient = ambariClient();
when(ambariPollingServiceProvider.isAmbariAvailable(stack, ambariClient)).thenReturn(true);
when(clientFactory.getAmbariClient(stack, stack.getCluster())).thenReturn(ambariClient);
boolean available = underTest.available(stack);
verify(ambariPollingServiceProvider, times(1)).isAmbariAvailable(stack, ambariClient);
verify(clientFactory, times(1)).getAmbariClient(stack, stack.getCluster());
Assert.assertTrue(available);
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class AmbariSecurityConfigProviderTest method testGetAmbariPasswordNameWhenCloudbreakAmbariPasswordIsNullThenShouldReturnPassword.
@Test
public void testGetAmbariPasswordNameWhenCloudbreakAmbariPasswordIsNullThenShouldReturnPassword() {
Cluster cluster = TestUtil.cluster();
cluster.setCloudbreakAmbariPassword(null);
cluster.setPassword("admin");
String ambariPassword = underTest.getAmbariPassword(cluster);
Assert.assertEquals("admin", ambariPassword);
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class AmbariSecurityConfigProviderTest method testGetAmbariSecurityMasterKeyWhenAmbariSecurityMasterKeyIsExistThenShouldReturnAmbariSecurityMasterKey.
@Test
public void testGetAmbariSecurityMasterKeyWhenAmbariSecurityMasterKeyIsExistThenShouldReturnAmbariSecurityMasterKey() {
Cluster cluster = TestUtil.cluster();
cluster.setAmbariSecurityMasterKey("masterkey");
String ambariSecurityMasterKey = underTest.getAmbariSecurityMasterKey(cluster);
Assert.assertEquals("masterkey", ambariSecurityMasterKey);
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class AmbariSecurityConfigProviderTest method testGetAmbariUserNameWhenCloudbreakAmbariUserNameIsNullThenShouldReturnUserName.
@Test
public void testGetAmbariUserNameWhenCloudbreakAmbariUserNameIsNullThenShouldReturnUserName() {
Cluster cluster = TestUtil.cluster();
cluster.setCloudbreakAmbariUser(null);
cluster.setUserName("admin");
String ambariUserName = underTest.getAmbariUserName(cluster);
Assert.assertEquals("admin", ambariUserName);
}
Aggregations