@Test
public void testInsertPublicKeyEntry() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    PublicKeyEntry publicKey = new PublicKeyEntry().setId("zms1").setKey("Value1");
    Mockito.when(mockResultSet.getInt(1))
        .thenReturn(5) // domain id
        .thenReturn(7); // service id
    Mockito.when(mockResultSet.next())
        .thenReturn(true) // this one is for domain id
        .thenReturn(true); // this one is for service id
    
    Mockito.doReturn(1).when(mockPrepStmt).executeUpdate();
    boolean requestSuccess = jdbcConn.insertPublicKeyEntry("my-domain", "service1", publicKey);
    assertTrue(requestSuccess);
    // getting domain and service ids
    
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "my-domain");
    Mockito.verify(mockPrepStmt, times(1)).setInt(1, 5);
    Mockito.verify(mockPrepStmt, times(1)).setString(2, "service1");
    
    // public key entry statement
    
    Mockito.verify(mockPrepStmt, times(1)).setInt(1, 7);
    Mockito.verify(mockPrepStmt, times(1)).setString(2, "zms1");
    Mockito.verify(mockPrepStmt, times(1)).setString(3, "Value1");
    jdbcConn.close();
}