List of usage examples for org.apache.solr.client.solrj.response SolrPingResponse SolrPingResponse
SolrPingResponse
From source file:at.pagu.soldockr.core.SolrTemplateTest.java
License:Apache License
@Test public void testExecutePing() throws SolrServerException, IOException { Mockito.when(solrServerMock.ping()).thenReturn(new SolrPingResponse()); SolrPingResponse pingResult = solrTemplate.executePing(); Assert.assertNotNull(pingResult);//from w w w . ja v a2 s. c o m Mockito.verify(solrServerMock, Mockito.times(1)).ping(); }
From source file:com.cloudera.cdk.morphline.solr.CollectingDocumentLoader.java
License:Apache License
@Override public SolrPingResponse ping() { LOGGER.trace("ping"); return new SolrPingResponse(); }
From source file:org.dataone.cn.solr.client.solrj.MockSolrServer.java
License:Apache License
@Override public SolrPingResponse ping() throws SolrServerException, IOException { SolrPingResponse pingResponse = new SolrPingResponse(); return pingResponse; }
From source file:org.springframework.boot.actuate.health.SolrHealthIndicatorTests.java
License:Apache License
@Test public void solrIsUp() throws Exception { SolrServer solrServer = mock(SolrServer.class); SolrPingResponse pingResponse = new SolrPingResponse(); NamedList<Object> response = new NamedList<Object>(); response.add("status", "OK"); pingResponse.setResponse(response);/* w ww . j a v a 2 s. co m*/ given(solrServer.ping()).willReturn(pingResponse); SolrHealthIndicator healthIndicator = new SolrHealthIndicator(solrServer); Health health = healthIndicator.health(); assertEquals(Status.UP, health.getStatus()); assertEquals("OK", health.getDetails().get("solrStatus")); }
From source file:org.springframework.data.solr.core.SolrTemplateMulticoreTests.java
License:Apache License
@Test public void testPingSpecificCores() throws SolrServerException, IOException { Mockito.when(core1Client.ping()).thenReturn(new SolrPingResponse()); Mockito.when(core2Client.ping()).thenReturn(new SolrPingResponse()); SolrPingResponse pingResult1 = solrTemplate.ping("core1"); SolrPingResponse pingResult2 = solrTemplate.ping("core2"); assertNotNull(pingResult1);/*from www. j a v a 2 s. co m*/ assertNotNull(pingResult2); Mockito.verify(core1Client, Mockito.times(1)).ping(); Mockito.verify(core2Client, Mockito.times(1)).ping(); }
From source file:org.springframework.data.solr.core.SolrTemplateTest.java
License:Apache License
@Test public void testPing() throws SolrServerException, IOException { Mockito.when(solrServerMock.ping()).thenReturn(new SolrPingResponse()); SolrPingResponse pingResult = solrTemplate.ping(); Assert.assertNotNull(pingResult);//from w ww . j ava2s . c om Mockito.verify(solrServerMock, Mockito.times(1)).ping(); }