View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.kpme.pm.classification;
17  
18  import java.math.BigDecimal;
19  import java.util.ArrayList;
20  import java.util.HashMap;
21  import java.util.List;
22  import java.util.Map;
23  
24  import org.joda.time.LocalDate;
25  import org.kuali.kpme.pm.api.classification.Classification;
26  import org.kuali.kpme.pm.api.classification.duty.ClassificationDuty;
27  import org.kuali.kpme.pm.api.classification.duty.ClassificationDutyContract;
28  import org.kuali.kpme.pm.api.classification.flag.ClassificationFlag;
29  import org.kuali.kpme.pm.api.classification.qual.ClassificationQualification;
30  
31  public class ClassificationDataBoTest {
32  	private static Map<String, ClassificationQualification> testClassificationQualificationBos;
33  	public static ClassificationQualification.Builder classificationQualificationBoBuilder = ClassificationQualification.Builder
34  			.create();
35  	
36  	private static Map<String, ClassificationFlag> testClassificationFlagBos;
37  	public static ClassificationFlag.Builder classificationFlagBuilder = ClassificationFlag.Builder.create();
38  	
39  	private static Map<String, ClassificationDuty> testClassificationDutyBos;
40  	public static ClassificationDuty.Builder classificationDutyBuilder = ClassificationDuty.Builder.create();
41  	
42  	private static Map<String, Classification> testClassificationBos;
43  	public static Classification.Builder classificationBuilder = Classification.Builder.create();
44  	
45  	static LocalDate currentTime = new LocalDate();
46  
47  	
48  	static{
49  		testClassificationBos = new HashMap<String, Classification>();
50  		
51  		classificationBuilder.setObjectId("0804716a-cbb7-11e3-9cd3-51a754ad6a0a");
52  		classificationBuilder.setVersionNumber(1l);
53  		
54  		classificationBuilder.setPmPositionClassId("TST-PMCLASSID");
55  		classificationBuilder.setId(classificationBuilder.getPmPositionClassId());
56  		classificationBuilder.setPoolEligible("");
57  		classificationBuilder.setPositionType("");
58  		classificationBuilder.setPositionReportGroup("");
59  		classificationBuilder.setLeaveEligible("");
60  		classificationBuilder.setBenefitsEligible("");
61  		classificationBuilder.setClassificationTitle("");
62  		classificationBuilder.setPositionClass("");
63  		classificationBuilder.setPercentTime(new BigDecimal(100.0));
64  		classificationBuilder.setSalaryGroup("");
65  		classificationBuilder.setTenureEligible("");
66  		classificationBuilder.setExternalReference("");
67  		
68  		classificationBuilder.setLeavePlan("");
69  		classificationBuilder.setPayGrade("");
70  		classificationBuilder.setActive(true);
71  		classificationBuilder.setEffectiveLocalDate(currentTime);
72  		
73  		testClassificationBos.put(classificationBuilder.getPmPositionClassId(), classificationBuilder.build());
74  		
75  		testClassificationQualificationBos = new HashMap<String, ClassificationQualification>();
76  		
77  		classificationQualificationBoBuilder.setQualificationValue("QLFCTN-VALUE");
78          classificationQualificationBoBuilder.setQualificationType("");
79          classificationQualificationBoBuilder.setDisplayOrder("DISPLAYORDER");
80          classificationQualificationBoBuilder.setTypeValue("");
81          classificationQualificationBoBuilder.setQualifier("QUALIFIER");
82          classificationQualificationBoBuilder.setPmClassificationQualificationId("TST-CLASSFCTNQLFCTN");
83          classificationQualificationBoBuilder.setPmPositionClassId("TST-PMCLASSID");
84          classificationQualificationBoBuilder.setEffectiveLocalDateOfOwner(currentTime);
85  //        classificationQualificationBoBuilder.setOwner(Classification.Builder.create(getClassification("TST-PMCLASSID")));
86          classificationQualificationBoBuilder.setVersionNumber(1L);
87          classificationQualificationBoBuilder.setObjectId("0804716a-cbb7-11e3-9cd3-51a754ad6a0a");
88  		
89  		testClassificationQualificationBos.put(classificationQualificationBoBuilder.getPmClassificationQualificationId(), classificationQualificationBoBuilder.build());
90  		
91  		testClassificationFlagBos = new HashMap<String, ClassificationFlag>();
92  		
93  		classificationFlagBuilder.setObjectId("0804716a-cbb7-11e3-9cd3-51a754ad6a0a");
94  		classificationFlagBuilder.setVersionNumber(1l);
95  		List<String> names = new ArrayList<String>();
96  		names.add("Name1");
97  		classificationFlagBuilder.setNames(names);
98  		classificationFlagBuilder.setCategory("CAT");
99  		classificationFlagBuilder.setPmFlagId("TST-CLSFCTNFLAG");
100 		classificationFlagBuilder.setPmPositionClassId("TST-PMCLASSID");
101 //		classificationFlagBuilder.setOwner(Classification.Builder.create(getClassification("TST-PMCLASSID")));
102 		classificationFlagBuilder.setEffectiveLocalDateOfOwner(currentTime);
103 		testClassificationFlagBos.put(classificationFlagBuilder.getPmFlagId(), classificationFlagBuilder.build());
104 		
105 	
106 		testClassificationDutyBos = new HashMap<String, ClassificationDuty>();
107 		
108 		classificationDutyBuilder.setObjectId("0804716a-cbb7-11e3-9cd3-51a754ad6a0a");
109 		classificationDutyBuilder.setVersionNumber(1l);
110 		classificationDutyBuilder.setName("name");
111 		classificationDutyBuilder.setDescription("descr");
112 		classificationDutyBuilder.setPercentage(new BigDecimal(100.0));
113 		classificationDutyBuilder.setPmDutyId("TST-CLSFCTNDUTY");
114 		classificationDutyBuilder.setPmPositionClassId("TST-PMCLASSID");
115 //		classificationDutyBuilder.setOwner(Classification.Builder.create(getClassification("TST-PMCLASSID")));
116 		classificationDutyBuilder.setEffectiveLocalDateOfOwner(currentTime);
117 		testClassificationDutyBos.put(classificationDutyBuilder.getPmDutyId(), classificationDutyBuilder.build());
118 	}
119 	
120 	public static Classification getClassification(String classification) {
121         return testClassificationBos.get(classification);
122     }
123 	
124     public static ClassificationQualification getClassificationQualificationBo(String classificationQualification) {
125         return testClassificationQualificationBos.get(classificationQualification);
126     }
127     
128     public static ClassificationFlag getClassificationFlag(String classificationFlag) {
129         return testClassificationFlagBos.get(classificationFlag);
130     }
131 
132 	public static ClassificationDutyContract getClassificationDuty(String classificationDuty) {
133 		return testClassificationDutyBos.get(classificationDuty);
134 	}
135 
136 }