@Test
public void testListCollections() throws Exception {

  // GIVEN
  NamedList<Object> namedList = new NamedList<>();
  namedList.add("collections", Arrays.asList("collection1", "collection2"));
  expect(mockedSolrClient.request(anyObject(CollectionAdminRequest.class), anyString())).andReturn(namedList);
  replay(mockedSolrClient);
  // WHEN
  List<String> result = underTest.listCollections();
  // THEN
  assertTrue(result.contains("collection1"));
  assertTrue(result.contains("collection2"));
  assertEquals(2, result.size());
}