1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.krms.termresolver;
17
18 import org.junit.Before;
19 import org.junit.Ignore;
20 import org.junit.Test;
21 import org.junit.runner.RunWith;
22 import org.kuali.rice.krms.impl.type.KrmsTypeResolver;
23 import org.kuali.student.common.util.krms.RulesExecutionConstants;
24 import org.kuali.student.enrollment.academicrecord.dto.StudentCourseRecordInfo;
25 import org.kuali.student.enrollment.academicrecord.service.AcademicRecordService;
26 import org.kuali.student.enrollment.courseregistration.dto.CourseRegistrationInfo;
27 import org.kuali.student.krms.util.KSKRMSExecutionConstants;
28 import org.kuali.student.r2.common.dto.ContextInfo;
29 import org.kuali.student.r2.common.dto.LocaleInfo;
30 import org.springframework.test.context.ContextConfiguration;
31 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
32
33 import javax.annotation.Resource;
34
35 import java.util.HashMap;
36 import java.util.List;
37 import java.util.Map;
38
39 import static org.junit.Assert.assertNotNull;
40 import static org.junit.Assert.assertNull;
41
42 @RunWith(SpringJUnit4ClassRunner.class)
43 @ContextConfiguration(locations = {"classpath:ks-krms-test-context.xml"})
44 @Ignore
45 public class TestScoreTermResolver {
46 private KrmsTypeResolver typeResolver;
47 private String studentID = "12020303";
48
49 public ContextInfo callContext = null;
50 @Resource(name = "acadRecordService")
51 private AcademicRecordService academicRecordService;
52
53 @Before
54 public void setUp() {
55 callContext = new ContextInfo();
56 }
57
58
59 @Test
60 public void testAcadRecordServiceNotNull() {
61 assertNotNull(academicRecordService);
62 }
63
64 @Test
65 public void testResolve() {
66 ScoreTermResolver termResolver = new ScoreTermResolver();
67 termResolver.setAcademicRecordService(academicRecordService);
68 Map<String, Object> resolvedPrereqs = new HashMap<String, Object>();
69 Map<String, String> parameters = new HashMap<String, String>();
70
71 ContextInfo context = new ContextInfo();
72 context.setLocale(new LocaleInfo());
73 context.setPrincipalId("nina");
74
75 resolvedPrereqs.put(RulesExecutionConstants.CONTEXT_INFO_TERM_NAME, context);
76 parameters.put(KSKRMSExecutionConstants.PERSON_ID_TERM_PROPERTY, studentID);
77
78 List<StudentCourseRecordInfo> records = termResolver.resolve(resolvedPrereqs,parameters);
79
80
81 assertNull(records);
82
83 }
84
85
86
87 }