mtien-apache commented on a change in pull request #4767:
URL: https://github.com/apache/nifi/pull/4767#discussion_r564863874



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenHTTP.java
##########
@@ -105,22 +101,45 @@
     private int availablePort;
 
     @BeforeClass
-    public static void setUpSuite() {
+    public static void setUpSuite() throws IOException, 
GeneralSecurityException {
         Assume.assumeTrue("Test only runs on *nix", 
!SystemUtils.IS_OS_WINDOWS);
+
+        clientTlsConfiguration = 
KeyStoreUtils.createTlsConfigAndNewKeystoreTruststore();
+
+        trustOnlyTlsConfiguration = new StandardTlsConfiguration(
+                null, null, null, null,
+                clientTlsConfiguration.getTruststorePath(), 
clientTlsConfiguration.getTruststorePassword(),
+                clientTlsConfiguration.getTruststoreType(), 
TlsConfiguration.getHighestCurrentSupportedTlsProtocolVersion());
+    }
+
+    @AfterClass
+    public static void afterClass() throws Exception {
+        if (clientTlsConfiguration != null) {
+            try {
+                if 
(StringUtils.isNotBlank(clientTlsConfiguration.getKeystorePath())) {
+                    
java.nio.file.Files.deleteIfExists(Paths.get(clientTlsConfiguration.getKeystorePath()));
+                }
+            } catch (IOException e) {
+                throw new IOException("There was an error deleting a keystore: 
" + e.getMessage());

Review comment:
       @exceptionfactory I also added the `IOException e` to the other delete 
methods.




----------------------------------------------------------------
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:
[email protected]


Reply via email to