@Test
public void testGetEntity() throws Exception {

    Mockito.when(mockResultSet.next()).thenReturn(true);
    Mockito.doReturn("{\"value\":1}").when(mockResultSet).getString(ZMSConsts.DB_COLUMN_VALUE);
    Mockito.when(mockResultSet.getInt(1)).thenReturn(5); // domain id

    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Entity entity = jdbcConn.getEntity("my-domain", "entity1");
    assertNotNull(entity);
    assertEquals("entity1", entity.getName());
    assertEquals("{\"value\":1}", JSON.string(entity.getValue()));
    Mockito.verify(mockPrepStmt, times(1)).setInt(1, 5);
    Mockito.verify(mockPrepStmt, times(1)).setString(2, "entity1");
    jdbcConn.close();
}