public void testNamespaceWithBug() throws InterruptedException, ParseException {
String ns = "ns-indextest";
String indexName = "ns-index";
int docCount = 5;
NamespaceManager.set(ns);
SearchService searchService2 = SearchServiceFactory.getSearchService();
Index index = searchService2.getIndex(IndexSpec.newBuilder()
.setName(indexName)
.build());
delDocs(index);
addDocs(index, docCount);
GetIndexesRequest request = GetIndexesRequest.newBuilder()
.setIndexNamePrefix(indexName)
.setOffset(0)
.setNamespace(ns)
.setLimit(10)
.build();
assertEquals(ns, request.getNamespace());
GetResponse<Index> response = searchService2.getIndexes(request);
List<Index> listIndexes = response.getResults();
for (Index oneIndex : listIndexes) {
assertEquals(ns, listIndexes.get(0).getNamespace());
assertEquals(indexName, listIndexes.get(0).getName());
verifyDocCount(oneIndex, docCount);
}
assertEquals(ns, searchService2.getNamespace());
NamespaceManager.set("");
}