1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.pm.positionflag;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.joda.time.DateTime;
22 import org.joda.time.LocalDate;
23 import org.junit.Assert;
24 import org.junit.Test;
25 import org.kuali.kpme.pm.api.positionflag.PositionFlag;
26
27 public class PositionFlagBoTest {
28
29 private static Map<String, PositionFlag> testPositionFlagBos;
30 public static PositionFlag.Builder positionFlagBuilder = PositionFlag.Builder.create();
31
32 static{
33
34 testPositionFlagBos = new HashMap<String, PositionFlag>();
35
36 positionFlagBuilder.setActive(true);
37 positionFlagBuilder.setCategory("Primary Test");
38 positionFlagBuilder.setCreateTime(DateTime.now());
39 positionFlagBuilder.setEffectiveLocalDate(new LocalDate(2012, 3, 1));
40 positionFlagBuilder.setPmPositionFlagId("KPME_TEST_0001");
41 positionFlagBuilder.setId(positionFlagBuilder.getPmPositionFlagId());
42 positionFlagBuilder.setObjectId("0804716a-cbb7-11e3-9cd3-51a754ad6a0a");
43 positionFlagBuilder.setPositionFlagName("TST-PSTNFLG");
44 positionFlagBuilder.setUserPrincipalId("admin");
45 positionFlagBuilder.setVersionNumber(1l);
46
47 testPositionFlagBos.put(positionFlagBuilder.getPositionFlagName(), positionFlagBuilder.build());
48 }
49
50
51 @Test
52 public void testNotEqualsWithGroup() {
53 PositionFlag immutable = PositionFlagBoTest.getPositionFlag("TST-PSTNFLG");
54 PositionFlagBo bo = PositionFlagBo.from(immutable);
55 Assert.assertFalse(bo.equals(immutable));
56 Assert.assertFalse(immutable.equals(bo));
57 Assert.assertEquals(immutable, PositionFlagBo.to(bo));
58 }
59
60 public static PositionFlag getPositionFlag(String PositionFlag) {
61 return testPositionFlagBos.get(PositionFlag);
62 }
63
64 }