@Test
public void testGetServiceId() throws Exception {

    // first time success from mysql, second time failure so
    // we can verify we get the value from our cache
    
    Mockito.when(mockResultSet.next()).thenReturn(true).thenReturn(false);
    Mockito.doReturn(9).when(mockResultSet).getInt(1);
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    assertEquals(9, jdbcConn.getServiceId(7, "service1"));
    assertEquals(9, jdbcConn.getServiceId(7, "service1"));
    jdbcConn.close();
}