View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   package org.kuali.student.common.test.util;
6   
7   import static org.junit.Assert.*;
8   import org.kuali.student.r2.common.dto.MetaInfo;
9   
10  /**
11   * Helps create a dynamic 
12   * @author nwright
13   */
14  public class MetaTester {
15  
16      public void checkAfterCreate(MetaInfo actual) {
17          assertNotNull(actual);
18          assertNotNull(actual.getCreateId());
19          assertNotNull(actual.getCreateTime());
20          assertNotNull(actual.getVersionInd());
21      }
22  
23      public void checkAfterUpdate(MetaInfo expected, MetaInfo actual) {
24          assertNotNull(actual);
25          assertEquals(expected.getCreateId(), actual.getCreateId());
26          new TimeTester ().check (expected.getCreateTime(), actual.getCreateTime());
27          assertNotNull(actual.getUpdateId());
28          assertNotNull(actual.getUpdateTime());
29          assertNotSame(expected.getVersionInd(), actual.getVersionInd());
30      }
31  
32      public void checkAfterGet(MetaInfo expected, MetaInfo actual) {
33          assertNotNull(actual);
34          assertEquals(expected.getCreateId(), actual.getCreateId());
35          new TimeTester ().check(expected.getCreateTime(), actual.getCreateTime());
36          assertEquals(expected.getUpdateId(), actual.getUpdateId());
37          new TimeTester ().check(expected.getUpdateTime(), actual.getUpdateTime());
38          assertEquals (expected.getVersionInd(), actual.getVersionInd());
39      }
40  }