@Test
public void testGetResources_ExceptionOnExecute() throws Exception {

    thrown.expect(SystemException.class);
    thrown.expectMessage("Can't get current queries.");
    expect(viewContext.getProperties()).andReturn(prepareViewContextProperties()).anyTimes();
    expect(dataSource.getConnection("host1", "1234", "gpadmin-user", "gpadmin-password")).andReturn(connection);
    expect(connection.createStatement()).andReturn(statement);
    expect(statement.executeQuery(anyString())).andStubThrow(new SQLException("test message"));
    statement.close();
    expectLastCall().once();
    connection.close();
    expectLastCall().once();
    replayAll();
    provider.getResources(null);
}