1 package org.kuali.ole;
2
3 import org.junit.Test;
4 import org.kuali.ole.service.OleExplainOperationService;
5 import org.kuali.ole.serviceimpl.OleExplainOperationServiceImpl;
6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory;
8
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
21 public class OleExplainOperationService_UT extends BaseTestCase{
22
23 private static Logger LOG = LoggerFactory.getLogger(OleExplainOperationService_UT.class);
24 private OleExplainOperationService oleExplainOperationServiceService = new OleExplainOperationServiceImpl();
25
26 @Test
27 public void testExplainResponse() throws Exception{
28
29 String explainXML = null;
30 explainXML = oleExplainOperationServiceService.getExplainResponse(getReqParameters());
31 assertNotNull(explainXML);
32 }
33 public Map getReqParameters() {
34
35 HashMap reqParamMap=new HashMap();
36 reqParamMap.put(OleSRUConstants.OPERATION_TYPE,OleSRUConstants.SEARCH_RETRIEVE);
37 reqParamMap.put(OleSRUConstants.VERSION,"1.1");
38 reqParamMap.put(OleSRUConstants.QUERY,"title=HTC");
39 reqParamMap.put(OleSRUConstants.START_RECORD,"1");
40 reqParamMap.put(OleSRUConstants.MAXIMUM_RECORDS,"10");
41 reqParamMap.put(OleSRUConstants.RECORD_PACKING,"xml");
42
43 return reqParamMap;
44
45 }
46 }