HealthCheckService { public boolean isSolrUp(List<String> solrCollections, String... solrCollectionsWithAliases) { try { return solrCloudAdminProxy.areCollectionsUp(solrCollections, solrCollectionsWithAliases); } catch (Exception e) { LOGGER.error(e.getMessage()); return false; } } HealthCheckService(SolrCloudAdminProxy solrCloudAdminProxy); boolean isSolrUp(List<String> solrCollections, String... solrCollectionsWithAliases); boolean isDatabaseUp(ExperimentDao experimentDao);  }
@Test void solrCollectionsAreUp() throws IOException, SolrServerException { when(solrCloudAdminProxyMock.areCollectionsUp(anyList(), any())).thenReturn(true); assertThat(subject.isSolrUp(MOCK_SOLR_COLLECTIONS, MOCK_SOLR_COLLECTION_ALIAS)).isTrue(); }
@Test void solrCollectionsAreDown() throws IOException, SolrServerException { when(solrCloudAdminProxyMock.areCollectionsUp(anyList(), any())).thenReturn(false); assertThat(subject.isSolrUp(MOCK_SOLR_COLLECTIONS, MOCK_SOLR_COLLECTION_ALIAS)).isFalse(); }
@Test void solrThrowsException() throws IOException, SolrServerException { when(solrCloudAdminProxyMock.areCollectionsUp(anyList(), any())).thenThrow(RuntimeException.class); assertThat(subject.isSolrUp(MOCK_SOLR_COLLECTIONS, MOCK_SOLR_COLLECTION_ALIAS)).isFalse(); }