use of com.sequenceiq.freeipa.entity.InstanceMetaData in project cloudbreak by hortonworks.
the class UpgradeValidationServiceTest method createAvailableInstance.
public InstanceMetaData createAvailableInstance(String id) {
InstanceMetaData instanceMetaData = new InstanceMetaData();
instanceMetaData.setInstanceId(id);
instanceMetaData.setInstanceStatus(InstanceStatus.CREATED);
return instanceMetaData;
}
use of com.sequenceiq.freeipa.entity.InstanceMetaData in project cloudbreak by hortonworks.
the class UpgradeValidationServiceTest method testNotAvailableInstances.
@Test
public void testNotAvailableInstances() {
Stack stack = mock(Stack.class);
InstanceMetaData im2 = createAvailableInstance("im2");
im2.setInstanceStatus(InstanceStatus.DELETED_ON_PROVIDER_SIDE);
Set<InstanceMetaData> allInstances = Set.of(createAvailableInstance("im1"), im2);
assertThrows(BadRequestException.class, () -> underTest.validateStackForUpgrade(allInstances, stack));
}
use of com.sequenceiq.freeipa.entity.InstanceMetaData in project cloudbreak by hortonworks.
the class UpgradeValidationServiceTest method testStackNotAvailable.
@Test
public void testStackNotAvailable() {
Stack stack = mock(Stack.class);
when(stack.isAvailable()).thenReturn(Boolean.FALSE);
StackStatus stackStatus = new StackStatus();
stackStatus.setStatus(Status.DELETED_ON_PROVIDER_SIDE);
when(stack.getStackStatus()).thenReturn(stackStatus);
Set<InstanceMetaData> allInstances = Set.of(createAvailableInstance("im1"), createAvailableInstance("im2"));
assertThrows(BadRequestException.class, () -> underTest.validateStackForUpgrade(allInstances, stack));
}
use of com.sequenceiq.freeipa.entity.InstanceMetaData in project cloudbreak by hortonworks.
the class UpgradeValidationServiceTest method testStackValidationOk.
@Test
public void testStackValidationOk() {
Stack stack = mock(Stack.class);
when(stack.isAvailable()).thenReturn(Boolean.TRUE);
Set<InstanceMetaData> allInstances = Set.of(createAvailableInstance("im1"), createAvailableInstance("im2"));
underTest.validateStackForUpgrade(allInstances, stack);
allInstances = Set.of(createAvailableInstance("im1"), createAvailableInstance("im2"), createAvailableInstance("im3"));
underTest.validateStackForUpgrade(allInstances, stack);
allInstances = Set.of(createAvailableInstance("im1"));
underTest.validateStackForUpgrade(allInstances, stack);
}
use of com.sequenceiq.freeipa.entity.InstanceMetaData in project cloudbreak by hortonworks.
the class FreeIpaNodeUtilServiceTest method before.
@BeforeEach
void before() {
Template template = new Template();
template.setInstanceType(INSTANCE_TYPE);
InstanceGroup ig = new InstanceGroup();
ig.setTemplate(template);
ig.setGroupName(GROUP_NAME);
im = new InstanceMetaData();
im.setPrivateIp(PRIVATE_IP);
im.setInstanceId(INSTANCE_ID);
im.setInstanceGroup(ig);
im.setDiscoveryFQDN(FQDN);
}
Aggregations