@Test
public void testUpdateEmrClusterDefinitionWithAllValidInstanceFleetSubnets()
{

    // Create an AWS params DTO
    AwsParamsDto awsParamsDto = new AwsParamsDto();
    // Create an EMR cluster alternate key DTO
    EmrClusterAlternateKeyDto emrClusterAlternateKeyDto = new EmrClusterAlternateKeyDto(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME);
    // Create an EMR cluster definition object
    EmrClusterDefinition emrClusterDefinition = new EmrClusterDefinition();
    emrClusterDefinition.setInstanceFleetMinimumIpAvailableFilter(1);
    emrClusterDefinition.setSubnetId("SUBNET_1,SUBNET_2,SUBNET_3");
    // Create subnet object
    List<Subnet> subnets = initializeTestSubnets(3);
    // Mock the external calls.
    when(emrPricingHelper.getSubnets(emrClusterDefinition, awsParamsDto)).thenReturn(subnets);
    when(jsonHelper.objectToJson(Mockito.any())).thenReturn("{jsonFormattedSubnetsAvailability}");
    // Call the method under test.
    emrHelperServiceImpl.updateEmrClusterDefinitionWithValidInstanceFleetSubnets(emrClusterAlternateKeyDto, emrClusterDefinition, awsParamsDto);
    // Verify correct value
    assertEquals("SUBNET_1,SUBNET_2,SUBNET_3", emrClusterDefinition.getSubnetId());
    // Verify the external calls.
    verify(emrPricingHelper).getSubnets(emrClusterDefinition, awsParamsDto);
    verify(jsonHelper).objectToJson(Mockito.any());
    verifyNoMoreInteractionsHelper();
}