@Test
public void testListModifiedDomains() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Mockito.when(mockResultSet.next()).thenReturn(true) // 3 domains
        .thenReturn(true).thenReturn(true).thenReturn(false);
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_NAME))
        .thenReturn("domain1").thenReturn("domain2").thenReturn("domain3"); // 3 domains
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ACCOUNT))
            .thenReturn("acct1").thenReturn("acct2").thenReturn("acct3"); // 3 domains
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_PRODUCT_ID))
            .thenReturn("1234").thenReturn("1235").thenReturn("1236"); // 3 domains
    Mockito.doReturn(new java.sql.Timestamp(1454358916)).when(mockResultSet).getTimestamp(ZMSConsts.DB_COLUMN_MODIFIED);
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_DESCRIPTION)).thenReturn("");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ORG)).thenReturn("");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_UUID)).thenReturn("");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_DESCRIPTION)).thenReturn("");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_SIGN_ALGORITHM)).thenReturn("rsa");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_CERT_DNS_DOMAIN)).thenReturn("");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_APPLICATION_ID)).thenReturn("");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_NOTIFY_ROLES)).thenReturn("");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_USER_AUTHORITY_FILTER)).thenReturn("");
    DomainMetaList list = jdbcConn.listModifiedDomains(1454358900);
    
    Mockito.verify(mockPrepStmt, times(1)).setTimestamp(ArgumentMatchers.eq(1),
            ArgumentMatchers.eq(new java.sql.Timestamp(1454358900)), ArgumentMatchers.isA(Calendar.class));
    
    assertEquals(3, list.getDomains().size());
    boolean domain1Found = false;
    boolean domain2Found = false;
    boolean domain3Found = false;
    for (Domain dom : list.getDomains()) {
        switch (dom.getName()) {
            case "domain1":
                domain1Found = true;
                break;
            case "domain2":
                domain2Found = true;
                break;
            case "domain3":
                domain3Found = true;
                break;
        }
    }
    assertTrue(domain1Found);
    assertTrue(domain2Found);
    assertTrue(domain3Found);
    
    jdbcConn.close();
}