@Test
public void testUpdateRole() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Role role = new Role().setName("my-domain:role.role1").setAuditEnabled(true)
            .setSelfServe(true).setMemberExpiryDays(30).setTokenExpiryMins(10)
            .setCertExpiryMins(20).setSignAlgorithm("ec").setServiceExpiryDays(45)
            .setMemberReviewDays(70).setServiceReviewDays(80).setGroupExpiryDays(50)
            .setReviewEnabled(true).setNotifyRoles("role1,role2")
            .setUserAuthorityFilter("filter").setUserAuthorityExpiration("expiry");
    Mockito.doReturn(1).when(mockPrepStmt).executeUpdate();
    Mockito.when(mockResultSet.next()).thenReturn(true);
    Mockito.when(mockResultSet.getInt(1)).thenReturn(5) // return domain id
        .thenReturn(4); //role id
    
    boolean requestSuccess = jdbcConn.updateRole("my-domain", role);
    assertTrue(requestSuccess);
    
    // get domain id
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "my-domain");
    // get role id
    Mockito.verify(mockPrepStmt, times(1)).setInt(1, 5);
    Mockito.verify(mockPrepStmt, times(1)).setString(2, "role1");
    // update role
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "");
    Mockito.verify(mockPrepStmt, times(1)).setBoolean(2, true);
    Mockito.verify(mockPrepStmt, times(1)).setBoolean(3, true);
    Mockito.verify(mockPrepStmt, times(1)).setInt(4, 30);
    Mockito.verify(mockPrepStmt, times(1)).setInt(5, 10);
    Mockito.verify(mockPrepStmt, times(1)).setInt(6, 20);
    Mockito.verify(mockPrepStmt, times(1)).setString(7, "ec");
    Mockito.verify(mockPrepStmt, times(1)).setInt(8, 45);
    Mockito.verify(mockPrepStmt, times(1)).setInt(9, 70);
    Mockito.verify(mockPrepStmt, times(1)).setInt(10, 80);
    Mockito.verify(mockPrepStmt, times(1)).setBoolean(11, true);
    Mockito.verify(mockPrepStmt, times(1)).setString(12, "role1,role2");
    Mockito.verify(mockPrepStmt, times(1)).setString(13, "filter");
    Mockito.verify(mockPrepStmt, times(1)).setString(14, "expiry");
    Mockito.verify(mockPrepStmt, times(1)).setInt(15, 50);
    Mockito.verify(mockPrepStmt, times(1)).setInt(16, 4);
    jdbcConn.close();
}