@Test
 public void storeNew() {
   UserNodeCertificate newUserNodeCert = new UserNodeCertificate();
   newUserNodeCert.setCreated(new DateTime());
   newUserNodeCert.setNodeId(this.node.getId());
   newUserNodeCert.setUserId(this.user.getId());
   newUserNodeCert.setRequestId(TEST_REQ_KEY);
   newUserNodeCert.setKeystoreData(TEST_CERT);
   newUserNodeCert.setStatus(UserNodeCertificateStatus.v);
   UserNodePK id = userNodeCertificateDao.store(newUserNodeCert);
   assertNotNull(id);
   this.userNodeCert = userNodeCertificateDao.get(id);
 }
 private void validate(UserNodeCertificate cert, UserNodeCertificate entity) {
   assertNotNull("UserNodeCertificate should exist", entity);
   assertNotNull("Created date should be set", entity.getCreated());
   assertEquals(cert.getId(), entity.getId());
   assertArrayEquals(cert.getKeystoreData(), entity.getKeystoreData());
   assertEquals(cert.getStatus(), entity.getStatus());
   assertEquals(cert.getNode(), entity.getNode());
   assertEquals(cert.getUser(), entity.getUser());
 }
 @Test
 public void getByPrimaryKey() {
   storeNew();
   UserNodeCertificate cert = userNodeCertificateDao.get(userNodeCert.getId());
   validate(this.userNodeCert, cert);
 }