You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by pv...@apache.org on 2023/01/25 10:07:23 UTC
[nifi] branch main updated: NIFI-11064 Removed unstable TestPutSFTP.testRunTransitUriDifferentHosts
This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new f32a60af33 NIFI-11064 Removed unstable TestPutSFTP.testRunTransitUriDifferentHosts
f32a60af33 is described below
commit f32a60af33e2002e3a1584dd1076bbd6b86572b7
Author: exceptionfactory <ex...@apache.org>
AuthorDate: Tue Jan 24 16:58:06 2023 -0600
NIFI-11064 Removed unstable TestPutSFTP.testRunTransitUriDifferentHosts
Signed-off-by: Pierre Villard <pi...@gmail.com>
This closes #6885.
---
.../nifi/processors/standard/TestPutSFTP.java | 42 ----------------------
1 file changed, 42 deletions(-)
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSFTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSFTP.java
index 32ce4d7ca3..13564cfc73 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSFTP.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSFTP.java
@@ -33,10 +33,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
-import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map;
-import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -46,14 +43,10 @@ class TestPutSFTP {
private static final String LOCALHOST = "localhost";
- private static final String LOCALHOST_ADDRESS = "127.0.0.1";
-
private static final String REMOTE_DIRECTORY = "nifi_test/";
private static final String FIRST_FILENAME = "1.txt";
- private static final String TRANSFER_HOST_ATTRIBUTE = "transfer-host";
-
private static final int BATCH_SIZE = 2;
private static final byte[] ZERO_BYTES = new byte[]{};
@@ -207,41 +200,6 @@ class TestPutSFTP {
assertTrue(record.getTransitUri().startsWith(firstTransitUri), "Transit URI not found");
}
- @Test
- void testRunTransitUriDifferentHosts() {
- runner.setProperty(SFTPTransfer.REJECT_ZERO_BYTE, Boolean.FALSE.toString());
- runner.setProperty(SFTPTransfer.HOSTNAME, "${transfer-host}");
-
- final Map<String, String> firstAttributes = new LinkedHashMap<>();
- firstAttributes.put(CoreAttributes.FILENAME.key(), FIRST_FILENAME);
- firstAttributes.put(TRANSFER_HOST_ATTRIBUTE, LOCALHOST);
- runner.enqueue(FLOW_FILE_CONTENTS, firstAttributes);
-
- final Map<String, String> secondAttributes = new LinkedHashMap<>();
- secondAttributes.put(CoreAttributes.FILENAME.key(), FIRST_FILENAME);
- secondAttributes.put(TRANSFER_HOST_ATTRIBUTE, LOCALHOST_ADDRESS);
- runner.enqueue(FLOW_FILE_CONTENTS, secondAttributes);
-
- final int flowFilesQueued = runner.getQueueSize().getObjectCount();
- runner.run(flowFilesQueued);
-
- runner.assertTransferCount(PutSFTP.REL_SUCCESS, flowFilesQueued);
-
- final List<ProvenanceEventRecord> records = runner.getProvenanceEvents();
-
- final String firstTransitUri = String.format(TRANSIT_URI_FORMAT, LOCALHOST);
- final Optional<ProvenanceEventRecord> firstRecord = records.stream()
- .filter(record -> record.getTransitUri().startsWith(firstTransitUri))
- .findFirst();
- assertTrue(firstRecord.isPresent(), "First Transit URI not found");
-
- final String secondTransitUri = String.format(TRANSIT_URI_FORMAT, LOCALHOST_ADDRESS);
- final Optional<ProvenanceEventRecord> secondRecord = records.stream()
- .filter(record -> record.getTransitUri().startsWith(secondTransitUri))
- .findFirst();
- assertTrue(secondRecord.isPresent(), "Second Transit URI not found");
- }
-
private void createRemoteFile() throws IOException {
final Path directory = Paths.get(sshTestServer.getVirtualFileSystemPath() + REMOTE_DIRECTORY);
final Path subDirectory = Paths.get(directory.toString(), FIRST_FILENAME);