1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.pm.classification.qual;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.joda.time.LocalDate;
22 import org.junit.Assert;
23 import org.junit.Test;
24 import org.kuali.kpme.pm.api.classification.Classification;
25 import org.kuali.kpme.pm.api.classification.qual.ClassificationQualification;
26 import org.kuali.kpme.pm.classification.ClassificationBo;
27 import org.kuali.kpme.pm.classification.ClassificationBoTest;
28 import org.kuali.kpme.pm.position.PositionBo;
29
30
31 public class ClassificationQualificationBoTest {
32 private static Map<String, ClassificationQualification> testClassificationQualificationBos;
33 public static ClassificationQualification.Builder classificationQualificationBoBuilder = ClassificationQualification.Builder
34 .create();
35
36 static LocalDate currentTime = new LocalDate();
37
38 static{
39
40 testClassificationQualificationBos = new HashMap<String, ClassificationQualification>();
41
42 classificationQualificationBoBuilder.setQualificationValue("QLFCTN-VALUE");
43 classificationQualificationBoBuilder.setQualificationType("");
44 classificationQualificationBoBuilder.setDisplayOrder("DISPLAYORDER");
45 classificationQualificationBoBuilder.setTypeValue("");
46 classificationQualificationBoBuilder.setQualifier("QUALIFIER");
47 classificationQualificationBoBuilder.setPmClassificationQualificationId("TST-CLASSFCTNQLFCTN");
48 classificationQualificationBoBuilder.setPmPositionClassId("TST-PMCLASSID");
49 classificationQualificationBoBuilder.setEffectiveLocalDateOfOwner(currentTime);
50
51 classificationQualificationBoBuilder.setVersionNumber(1L);
52 classificationQualificationBoBuilder.setObjectId("0804716a-cbb7-11e3-9cd3-51a754ad6a0a");
53
54 testClassificationQualificationBos.put(classificationQualificationBoBuilder.getPmClassificationQualificationId(), classificationQualificationBoBuilder.build());
55
56 }
57
58
59 @Test
60 public void testNotEqualsWithGroup() {
61 ClassificationQualification immutable = ClassificationQualificationBoTest.getClassificationQualificationBo("TST-CLASSFCTNQLFCTN");
62 ClassificationQualificationBo bo = ClassificationQualificationBo.from(immutable);
63
64 ClassificationBo classificationBo = new ClassificationBo();
65 classificationBo.setEffectiveLocalDate(currentTime);
66 bo.setOwner(classificationBo);
67
68 System.out.println("Bo ... "+bo.getEffectiveDateOfOwner());
69 Assert.assertFalse(bo.equals(immutable));
70 Assert.assertFalse(immutable.equals(bo));
71 System.out.println("Immutable ,.. "+immutable.getEffectiveLocalDateOfOwner());
72 Assert.assertEquals(immutable, ClassificationQualificationBo.to(bo));
73 }
74
75 public static ClassificationQualification getClassificationQualificationBo(String classificationQualification) {
76 return testClassificationQualificationBos.get(classificationQualification);
77 }
78
79 }