@Test(description = "This test case tests handling SQLException when adding new profile feature",
      dependsOnMethods = "testAddProfileFeatureThrowingFeatureManagerDAOException",
      expectedExceptions = IllegalTransactionStateException.class)
public void testAddProfileThrowingIllegalTransactionStateException() throws Exception {

    //Creating profile object
    Profile profile = ProfileCreator.getProfile(FeatureCreator.getFeatureList(), DEVICE_TYPE_D);
    ProfileFeature profileFeature = profile.getProfileFeaturesList().get(0);
    Pair<Connection, Pair<DataSource, DataSource>> pair = mockConnection();
    PowerMockito.doThrow(new SQLException()).when(pair.first()).setAutoCommit(anyBoolean());
    try {
        featureManager.addProfileFeature(profileFeature, profile.getProfileId());
    } finally {
        PolicyManagementDAOFactory.init(pair.second().first());
    }
}