@Test
public void testGetQuota() throws Exception {

    Mockito.when(mockResultSet.next()).thenReturn(true);
    Mockito.doReturn(7).when(mockResultSet).getInt(1); // domain id
    Mockito.doReturn(10).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_ASSERTION);
    Mockito.doReturn(11).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_ROLE);
    Mockito.doReturn(12).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_ROLE_MEMBER);
    Mockito.doReturn(13).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_POLICY);
    Mockito.doReturn(14).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_SERVICE);
    Mockito.doReturn(15).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_SERVICE_HOST);
    Mockito.doReturn(16).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_PUBLIC_KEY);
    Mockito.doReturn(17).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_ENTITY);
    Mockito.doReturn(18).when(mockResultSet).getInt(ZMSConsts.DB_COLUMN_SUBDOMAIN);
    Mockito.doReturn(new java.sql.Timestamp(1454358916)).when(mockResultSet).getTimestamp(ZMSConsts.DB_COLUMN_MODIFIED);
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Quota quota = jdbcConn.getQuota("athenz");
    assertNotNull(quota);
    assertEquals(quota.getAssertion(), 10);
    assertEquals(quota.getRole(), 11);
    assertEquals(quota.getRoleMember(), 12);
    assertEquals(quota.getPolicy(), 13);
    assertEquals(quota.getService(), 14);
    assertEquals(quota.getServiceHost(), 15);
    assertEquals(quota.getPublicKey(), 16);
    assertEquals(quota.getEntity(), 17);
    assertEquals(quota.getSubdomain(), 18);
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "athenz");
    Mockito.verify(mockPrepStmt, times(1)).setInt(1, 7);
    jdbcConn.close();
}