Search in sources :

Example 11 with InstanceGroupAdjustmentJson

use of com.sequenceiq.cloudbreak.api.model.InstanceGroupAdjustmentJson in project cloudbreak by hortonworks.

the class UpdateStackRequestValidatorTest method testIsValidShouldReturnTrueWhenNodeCountIsUpdated.

@Test
public void testIsValidShouldReturnTrueWhenNodeCountIsUpdated() {
    UpdateStackJson updateStackJson = new UpdateStackJson();
    InstanceGroupAdjustmentJson instanceGroupAdjustmentJson = new InstanceGroupAdjustmentJson();
    instanceGroupAdjustmentJson.setScalingAdjustment(12);
    instanceGroupAdjustmentJson.setInstanceGroup("slave_1");
    updateStackJson.setInstanceGroupAdjustment(instanceGroupAdjustmentJson);
    updateStackJson.setStatus(null);
    boolean valid = underTest.isValid(updateStackJson, constraintValidatorContext);
    assertTrue(valid);
}
Also used : UpdateStackJson(com.sequenceiq.cloudbreak.api.model.UpdateStackJson) InstanceGroupAdjustmentJson(com.sequenceiq.cloudbreak.api.model.InstanceGroupAdjustmentJson) Test(org.junit.Test)

Aggregations

InstanceGroupAdjustmentJson (com.sequenceiq.cloudbreak.api.model.InstanceGroupAdjustmentJson)11 UpdateStackJson (com.sequenceiq.cloudbreak.api.model.UpdateStackJson)8 Test (org.junit.Test)4 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)3 AbstractCloudbreakIntegrationTest (com.sequenceiq.it.cloudbreak.AbstractCloudbreakIntegrationTest)3 Parameters (org.testng.annotations.Parameters)3 Test (org.testng.annotations.Test)3 StackV1Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v1.StackV1Endpoint)2 HostGroupAdjustmentJson (com.sequenceiq.cloudbreak.api.model.HostGroupAdjustmentJson)2 StackResponse (com.sequenceiq.cloudbreak.api.model.StackResponse)2 CloudbreakClient (com.sequenceiq.cloudbreak.client.CloudbreakClient)2 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 Strings (com.google.api.client.repackaged.com.google.common.base.Strings)1 AmbariAddressJson (com.sequenceiq.cloudbreak.api.model.AmbariAddressJson)1 AutoscaleStackResponse (com.sequenceiq.cloudbreak.api.model.AutoscaleStackResponse)1 DetailedStackStatus (com.sequenceiq.cloudbreak.api.model.DetailedStackStatus)1 InstanceStatus (com.sequenceiq.cloudbreak.api.model.InstanceStatus)1 AVAILABLE (com.sequenceiq.cloudbreak.api.model.Status.AVAILABLE)1 STOPPED (com.sequenceiq.cloudbreak.api.model.Status.STOPPED)1