@Test(description = "This test case tests handling SQLException when all features of a device type",
      dependsOnMethods = "testGetAllFeatures",
      expectedExceptions = {IllegalTransactionStateException.class, FeatureManagementException.class})

public void testGetAllFeaturesThrowingIllegalTransactionStateException() throws Exception {
    Pair<Connection, Pair<DataSource, DataSource>> pair = mockConnection();
    PowerMockito.doThrow(new SQLException()).when(pair.second().second()).getConnection();
    try {
        featureManager.getAllFeatures(DEVICE_TYPE_D);
    } finally {
        PolicyManagementDAOFactory.init(pair.second().first());
    }
}