コード例 #1
0
 @Test
 @Transactional
 public void testFindCampaignRequest() throws Exception {
   CampaignRequest result = campaignRequestDao.findCampaignRequest(1l);
   assertNotNull(result);
   logger.info("Main Query Completed");
   assertNotNull(result.getCampaign().getCampaignId());
 }
コード例 #2
0
  /**
   * Test method for {@link
   * com.aric.repo.CampaignRequestDaoImpl#createCampaignRequest(com.aric.domain.Campaign,
   * java.lang.Long, java.util.Date)} .
   */
  @Test
  @Rollback(false)
  public void testCreateCampaignRequest() {

    CampaignRequest cr =
        campaignRequestDao.createCampaignRequest(new Campaign(1l, "DUMMY"), 1l, new Date());
    assertNotNull(cr);
    assertNotNull(cr.getCampaignRequestId());
  }
コード例 #3
0
  @Test
  public void testUpdateWithoutTrx() throws Exception {
    CampaignRequest result =
        campaignRequestDao.createCampaignRequest(new Campaign(1l, "DUMMY"), 1l, new Date());

    result.setStatus(CampaignRequestStatus.OPERATING);

    result = campaignRequestDao.findCampaignRequest(result.getCampaignRequestId());
    assertEquals(result.getStatus(), CampaignRequestStatus.WAITING);

    result.setStatus(CampaignRequestStatus.OPERATING);
    campaignRequestDao.update(result);

    result = campaignRequestDao.findCampaignRequest(result.getCampaignRequestId());
    assertEquals(CampaignRequestStatus.OPERATING, result.getStatus());
  }