noblepaul commented on a change in pull request #1327: SOLR-13942: /api/cluster/zk/* to fetch raw ZK data URL: https://github.com/apache/lucene-solr/pull/1327#discussion_r395421010
########## File path: solr/core/src/test/org/apache/solr/handler/admin/ZookeeperStatusHandlerTest.java ########## @@ -74,6 +78,39 @@ public void tearDown() throws Exception { super.tearDown(); } + @Test + public void testZkread() throws Exception { + URL baseUrl = cluster.getJettySolrRunner(0).getBaseUrl(); + String basezk = baseUrl.toString().replace("/solr", "/api") + "/cluster/zk"; + + try( HttpSolrClient client = new HttpSolrClient.Builder(baseUrl.toString()).build()) { + Object o = Utils.executeGET(client.getHttpClient(), + basezk + "/security.json", + Utils.JSONCONSUMER ); + assertNotNull(o); + o = Utils.executeGET(client.getHttpClient(), + basezk + "/configs", + Utils.JSONCONSUMER ); + assertEquals("0", String.valueOf(getObjectByPath(o,true, split(":/configs:_default:dataLength",':')))); + assertEquals("0", String.valueOf(getObjectByPath(o,true, split(":/configs:conf:dataLength",':')))); + byte[] bytes = new byte[1024*5]; + for (int i = 0; i < bytes.length; i++) { + bytes[i] = (byte) random().nextInt(128); Review comment: this was the easiest way to create a `byte[]` . could use anything else. But this code was simpler ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org