1 package org.kuali.ole;
2
3
4 import org.junit.Test;
5 import org.kuali.ole.service.OleValidateInputRequestService;
6 import org.kuali.ole.serviceimpl.OleValidateInputRequestServiceImpl;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9 import java.util.HashMap;
10 import java.util.Map;
11
12 import static junit.framework.Assert.assertNotNull;
13
14
15
16
17
18
19
20 public class OleValidateInputRequestService_UT extends BaseTestCase{
21
22 private static Logger LOG = LoggerFactory.getLogger(OleValidateInputRequestService_UT.class);
23 private OleValidateInputRequestService oleValidateInputRequestService=new OleValidateInputRequestServiceImpl();
24
25 @Test
26 public void testInputRequestValidation() throws Exception{
27
28 String searchRetireveOperationFlag=oleValidateInputRequestService.inputRequestValidation(getReqParameters());
29 String explainOperationFlag=oleValidateInputRequestService.inputRequestValidation(getReqParameters());
30 assertNotNull(searchRetireveOperationFlag);
31 assertNotNull(explainOperationFlag);
32 }
33
34 public Map getReqParameters() {
35
36 HashMap reqParamMap=new HashMap();
37 reqParamMap.put(OleSRUConstants.OperationType,OleSRUConstants.SEARCH_RETRIEVE);
38 reqParamMap.put(OleSRUConstants.VERSION,"1.1");
39 reqParamMap.put(OleSRUConstants.QUERY,"title=jon");
40 reqParamMap.put(OleSRUConstants.START_RECORD,"1");
41 reqParamMap.put(OleSRUConstants.MAXIMUM_RECORDS,"10");
42 reqParamMap.put(OleSRUConstants.RECORD_PACKING,"xml");
43 reqParamMap.put(OleSRUConstants.RECORD_SCHEMA,"recordSchema");
44
45 return reqParamMap;
46
47 }
48
49
50 }