tpalfy commented on a change in pull request #3647: NIFI-6530 - HTTP SiteToSite server returns 201 in case no data is ava… URL: https://github.com/apache/nifi/pull/3647#discussion_r314729035
########## File path: nifi-commons/nifi-site-to-site-client/src/test/java/org/apache/nifi/remote/client/http/TestHttpClient.java ########## @@ -1224,6 +1249,24 @@ public void testReceiveUnknownPort() throws Exception { } } + @Test + public void testReceiveEmptyPort() throws Exception { + + try ( + SiteToSiteClient client = getDefaultBuilder() + .portName("empty-output-running") + .build() + ) { + try { + client.createTransaction(TransferDirection.RECEIVE); + fail(); + } catch (NoContentException e) { + logger.info("Exception message: {}", e.getMessage()); + assertTrue(e.getMessage().contains("Server has no flowfiles to provide")); Review comment: The real error message is `"No peers have flowfiles to provide"`. `assertTrue` checks are not too descriptive when there is a failure, a more user-friendly assert might be better, something like this: `assertThat(e.getMessage(), (org.hamcrest.CoreMatchers.)containsString("Server has no flowfiles to provide"))` ---------------------------------------------------------------- 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