@Test
public void testGetX509CertRecord() throws Exception {

    Date now = new Date();
    Timestamp tstamp = new Timestamp(now.getTime());
    Mockito.when(mockResultSet.next()).thenReturn(true);
    mockNonNullableColumns(now);
    Mockito.doReturn(tstamp).when(mockResultSet).getTimestamp(JDBCCertRecordStoreConnection.DB_COLUMN_LAST_NOTIFIED_TIME);
    Mockito.doReturn("last-notified-server").when(mockResultSet).getString(JDBCCertRecordStoreConnection.DB_COLUMN_LAST_NOTIFIED_SERVER);
    Mockito.doReturn(tstamp).when(mockResultSet).getTimestamp(JDBCCertRecordStoreConnection.DB_COLUMN_EXPIRY_TIME);
    Mockito.doReturn("hostname").when(mockResultSet).getString(JDBCCertRecordStoreConnection.DB_COLUMN_HOSTNAME);
    JDBCCertRecordStoreConnection jdbcConn = new JDBCCertRecordStoreConnection(mockConn);
    X509CertRecord certRecord = jdbcConn.getX509CertRecord("ostk", "instance-id", "cn");
    assertNonNullableColumns(now, certRecord);
    assertEquals(certRecord.getLastNotifiedTime(), now);
    assertEquals(certRecord.getLastNotifiedServer(), "last-notified-server");
    assertEquals(certRecord.getExpiryTime(), now);
    assertEquals(certRecord.getHostName(), "hostname");
    jdbcConn.close();
}