@Test
public void testUpdatePolicy() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Policy policy = new Policy().setName("my-domain:policy.policy1");
    Mockito.doReturn(1).when(mockPrepStmt).executeUpdate();
    Mockito.when(mockResultSet.next()).thenReturn(true);
    Mockito.when(mockResultSet.getInt(1)).thenReturn(5) // return domain id
        .thenReturn(4); //policy id
    
    boolean requestSuccess = jdbcConn.updatePolicy("my-domain", policy);
    assertTrue(requestSuccess);
    
    // get domain id
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "my-domain");
    // get policy id
    Mockito.verify(mockPrepStmt, times(1)).setInt(1, 5);
    Mockito.verify(mockPrepStmt, times(1)).setString(2, "policy1");
    // update policy
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "policy1");
    Mockito.verify(mockPrepStmt, times(1)).setInt(2, 4);
    jdbcConn.close();
}