View Javadoc
1   package org.kuali.ole;
2   
3   import org.junit.Before;
4   import org.junit.Test;
5   import org.kuali.ole.bo.diagnostics.OleSRUDiagnostics;
6   import org.kuali.ole.service.OleDiagnosticsService;
7   import org.kuali.ole.serviceimpl.OleDiagnosticsServiceImpl;
8   import org.kuali.ole.serviceimpl.OleSearchRetrieveOperationServiceImpl;
9   import org.kuali.rice.core.api.config.property.Config;
10  import org.mockito.Mock;
11  import org.mockito.Mockito;
12  import org.mockito.MockitoAnnotations;
13  import org.slf4j.Logger;
14  import org.slf4j.LoggerFactory;
15  
16  import static junit.framework.Assert.assertNotNull;
17  
18  /**
19   * Created with IntelliJ IDEA.
20   * User: ?
21   * Date: 7/19/12
22   * Time: 4:34 PM
23   * To change this template use File | Settings | File Templates.
24   */
25  public class OleDiagnosticsService_UT extends BaseTestCase{
26  
27      private static Logger LOG = LoggerFactory.getLogger(OleDiagnosticsService_UT.class);
28  
29      @Mock
30      private Config mockConfig;
31  
32      @Before
33      public void setUp() throws Exception {
34          MockitoAnnotations.initMocks(this);
35          Mockito.when(mockConfig.getProperty(OleSRUConstants.INVALID_OPERATION_TYPE)).thenReturn("");
36          ((OleDiagnosticsServiceImpl) oleDiagnosticsService).setCurrentContextConfig(mockConfig);
37  
38      }
39  
40      private OleDiagnosticsService oleDiagnosticsService=new OleDiagnosticsServiceImpl();
41  
42      @Test
43      public void testCQLQueryParser() throws Exception{
44  
45          OleSRUDiagnostics diagnosticXMl=null;
46          diagnosticXMl=oleDiagnosticsService.getDiagnosticResponse("Unsupported Request");
47          assertNotNull(diagnosticXMl);
48      }
49  
50  }