@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);
 }
  @Before
  public void setUp() throws Exception {
    userNodeCertificateDao = new MyBatisUserNodeCertificateDao();
    userNodeCertificateDao.setSqlSessionFactory(getSqlSessionFactory());
    solarNodeDao = new MyBatisSolarNodeDao();
    solarNodeDao.setSqlSessionFactory(getSqlSessionFactory());

    setupTestNode();
    this.node = solarNodeDao.get(TEST_NODE_ID);
    assertNotNull(this.node);
    deleteFromTables(DELETE_TABLES);
    this.user = createNewUser(TEST_EMAIL);
    assertNotNull(this.user);
    userNodeCert = null;
  }
 @Test
 public void getByPrimaryKey() {
   storeNew();
   UserNodeCertificate cert = userNodeCertificateDao.get(userNodeCert.getId());
   validate(this.userNodeCert, cert);
 }