You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mt...@apache.org on 2022/03/26 11:22:29 UTC
[nifi] branch main updated: NIFI-9773 Refactored nifi-system-tests using JUnit 5
This is an automated email from the ASF dual-hosted git repository.
mthomsen 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 105890e NIFI-9773 Refactored nifi-system-tests using JUnit 5
105890e is described below
commit 105890ef37ee12edfd082cadc74abf0513cf86a4
Author: exceptionfactory <ex...@apache.org>
AuthorDate: Thu Mar 24 21:10:39 2022 -0500
NIFI-9773 Refactored nifi-system-tests using JUnit 5
- Enabled system-tests workflow on push and pull requests
This closes #5901
Signed-off-by: Mike Thomsen <mt...@apache.org>
---
.github/workflows/system-tests.yml | 24 ++---
.../apache/nifi/stateless/StatelessSystemIT.java | 24 ++---
.../nifi/stateless/VersionedFlowBuilder.java | 6 +-
.../stateless/basics/AsyncCommitCallbackIT.java | 21 +++--
.../nifi/stateless/basics/BatchOutputIT.java | 6 +-
.../stateless/basics/CancelFlowExecutionIT.java | 6 +-
.../nifi/stateless/basics/CloneFlowFileIT.java | 12 ++-
.../nifi/stateless/basics/CreatesFlowFileIT.java | 6 +-
.../nifi/stateless/basics/InputOutputIT.java | 6 +-
.../apache/nifi/stateless/basics/LoopingIT.java | 6 +-
.../apache/nifi/stateless/basics/MergingIT.java | 6 +-
.../stateless/basics/PartitioningContentIT.java | 6 +-
.../stateless/basics/ProcessorLifecycleIT.java | 2 +-
.../basics/RequiresAdditionalInputIT.java | 13 ++-
.../stateless/basics/RollbackOnExceptionIT.java | 10 ++-
.../apache/nifi/stateless/basics/SplittingIT.java | 6 +-
.../nifi/stateless/basics/StateStorageIT.java | 10 +--
.../nifi/stateless/basics/StatelessRetryIT.java | 6 +-
.../classloader/InstanceClassLoaderIT.java | 4 +-
.../StatelessControllerServiceSystemIT.java | 6 +-
.../stateless/parameters/ParameterContextIT.java | 18 ++--
.../performance/StatelessPerformanceIT.java | 6 +-
.../apache/nifi/tests/system/NiFiClientUtil.java | 20 ++---
...ocessGroupIT.java => NiFiInstanceProvider.java} | 28 +++---
.../org/apache/nifi/tests/system/NiFiSystemIT.java | 100 +++++++--------------
.../SpawnedStandaloneNiFiInstanceFactory.java | 2 +-
.../tests/system/TroubleshootingTestWatcher.java | 68 ++++++++++++++
.../classloaders/ClassloaderIsolationKeyIT.java | 4 +-
.../system/clustering/FlowSynchronizationIT.java | 10 +--
.../clustering/JoinClusterAdjustStateIT.java | 6 +-
.../clustering/JoinClusterWithDifferentFlow.java | 8 +-
.../JoinClusterWithMissingConnectionNoData.java | 4 +-
.../JoinClusterWithMissingConnectionWithData.java | 4 +-
.../clustering/NodeRestartWithNewNodeIdIT.java | 10 +--
.../nifi/tests/system/clustering/OffloadIT.java | 4 +-
.../clustering/RestartWithDifferentPort.java | 8 +-
.../system/clustering/SimpleNodeRestartIT.java | 6 +-
.../ControllerServiceApiValidationIT.java | 4 +-
.../DependentControllerServiceIT.java | 2 +-
.../tests/system/loadbalance/LoadBalanceIT.java | 14 ++-
.../parameters/ClusteredParameterContextIT.java | 2 +-
.../system/parameters/ParameterContextIT.java | 16 ++--
.../tests/system/pg/BatchFlowBetweenGroupsIT.java | 2 +-
.../system/pg/SingleFlowFileConcurrencyIT.java | 8 +-
.../nifi/tests/system/processor/RetryIT.java | 4 +-
.../nifi/tests/system/processor/RunOnceIT.java | 8 +-
.../system/provenance/ProvenanceRepositoryIT.java | 4 +-
.../system/reportingtask/ReportingTaskIT.java | 2 +-
.../tests/system/repositories/ContentAccessIT.java | 4 +-
.../system/restart/FlowFileRestorationIT.java | 19 ++--
.../system/rpg/ClusteredRemoteProcessGroupIT.java | 2 +-
.../tests/system/rpg/RemoteProcessGroupIT.java | 7 +-
.../validation/DependentPropertyValidationIT.java | 6 +-
.../system/variables/ProcessGroupVariablesIT.java | 4 +-
...usteredVerifiableControllerServiceSystemIT.java | 6 +-
.../ClusteredVerifiableProcessorSystemIT.java | 6 +-
.../ClusteredVerifiableReportingTaskSystemIT.java | 6 +-
.../VerifiableControllerServiceSystemIT.java | 18 ++--
.../verification/VerifiableProcessorSystemIT.java | 16 ++--
.../VerifiableReportingTaskSystemIT.java | 8 +-
60 files changed, 333 insertions(+), 327 deletions(-)
diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml
index 4c45365..2cb2b5d 100644
--- a/.github/workflows/system-tests.yml
+++ b/.github/workflows/system-tests.yml
@@ -19,6 +19,12 @@ on:
# Run every day at 00:00
schedule:
- cron: "0 0 * * *"
+ push:
+ paths:
+ - 'nifi-system-tests/**'
+ pull_request:
+ paths:
+ - 'nifi-system-tests/**'
env:
DEFAULT_MAVEN_OPTS: >-
@@ -52,19 +58,12 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
- - name: Cache Maven Dependencies
- uses: actions/cache@v2
- with:
- path: |
- ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
+ cache: 'maven'
- name: Build Dependencies
env:
MAVEN_OPTS: >-
@@ -99,19 +98,12 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
- - name: Cache Maven Dependencies
- uses: actions/cache@v2
- with:
- path: |
- ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
- name: Set up Java 8
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8
+ cache: 'maven'
- name: Build Dependencies
env:
MAVEN_OPTS: >-
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/StatelessSystemIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/StatelessSystemIT.java
index f0df861..aa4e284 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/StatelessSystemIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/StatelessSystemIT.java
@@ -34,11 +34,9 @@ import org.apache.nifi.stateless.engine.StatelessEngineConfiguration;
import org.apache.nifi.stateless.flow.DataflowDefinition;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TransactionThresholds;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Timeout;
import java.io.File;
import java.io.FileInputStream;
@@ -53,6 +51,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+@Timeout(value = 5, unit = TimeUnit.MINUTES)
public class StatelessSystemIT {
private final List<StatelessDataflow> createdFlows = new ArrayList<>();
@@ -60,19 +59,12 @@ public class StatelessSystemIT {
// up finding a "compatible bundle" and using that, regardless of the specified version.
protected static final Bundle SYSTEM_TEST_EXTENSIONS_BUNDLE = new Bundle("org.apache.nifi", "nifi-system-test-extensions-nar", "1.13.0-SNAPSHOT");
- @Rule
- public TestName name = new TestName();
-
- @Rule
- public Timeout defaultTimeout = new Timeout(5, TimeUnit.MINUTES);
-
-
- @Before
+ @BeforeEach
public void clearFlows() {
createdFlows.clear();
}
- @After
+ @AfterEach
public void shutdownFlows() {
createdFlows.forEach(StatelessDataflow::shutdown);
}
@@ -236,8 +228,4 @@ public class StatelessSystemIT {
createdFlows.add(dataflow);
return dataflow;
}
-
- protected String getTestName() {
- return name.getMethodName();
- }
}
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/VersionedFlowBuilder.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/VersionedFlowBuilder.java
index 07381da..7f38166 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/VersionedFlowBuilder.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/VersionedFlowBuilder.java
@@ -43,8 +43,8 @@ import java.util.Set;
import java.util.UUID;
public class VersionedFlowBuilder {
- private VersionedFlowSnapshot flowSnapshot;
- private VersionedProcessGroup rootGroup;
+ private final VersionedFlowSnapshot flowSnapshot;
+ private final VersionedProcessGroup rootGroup;
public VersionedFlowBuilder() {
rootGroup = new VersionedProcessGroup();
@@ -146,7 +146,7 @@ public class VersionedFlowBuilder {
processor.setSchedulingStrategy("TIMER_DRIVEN");
processor.setRetryCount(0);
processor.setBackoffMechanism("PENALIZE_FLOWFILE");
- processor.setRetriedRelationships(Collections.EMPTY_SET);
+ processor.setRetriedRelationships(Collections.emptySet());
processor.setMaxBackoffPeriod("0 sec");
group.getProcessors().add(processor);
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/AsyncCommitCallbackIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/AsyncCommitCallbackIT.java
index 52fbf83..9a1fefa 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/AsyncCommitCallbackIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/AsyncCommitCallbackIT.java
@@ -27,8 +27,9 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.io.File;
import java.io.IOException;
@@ -40,15 +41,15 @@ import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class AsyncCommitCallbackIT extends StatelessSystemIT {
private final File inputFile = new File("target/input.txt");
private final File replacementFile = new File("target/replacement.txt");
- @Before
+ @BeforeEach
public void setup() throws IOException {
Files.write(inputFile.toPath(), "Hello World".getBytes(), StandardOpenOption.CREATE);
Files.deleteIfExists(replacementFile.toPath());
@@ -98,13 +99,15 @@ public class AsyncCommitCallbackIT extends StatelessSystemIT {
assertTrue(failureOutputFile.exists());
}
- @Test(timeout = 10_000)
+ @Timeout(10)
+ @Test
public void testCleanupAfterFlowFilesTerminated() throws IOException, StatelessConfigurationException, InterruptedException {
testCleanupAfterFlowFilesTerminated("asynchronous");
}
- @Test(timeout = 10_000)
- public void testSynchronousCommitCleanupAFterFlowFilesTerminated() throws IOException, StatelessConfigurationException, InterruptedException {
+ @Timeout(10)
+ @Test
+ public void testSynchronousCommitCleanupAfterFlowFilesTerminated() throws IOException, StatelessConfigurationException, InterruptedException {
testCleanupAfterFlowFilesTerminated("synchronous");
}
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/BatchOutputIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/BatchOutputIT.java
index 1a06c31..0b41934 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/BatchOutputIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/BatchOutputIT.java
@@ -27,15 +27,15 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class BatchOutputIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CancelFlowExecutionIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CancelFlowExecutionIT.java
index 3fa38fa..224e8ec 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CancelFlowExecutionIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CancelFlowExecutionIT.java
@@ -26,15 +26,15 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class CancelFlowExecutionIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CloneFlowFileIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CloneFlowFileIT.java
index a236c77..442f205 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CloneFlowFileIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CloneFlowFileIT.java
@@ -27,16 +27,16 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
+import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class CloneFlowFileIT extends StatelessSystemIT {
@@ -94,9 +94,7 @@ public class CloneFlowFileIT extends StatelessSystemIT {
try {
return new String(result.readContentAsByteArray(flowFile), StandardCharsets.UTF_8);
} catch (final IOException e) {
- e.printStackTrace();
- Assert.fail("Could not read content");
- return null;
+ throw new UncheckedIOException("Read Content Failed", e);
}
}
}
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CreatesFlowFileIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CreatesFlowFileIT.java
index 4461f4d..5ed91ca 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CreatesFlowFileIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/CreatesFlowFileIT.java
@@ -26,7 +26,7 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
@@ -34,8 +34,8 @@ import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class CreatesFlowFileIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/InputOutputIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/InputOutputIT.java
index 7cd0ae9..a1d78ef 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/InputOutputIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/InputOutputIT.java
@@ -28,14 +28,14 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class InputOutputIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/LoopingIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/LoopingIT.java
index bce3621..b24e176 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/LoopingIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/LoopingIT.java
@@ -26,7 +26,7 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -34,8 +34,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class LoopingIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/MergingIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/MergingIT.java
index 098ca99..b55ef4b 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/MergingIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/MergingIT.java
@@ -26,7 +26,7 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -34,8 +34,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class MergingIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/PartitioningContentIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/PartitioningContentIT.java
index fe7073d..1b6f05b 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/PartitioningContentIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/PartitioningContentIT.java
@@ -26,7 +26,7 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
@@ -36,8 +36,8 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class PartitioningContentIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/ProcessorLifecycleIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/ProcessorLifecycleIT.java
index b2596f7..6eb246a 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/ProcessorLifecycleIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/ProcessorLifecycleIT.java
@@ -24,7 +24,7 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RequiresAdditionalInputIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RequiresAdditionalInputIT.java
index 4fed602..ed4618e 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RequiresAdditionalInputIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RequiresAdditionalInputIT.java
@@ -29,8 +29,7 @@ import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TransactionThresholds;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -44,9 +43,9 @@ import java.util.Optional;
import java.util.OptionalLong;
import java.util.concurrent.TimeUnit;
-import static junit.framework.TestCase.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class RequiresAdditionalInputIT extends StatelessSystemIT {
@@ -75,11 +74,11 @@ public class RequiresAdditionalInputIT extends StatelessSystemIT {
assertTrue(result.isSuccessful());
final List<FlowFile> flowFiles = result.getOutputFlowFiles("Out");
- Assert.assertEquals(1, flowFiles.size());
+ assertEquals(1, flowFiles.size());
final FlowFile first = flowFiles.get(0);
final String outputContent = new String(result.readContentAsByteArray(first));
- Assert.assertEquals("123", outputContent);
+ assertEquals("123", outputContent);
result.acknowledge();
}
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RollbackOnExceptionIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RollbackOnExceptionIT.java
index 8d2eb62..4594b57 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RollbackOnExceptionIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/RollbackOnExceptionIT.java
@@ -27,18 +27,20 @@ import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.FailurePortEncounteredException;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.io.IOException;
import java.util.Collections;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class RollbackOnExceptionIT extends StatelessSystemIT {
private static final String EXCEPTION_TEXT = "Intentional Exception to verify behavior in RollbackOnExceptionIT";
- @Test(timeout = 30_000)
+ @Timeout(30)
+ @Test
public void testFlowFileCompletelyRemovedWhenExceptionThrown() throws IOException, StatelessConfigurationException, InterruptedException {
final VersionedFlowBuilder builder = new VersionedFlowBuilder();
final VersionedProcessor generate = builder.createSimpleProcessor("GenerateFlowFile");
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/SplittingIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/SplittingIT.java
index 846cc78..061cf21 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/SplittingIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/SplittingIT.java
@@ -26,7 +26,7 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -34,8 +34,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class SplittingIT extends StatelessSystemIT {
@Test
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StateStorageIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StateStorageIT.java
index 43c9ff4..a4c63b6 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StateStorageIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StateStorageIT.java
@@ -27,16 +27,16 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
-import static junit.framework.TestCase.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class StateStorageIT extends StatelessSystemIT {
@Test
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StatelessRetryIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StatelessRetryIT.java
index 0a6b811..dd93349 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StatelessRetryIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/basics/StatelessRetryIT.java
@@ -26,14 +26,14 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class StatelessRetryIT extends StatelessSystemIT {
private static final int RETRY_COUNT = 2;
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/classloader/InstanceClassLoaderIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/classloader/InstanceClassLoaderIT.java
index 8e51d00..9c9dffc 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/classloader/InstanceClassLoaderIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/classloader/InstanceClassLoaderIT.java
@@ -23,7 +23,7 @@ import org.apache.nifi.stateless.StatelessSystemIT;
import org.apache.nifi.stateless.VersionedFlowBuilder;
import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.StatelessDataflow;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
@@ -33,7 +33,7 @@ import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class InstanceClassLoaderIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/controller/services/StatelessControllerServiceSystemIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/controller/services/StatelessControllerServiceSystemIT.java
index 06ec164..6fdcb8a 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/controller/services/StatelessControllerServiceSystemIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/controller/services/StatelessControllerServiceSystemIT.java
@@ -29,14 +29,14 @@ import org.apache.nifi.stateless.config.StatelessConfigurationException;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class StatelessControllerServiceSystemIT extends StatelessSystemIT {
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/parameters/ParameterContextIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/parameters/ParameterContextIT.java
index 5eeb6e7..6848ff0 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/parameters/ParameterContextIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/parameters/ParameterContextIT.java
@@ -35,8 +35,7 @@ import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TransactionThresholds;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.ArrayList;
@@ -45,8 +44,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ParameterContextIT extends StatelessSystemIT {
@@ -105,14 +105,12 @@ public class ParameterContextIT extends StatelessSystemIT {
parameterContext.getParameters().add(createVersionedParameter("three", "-1")); // Set value to -1. This should be overridden by the Numeric Parameter Context.
flowBuilder.getRootGroup().setParameterContextName("Context 1");
- Assert.assertThrows(IllegalStateException.class, () -> {
- loadDataflow(flowSnapshot, Collections.emptyList(), parameterValueProviders, Collections.emptySet(), TransactionThresholds.SINGLE_FLOWFILE);
- });
+ assertThrows(IllegalStateException.class, () -> loadDataflow(flowSnapshot, Collections.emptyList(), parameterValueProviders, Collections.emptySet(), TransactionThresholds.SINGLE_FLOWFILE));
}
@Test
- public void testParameterValueProviderWithRequiredPropertyNotSet() throws IOException, StatelessConfigurationException {
+ public void testParameterValueProviderWithRequiredPropertyNotSet() {
final VersionedFlowBuilder flowBuilder = new VersionedFlowBuilder();
final VersionedPort outPort = flowBuilder.createOutputPort("Out");
final VersionedProcessor generate = flowBuilder.createSimpleProcessor("GenerateFlowFile");
@@ -133,9 +131,7 @@ public class ParameterContextIT extends StatelessSystemIT {
parameterContext.getParameters().add(createVersionedParameter("three", "1")); // Set value to -1. This should be overridden by the Numeric Parameter Context.
flowBuilder.getRootGroup().setParameterContextName("Context 1");
- Assert.assertThrows(IllegalStateException.class, () -> {
- loadDataflow(flowSnapshot, Collections.emptyList(), parameterValueProviders, Collections.emptySet(), TransactionThresholds.SINGLE_FLOWFILE);
- });
+ assertThrows(IllegalStateException.class, () -> loadDataflow(flowSnapshot, Collections.emptyList(), parameterValueProviders, Collections.emptySet(), TransactionThresholds.SINGLE_FLOWFILE));
}
@Test
diff --git a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/performance/StatelessPerformanceIT.java b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/performance/StatelessPerformanceIT.java
index 9056c6f..55b7732 100644
--- a/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/performance/StatelessPerformanceIT.java
+++ b/nifi-system-tests/nifi-stateless-system-test-suite/src/test/java/org/apache/nifi/stateless/performance/StatelessPerformanceIT.java
@@ -23,15 +23,15 @@ import org.apache.nifi.stateless.VersionedFlowBuilder;
import org.apache.nifi.stateless.flow.DataflowTrigger;
import org.apache.nifi.stateless.flow.StatelessDataflow;
import org.apache.nifi.stateless.flow.TriggerResult;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import java.util.ArrayList;
import java.util.List;
public class StatelessPerformanceIT extends StatelessSystemIT {
@Test
- @Ignore("For manual testing purposes only")
+ @EnabledIfSystemProperty(named = "nifi.test.performance", matches = "true")
public void testCreateDestroyPerf() throws InterruptedException {
System.setProperty("org.slf4j.simpleLogger.log.org.apache.nifi", "WARN");
final VersionedFlowBuilder builder = new VersionedFlowBuilder();
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiClientUtil.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiClientUtil.java
index 0dc64ea..c3de536 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiClientUtil.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiClientUtil.java
@@ -87,7 +87,6 @@ import org.apache.nifi.web.api.entity.VariableEntity;
import org.apache.nifi.web.api.entity.VariableRegistryEntity;
import org.apache.nifi.web.api.entity.VariableRegistryUpdateRequestEntity;
import org.apache.nifi.web.api.entity.VerifyConfigRequestEntity;
-import org.junit.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -105,6 +104,8 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
public class NiFiClientUtil {
private static final Logger logger = LoggerFactory.getLogger(NiFiClientUtil.class);
@@ -734,7 +735,7 @@ public class NiFiClientUtil {
try {
Thread.sleep(500L);
} catch (final Exception e) {
- Assert.fail(e.toString());
+ throw new RuntimeException(e);
}
}
}
@@ -762,8 +763,7 @@ public class NiFiClientUtil {
try {
Thread.sleep(500L);
} catch (final Exception e) {
- e.printStackTrace();
- Assert.fail(e.toString());
+ throw new RuntimeException(e);
}
}
}
@@ -1039,8 +1039,7 @@ public class NiFiClientUtil {
getConnectionClient().deleteListingRequest(connectionId, listingRequestEntity.getListingRequest().getId());
return listingRequestEntity;
} catch (final InterruptedException e) {
- Assert.fail("Failed to obtain connection status");
- return null;
+ throw new RuntimeException("Failed to obtain connection status");
}
}
@@ -1117,16 +1116,13 @@ public class NiFiClientUtil {
try {
Thread.sleep(100L);
} catch (final InterruptedException ie) {
- Assert.fail("Interrupted while waiting for variable registry to update");
- return null;
+ throw new RuntimeException("Interrupted while waiting for variable registry to update");
}
updateRequestEntity = nifiClient.getProcessGroupClient().getVariableRegistryUpdateRequest(processGroup.getId(), updateRequestEntity.getRequest().getRequestId());
}
- if (updateRequestEntity.getRequest().getFailureReason() != null) {
- Assert.fail("Failed to update Variable Registry due to: " + updateRequestEntity.getRequest().getFailureReason());
- }
+ assertNull(updateRequestEntity.getRequest().getFailureReason());
nifiClient.getProcessGroupClient().deleteVariableRegistryUpdateRequest(processGroup.getId(), updateRequestEntity.getRequest().getRequestId());
return updateRequestEntity;
@@ -1192,7 +1188,7 @@ public class NiFiClientUtil {
try {
responseEntity = waitForComplete(responseEntity);
} catch (final InterruptedException ie) {
- Assert.fail("Interrupted while waiting for Provenance Query to complete");
+ throw new RuntimeException("Interrupted while waiting for Provenance Query to complete");
}
nifiClient.getProvenanceClient().deleteProvenanceQuery(responseEntity.getProvenance().getId());
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/ClusteredRemoteProcessGroupIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiInstanceProvider.java
similarity index 60%
copy from nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/ClusteredRemoteProcessGroupIT.java
copy to nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiInstanceProvider.java
index 421d41b..ab7e3e8 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/ClusteredRemoteProcessGroupIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiInstanceProvider.java
@@ -14,17 +14,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.nifi.tests.system.rpg;
+package org.apache.nifi.tests.system;
-import org.apache.nifi.tests.system.NiFiInstanceFactory;
-import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
-
-public class ClusteredRemoteProcessGroupIT extends RemoteProcessGroupIT {
- @Override
- protected NiFiInstanceFactory getInstanceFactory() {
- return new SpawnedClusterNiFiInstanceFactory(
- "src/test/resources/conf/clustered/node1/bootstrap.conf",
- "src/test/resources/conf/clustered/node2/bootstrap.conf");
- }
+/**
+ * Provider for configured NiFi instances
+ */
+public interface NiFiInstanceProvider {
+ /**
+ * Get configured NiFi instance or null when not configured
+ *
+ * @return NiFi instance or null when not configured
+ */
+ NiFiInstance getNiFiInstance();
+ /**
+ * Get NiFi instance factory
+ *
+ * @return NiFi Instance Factory
+ */
+ NiFiInstanceFactory getInstanceFactory();
}
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiSystemIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiSystemIT.java
index 2f48f1f..341e384 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiSystemIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiSystemIT.java
@@ -24,15 +24,12 @@ import org.apache.nifi.web.api.dto.NodeDTO;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
import org.apache.nifi.web.api.entity.ClusterEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.junit.rules.TestWatcher;
-import org.junit.rules.Timeout;
-import org.junit.runner.Description;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestInfo;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,7 +46,9 @@ import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-public abstract class NiFiSystemIT {
+@ExtendWith(TroubleshootingTestWatcher.class)
+@Timeout(value = 5, unit = TimeUnit.MINUTES)
+public abstract class NiFiSystemIT implements NiFiInstanceProvider {
private static final Logger logger = LoggerFactory.getLogger(NiFiSystemIT.class);
private final ConcurrentMap<String, Long> lastLogTimestamps = new ConcurrentHashMap<>();
@@ -65,31 +64,16 @@ public abstract class NiFiSystemIT {
private static final File LIB_DIR = new File("target/nifi-lib-assembly/lib");
private static volatile String nifiFrameworkVersion = null;
- @Rule
- public TestName name = new TestName();
- @Rule
- public Timeout defaultTimeout = new Timeout(5, TimeUnit.MINUTES);
-
- @Rule(order = Integer.MIN_VALUE)
- public TestWatcher quarantineRule = new TestWatcher() {
- @Override
- protected void failed(final Throwable t, final Description description) {
- final String testName = description.getMethodName();
- try {
- final File dir = quarantineTroubleshootingInfo(testName, t);
- logger.info("Test failure for <{}>. Successfully wrote troubleshooting info to {}", testName, dir.getAbsolutePath());
- } catch (final Exception e) {
- logger.error("Failed to quarantine troubleshooting info for test " + testName, e);
- }
- }
- };
-
private NiFiClient nifiClient;
private NiFiClientUtil clientUtil;
private static final AtomicReference<NiFiInstance> nifiRef = new AtomicReference<>();
- @Before
- public void setup() throws IOException {
+ private TestInfo testInfo;
+
+ @BeforeEach
+ public void setup(final TestInfo testInfo) throws IOException {
+ this.testInfo = testInfo;
+
Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
setupClient();
@@ -107,7 +91,7 @@ public abstract class NiFiSystemIT {
}
}
- @AfterClass
+ @AfterAll
public static void cleanup() {
final NiFiInstance nifi = nifiRef.get();
nifiRef.set(null);
@@ -116,7 +100,7 @@ public abstract class NiFiSystemIT {
}
}
- @After
+ @AfterEach
public void teardown() throws Exception {
try {
Exception destroyFlowFailure = null;
@@ -147,21 +131,23 @@ public abstract class NiFiSystemIT {
}
}
- protected File quarantineTroubleshootingInfo(final String methodName, final Throwable failureCause) throws IOException {
- NiFiInstance instance = getNiFiInstance();
-
- // The @AfterClass may or may not have already run at this point. If it has, the instance will be null.
- // In that case, just create a new instance and use it - it will map to the same directories.
- if (instance == null) {
- instance = getInstanceFactory().createInstance();
- }
+ @Override
+ public NiFiInstance getNiFiInstance() {
+ return nifiRef.get();
+ }
- final File troubleshooting = new File("target/troubleshooting");
- final File quarantineDir = new File(troubleshooting, methodName);
- quarantineDir.mkdirs();
+ @Override
+ public NiFiInstanceFactory getInstanceFactory() {
+ return new SpawnedStandaloneNiFiInstanceFactory(
+ new InstanceConfiguration.Builder()
+ .bootstrapConfig("src/test/resources/conf/default/bootstrap.conf")
+ .instanceDirectory("target/standalone-instance")
+ .overrideNifiProperties(getNifiPropertiesOverrides())
+ .build());
+ }
- instance.quarantineTroubleshootingInfo(quarantineDir, failureCause);
- return quarantineDir;
+ protected String getTestName() {
+ return testInfo.getDisplayName();
}
protected boolean isDestroyEnvironmentAfterEachTest() {
@@ -253,11 +239,6 @@ public abstract class NiFiSystemIT {
return CLIENT_API_PORT;
}
-
- protected String getTestName() {
- return name.getMethodName();
- }
-
protected NiFiClient getNifiClient() {
Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
return nifiClient;
@@ -283,10 +264,6 @@ public abstract class NiFiSystemIT {
throw new IllegalStateException("Could not determine version of NiFi");
}
- protected NiFiInstance getNiFiInstance() {
- return nifiRef.get();
- }
-
protected int getNumberOfNodes() {
return getNumberOfNodes(true);
}
@@ -300,15 +277,6 @@ public abstract class NiFiSystemIT {
return instance.getNumberOfNodes(includeOnlyAutoStartInstances);
}
- protected NiFiInstanceFactory getInstanceFactory() {
- return new SpawnedStandaloneNiFiInstanceFactory(
- new InstanceConfiguration.Builder()
- .bootstrapConfig("src/test/resources/conf/default/bootstrap.conf")
- .instanceDirectory("target/standalone-instance")
- .overrideNifiProperties(getNifiPropertiesOverrides())
- .build());
- }
-
protected Map<String, String> getNifiPropertiesOverrides() {
return Collections.emptyMap();
}
@@ -398,9 +366,7 @@ public abstract class NiFiSystemIT {
try {
return getNifiClient().getFlowClient().getConnectionStatus(connectionId, true);
} catch (final Exception e) {
- e.printStackTrace();
- Assert.fail("Failed to obtain connection status");
- return null;
+ throw new RuntimeException("Failed to obtain connection status");
}
}
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/SpawnedStandaloneNiFiInstanceFactory.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/SpawnedStandaloneNiFiInstanceFactory.java
index 8b5f2ad..f14e4d3 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/SpawnedStandaloneNiFiInstanceFactory.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/SpawnedStandaloneNiFiInstanceFactory.java
@@ -38,7 +38,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.Properties;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class SpawnedStandaloneNiFiInstanceFactory implements NiFiInstanceFactory {
private static final Logger logger = LoggerFactory.getLogger(SpawnedStandaloneNiFiInstanceFactory.class);
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/TroubleshootingTestWatcher.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/TroubleshootingTestWatcher.java
new file mode 100644
index 0000000..8d71362
--- /dev/null
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/TroubleshootingTestWatcher.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.tests.system;
+
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.TestWatcher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Optional;
+
+/**
+ * Test Watcher responsible for writing troubleshooting logs
+ */
+public class TroubleshootingTestWatcher implements TestWatcher {
+ private static final Logger logger = LoggerFactory.getLogger(TroubleshootingTestWatcher.class);
+
+ @Override
+ public void testFailed(final ExtensionContext context, final Throwable cause) {
+ final Optional<Object> optionalTestInstance = context.getTestInstance();
+ if (optionalTestInstance.isPresent()) {
+ final Object testInstance = optionalTestInstance.get();
+ if (testInstance instanceof NiFiInstanceProvider) {
+ final NiFiInstanceProvider provider = (NiFiInstanceProvider) testInstance;
+ final String displayName = context.getDisplayName();
+ try {
+ final File dir = quarantineTroubleshootingInfo(provider, displayName, cause);
+ logger.info("Test Failed [{}]: Troubleshooting information stored [{}]", displayName, dir.getAbsolutePath());
+ } catch (final Exception e) {
+ logger.error("Test Failed [{}]: Troubleshooting information not stored", displayName, e);
+ }
+ }
+ }
+ }
+
+ private File quarantineTroubleshootingInfo(final NiFiInstanceProvider provider, final String methodName, final Throwable failureCause) throws IOException {
+ NiFiInstance instance = provider.getNiFiInstance();
+
+ // The teardown method may or may not have already run at this point. If it has, the instance will be null.
+ // In that case, just create a new instance and use it - it will map to the same directories.
+ if (instance == null) {
+ instance = provider.getInstanceFactory().createInstance();
+ }
+
+ final File troubleshooting = new File("target/troubleshooting");
+ final File quarantineDir = new File(troubleshooting, methodName);
+ quarantineDir.mkdirs();
+
+ instance.quarantineTroubleshootingInfo(quarantineDir, failureCause);
+ return quarantineDir;
+ }
+}
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/classloaders/ClassloaderIsolationKeyIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/classloaders/ClassloaderIsolationKeyIT.java
index 4c5fb82..1f62d9a 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/classloaders/ClassloaderIsolationKeyIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/classloaders/ClassloaderIsolationKeyIT.java
@@ -21,7 +21,7 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
@@ -29,7 +29,7 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Collections;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ClassloaderIsolationKeyIT extends NiFiSystemIT {
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java
index 2a45672..7a5d89e 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java
@@ -53,7 +53,7 @@ import org.apache.nifi.web.api.entity.ProcessGroupEntity;
import org.apache.nifi.web.api.entity.ProcessGroupFlowEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
import org.apache.nifi.web.api.entity.ReportingTaskEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,9 +70,9 @@ import java.util.Map;
import java.util.Set;
import java.util.zip.GZIPInputStream;
-import static junit.framework.TestCase.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class FlowSynchronizationIT extends NiFiSystemIT {
private static final Logger logger = LoggerFactory.getLogger(FlowSynchronizationIT.class);
@@ -84,7 +84,7 @@ public class FlowSynchronizationIT extends NiFiSystemIT {
private final ObjectMapper objectMapper = new ObjectMapper();
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
new InstanceConfiguration.Builder()
.bootstrapConfig("src/test/resources/conf/clustered/node1/bootstrap.conf")
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterAdjustStateIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterAdjustStateIT.java
index 5849a52..6c89de2 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterAdjustStateIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterAdjustStateIT.java
@@ -23,18 +23,18 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Collections;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class JoinClusterAdjustStateIT extends NiFiSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
new InstanceConfiguration.Builder()
.bootstrapConfig("src/test/resources/conf/clustered/node1/bootstrap.conf")
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithDifferentFlow.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithDifferentFlow.java
index f6f9ea6..c53bd0b 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithDifferentFlow.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithDifferentFlow.java
@@ -45,7 +45,7 @@ import org.apache.nifi.web.api.entity.ControllerServicesEntity;
import org.apache.nifi.web.api.entity.NodeEntity;
import org.apache.nifi.web.api.entity.ParameterEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
@@ -69,12 +69,12 @@ import java.util.Properties;
import java.util.Set;
import java.util.zip.GZIPInputStream;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
public class JoinClusterWithDifferentFlow extends NiFiSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
final Map<String, String> propertyOverrides = Collections.singletonMap("nifi.cluster.flow.serialization.format", "XML");
return new SpawnedClusterNiFiInstanceFactory(
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionNoData.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionNoData.java
index 37d681e..dc69d12 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionNoData.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionNoData.java
@@ -20,11 +20,11 @@ import org.apache.nifi.tests.system.InstanceConfiguration;
import org.apache.nifi.tests.system.NiFiInstanceFactory;
import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class JoinClusterWithMissingConnectionNoData extends NiFiSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
new InstanceConfiguration.Builder()
.bootstrapConfig("src/test/resources/conf/clustered/node1/bootstrap.conf")
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionWithData.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionWithData.java
index 5d747be..d5fcde5 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionWithData.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithMissingConnectionWithData.java
@@ -27,7 +27,7 @@ import org.apache.nifi.web.api.dto.flow.FlowDTO;
import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.NodeEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
@@ -36,7 +36,7 @@ public class JoinClusterWithMissingConnectionWithData extends NiFiSystemIT {
private static final String CONNECTION_UUID = "6be9a991-016e-1000-ffff-fffffebf0217";
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
new InstanceConfiguration.Builder()
.bootstrapConfig("src/test/resources/conf/clustered/node1/bootstrap.conf")
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/NodeRestartWithNewNodeIdIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/NodeRestartWithNewNodeIdIT.java
index a1a608b..a576196 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/NodeRestartWithNewNodeIdIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/NodeRestartWithNewNodeIdIT.java
@@ -23,20 +23,20 @@ import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.NodeDTO;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
-import static junit.framework.TestCase.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
public class NodeRestartWithNewNodeIdIT extends NiFiSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/OffloadIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/OffloadIT.java
index e806cef..f535325 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/OffloadIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/OffloadIT.java
@@ -26,7 +26,7 @@ import org.apache.nifi.web.api.dto.ProcessorConfigDTO;
import org.apache.nifi.web.api.entity.ClusterEntity;
import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,7 +37,7 @@ public class OffloadIT extends NiFiSystemIT {
private static final Logger logger = LoggerFactory.getLogger(OffloadIT.class);
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/RestartWithDifferentPort.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/RestartWithDifferentPort.java
index c0c5b5d..578e6c1 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/RestartWithDifferentPort.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/RestartWithDifferentPort.java
@@ -24,19 +24,19 @@ import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.NodeDTO;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
import org.apache.nifi.web.api.entity.ClusterEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class RestartWithDifferentPort extends NiFiSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/SimpleNodeRestartIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/SimpleNodeRestartIT.java
index cb6c482..1e15eb8 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/SimpleNodeRestartIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/SimpleNodeRestartIT.java
@@ -22,16 +22,16 @@ import org.apache.nifi.tests.system.NiFiInstanceFactory;
import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class SimpleNodeRestartIT extends NiFiSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/ControllerServiceApiValidationIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/ControllerServiceApiValidationIT.java
index 7f6f5ce..5cc6dc0 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/ControllerServiceApiValidationIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/ControllerServiceApiValidationIT.java
@@ -21,12 +21,12 @@ import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ControllerServiceEntity;
import org.apache.nifi.web.api.entity.ControllerServiceRunStatusEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ControllerServiceApiValidationIT extends NiFiSystemIT {
@Test
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/DependentControllerServiceIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/DependentControllerServiceIT.java
index 90950f7..9238297 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/DependentControllerServiceIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/controllerservice/DependentControllerServiceIT.java
@@ -24,7 +24,7 @@ import org.apache.nifi.web.api.entity.ControllerServiceReferencingComponentEntit
import org.apache.nifi.web.api.entity.ControllerServiceReferencingComponentsEntity;
import org.apache.nifi.web.api.entity.ControllerServiceRunStatusEntity;
import org.apache.nifi.web.api.entity.UpdateControllerServiceReferenceRequestEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/loadbalance/LoadBalanceIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/loadbalance/LoadBalanceIT.java
index 0890f71..2e1b1c0 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/loadbalance/LoadBalanceIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/loadbalance/LoadBalanceIT.java
@@ -34,8 +34,7 @@ import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
import org.apache.nifi.web.api.entity.FlowFileEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -47,14 +46,14 @@ import java.util.LongSummaryStatistics;
import java.util.Map;
import java.util.Set;
-import static junit.framework.TestCase.assertTrue;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class LoadBalanceIT extends NiFiSystemIT {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
@@ -219,7 +218,7 @@ public class LoadBalanceIT extends NiFiSystemIT {
assertEquals(10, nodesByAttribute.size());
for (final Map.Entry<String, Set<String>> entry : nodesByAttribute.entrySet()) {
final Set<String> nodes = entry.getValue();
- assertEquals("FlowFile with attribute number=" + entry.getKey() + " went to nodes " + nodes, 1, nodes.size());
+ assertEquals(1, nodes.size(), "FlowFile with attribute number=" + entry.getKey() + " went to nodes " + nodes);
}
}
@@ -303,8 +302,7 @@ public class LoadBalanceIT extends NiFiSystemIT {
try {
return getNifiClient().getFlowClient().getConnectionStatus(connectionId, true);
} catch (final Exception e) {
- Assert.fail("Failed to obtain connection status");
- return null;
+ throw new RuntimeException("Failed to obtain connection status");
}
}
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ClusteredParameterContextIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ClusteredParameterContextIT.java
index 4f994fe..5606331 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ClusteredParameterContextIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ClusteredParameterContextIT.java
@@ -24,7 +24,7 @@ import org.apache.nifi.tests.system.NiFiInstanceFactory;
*/
public class ClusteredParameterContextIT extends ParameterContextIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ParameterContextIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ParameterContextIT.java
index 4e5e45b..9526d62 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ParameterContextIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/parameters/ParameterContextIT.java
@@ -31,7 +31,8 @@ import org.apache.nifi.web.api.entity.ParameterContextUpdateRequestEntity;
import org.apache.nifi.web.api.entity.ParameterEntity;
import org.apache.nifi.web.api.entity.ProcessGroupEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.io.File;
import java.io.IOException;
@@ -46,11 +47,11 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ParameterContextIT extends NiFiSystemIT {
@Test
@@ -181,7 +182,8 @@ public class ParameterContextIT extends NiFiSystemIT {
waitForValidProcessor(processorId);
}
- @Test(timeout=30000)
+ @Timeout(30)
+ @Test
public void testValidationWithRequiredPropertiesAndNoDefault() throws NiFiClientException, IOException, InterruptedException {
final ProcessorEntity generate = getClientUtil().createProcessor("DependOnProperties");
final Map<String, String> properties = new HashMap<>();
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/BatchFlowBetweenGroupsIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/BatchFlowBetweenGroupsIT.java
index 19851b1..5c682b0 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/BatchFlowBetweenGroupsIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/BatchFlowBetweenGroupsIT.java
@@ -25,7 +25,7 @@ import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.PortEntity;
import org.apache.nifi.web.api.entity.ProcessGroupEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/SingleFlowFileConcurrencyIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/SingleFlowFileConcurrencyIT.java
index 18f9f9e..99a28ec 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/SingleFlowFileConcurrencyIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/pg/SingleFlowFileConcurrencyIT.java
@@ -26,15 +26,15 @@ import org.apache.nifi.web.api.entity.FlowFileEntity;
import org.apache.nifi.web.api.entity.PortEntity;
import org.apache.nifi.web.api.entity.ProcessGroupEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class SingleFlowFileConcurrencyIT extends NiFiSystemIT {
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RetryIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RetryIT.java
index 70787ea..f5d9bc8 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RetryIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RetryIT.java
@@ -22,7 +22,7 @@ import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.ProcessorConfigDTO;
import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Arrays;
@@ -32,7 +32,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class RetryIT extends NiFiSystemIT {
private static final int RETRY_COUNT = 2;
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RunOnceIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RunOnceIT.java
index db6bbc6..bda3ac5 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RunOnceIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/RunOnceIT.java
@@ -20,15 +20,17 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.io.IOException;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class RunOnceIT extends NiFiSystemIT {
- @Test(timeout = 10000L)
+ @Timeout(10)
+ @Test
public void testRunOnce() throws NiFiClientException, IOException, InterruptedException {
ProcessorEntity generate = getClientUtil().createProcessor("GenerateFlowFile");
getClientUtil().updateProcessorSchedulingPeriod(generate, "1 sec");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/provenance/ProvenanceRepositoryIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/provenance/ProvenanceRepositoryIT.java
index c36fc46..5665a46 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/provenance/ProvenanceRepositoryIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/provenance/ProvenanceRepositoryIT.java
@@ -25,7 +25,7 @@ import org.apache.nifi.web.api.dto.provenance.ProvenanceEventDTO;
import org.apache.nifi.web.api.dto.provenance.ProvenanceSearchValueDTO;
import org.apache.nifi.web.api.entity.ProcessorEntity;
import org.apache.nifi.web.api.entity.ProvenanceEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -34,7 +34,7 @@ import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ProvenanceRepositoryIT extends NiFiSystemIT {
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/reportingtask/ReportingTaskIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/reportingtask/ReportingTaskIT.java
index 5b1c75e..c9e1fdf 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/reportingtask/ReportingTaskIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/reportingtask/ReportingTaskIT.java
@@ -21,7 +21,7 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ControllerServiceEntity;
import org.apache.nifi.web.api.entity.ReportingTaskEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/repositories/ContentAccessIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/repositories/ContentAccessIT.java
index 1a3790f..bca8e1c 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/repositories/ContentAccessIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/repositories/ContentAccessIT.java
@@ -21,7 +21,7 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -30,7 +30,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* This test is intended to verify that Processors are able to access the content that their FlowFiles represent in several different situations.
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/restart/FlowFileRestorationIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/restart/FlowFileRestorationIT.java
index 3cecadb..747103c 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/restart/FlowFileRestorationIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/restart/FlowFileRestorationIT.java
@@ -23,8 +23,7 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -34,10 +33,11 @@ import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.Collections;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class FlowFileRestorationIT extends NiFiSystemIT {
@@ -72,12 +72,7 @@ public class FlowFileRestorationIT extends NiFiSystemIT {
nifiInstance.start();
- try {
- getNifiClient().getConnectionClient().getConnection(connection.getId());
- Assert.fail("Didn't expect to retrieve a connection");
- } catch (final NiFiClientException nfce) {
- // Expected because the connection no longer exists.
- }
+ assertThrows(NiFiClientException.class, () -> getNifiClient().getConnectionClient().getConnection(connection.getId()));
// Stop the instance, restore the flow.xml.gz, and restart
nifiInstance.stop();
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/ClusteredRemoteProcessGroupIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/ClusteredRemoteProcessGroupIT.java
index 421d41b..a1b98e3 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/ClusteredRemoteProcessGroupIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/ClusteredRemoteProcessGroupIT.java
@@ -21,7 +21,7 @@ import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
public class ClusteredRemoteProcessGroupIT extends RemoteProcessGroupIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/RemoteProcessGroupIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/RemoteProcessGroupIT.java
index 4bc76b6..b25f8d1 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/RemoteProcessGroupIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/rpg/RemoteProcessGroupIT.java
@@ -26,8 +26,7 @@ import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.PortEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
import org.apache.nifi.web.api.entity.RemoteProcessGroupEntity;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -82,9 +81,7 @@ public class RemoteProcessGroupIT extends NiFiSystemIT {
return false;
} catch (Exception e) {
- e.printStackTrace();
- Assert.fail("Could not retrieve RPG with ID " + rpgId);
- return false;
+ throw new RuntimeException("Could not retrieve RPG with ID " + rpgId);
}
});
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/validation/DependentPropertyValidationIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/validation/DependentPropertyValidationIT.java
index 8704de9..5d58fd4 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/validation/DependentPropertyValidationIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/validation/DependentPropertyValidationIT.java
@@ -20,7 +20,8 @@ package org.apache.nifi.tests.system.validation;
import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.io.IOException;
import java.util.Collections;
@@ -29,7 +30,8 @@ import java.util.Map;
public class DependentPropertyValidationIT extends NiFiSystemIT {
- @Test(timeout = 20_000)
+ @Timeout(20)
+ @Test
public void testPropertyDependenciesAreValidatedProperly() throws NiFiClientException, IOException, InterruptedException {
final ProcessorEntity processor = getClientUtil().createProcessor("DependOnProperties");
getClientUtil().updateProcessorProperties(processor, Collections.singletonMap("Always Required", "foo"));
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/variables/ProcessGroupVariablesIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/variables/ProcessGroupVariablesIT.java
index 908a8a9..3217a3a 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/variables/ProcessGroupVariablesIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/variables/ProcessGroupVariablesIT.java
@@ -22,12 +22,12 @@ import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.FlowFileEntity;
import org.apache.nifi.web.api.entity.ProcessGroupEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ProcessGroupVariablesIT extends NiFiSystemIT {
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableControllerServiceSystemIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableControllerServiceSystemIT.java
index 3cbfc3e..30d1df2 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableControllerServiceSystemIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableControllerServiceSystemIT.java
@@ -23,18 +23,18 @@ import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.ConfigVerificationResultDTO;
import org.apache.nifi.web.api.entity.ControllerServiceEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ClusteredVerifiableControllerServiceSystemIT extends VerifiableControllerServiceSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableProcessorSystemIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableProcessorSystemIT.java
index 3f3a83b..8f2502f 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableProcessorSystemIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableProcessorSystemIT.java
@@ -23,19 +23,19 @@ import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.ConfigVerificationResultDTO;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ClusteredVerifiableProcessorSystemIT extends VerifiableProcessorSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableReportingTaskSystemIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableReportingTaskSystemIT.java
index d24585d..04a25d0 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableReportingTaskSystemIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/ClusteredVerifiableReportingTaskSystemIT.java
@@ -23,19 +23,19 @@ import org.apache.nifi.tests.system.SpawnedClusterNiFiInstanceFactory;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.ConfigVerificationResultDTO;
import org.apache.nifi.web.api.entity.ReportingTaskEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ClusteredVerifiableReportingTaskSystemIT extends VerifiableReportingTaskSystemIT {
@Override
- protected NiFiInstanceFactory getInstanceFactory() {
+ public NiFiInstanceFactory getInstanceFactory() {
return new SpawnedClusterNiFiInstanceFactory(
"src/test/resources/conf/clustered/node1/bootstrap.conf",
"src/test/resources/conf/clustered/node2/bootstrap.conf");
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableControllerServiceSystemIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableControllerServiceSystemIT.java
index 6109f38..3a79b0f 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableControllerServiceSystemIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableControllerServiceSystemIT.java
@@ -22,7 +22,7 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.ConfigVerificationResultDTO;
import org.apache.nifi.web.api.entity.ControllerServiceEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -30,8 +30,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class VerifiableControllerServiceSystemIT extends NiFiSystemIT {
@@ -88,7 +88,7 @@ public class VerifiableControllerServiceSystemIT extends NiFiSystemIT {
// Verify using attributes that should give us a successful verification
List<ConfigVerificationResultDTO> resultList = getClientUtil().verifyControllerServiceConfig(service.getId(), properties, goodAttributes);
- assertEquals("Got unexpected results: " + resultList, 7, resultList.size());
+ assertEquals(7, resultList.size());
// Should have SUCCESS for validation, then 5 successes for the steps. Then 1 skipped for the Fail on Primary Node
for (int i=0; i < resultList.size() - 1; i++) {
@@ -139,7 +139,7 @@ public class VerifiableControllerServiceSystemIT extends NiFiSystemIT {
}
@Test
- public void testVerificationWithValidConfigWhenComponentRunning() throws InterruptedException, IOException, NiFiClientException {
+ public void testVerificationWithValidConfigWhenComponentRunning() throws IOException, NiFiClientException {
final ControllerServiceEntity service = getClientUtil().createControllerService("EnsureControllerServiceConfigurationCorrect");
final Map<String, String> properties = Collections.singletonMap("Successful Verification", "true");
@@ -147,9 +147,7 @@ public class VerifiableControllerServiceSystemIT extends NiFiSystemIT {
getClientUtil().enableControllerService(service);
- assertThrows(NiFiClientException.class, () -> {
- getClientUtil().verifyControllerServiceConfig(service.getId(), properties);
- });
+ assertThrows(NiFiClientException.class, () -> getClientUtil().verifyControllerServiceConfig(service.getId(), properties));
}
@@ -179,7 +177,7 @@ public class VerifiableControllerServiceSystemIT extends NiFiSystemIT {
assertEquals(1, resultList.size());
// Even though GenerateFlowFile is not connected, it should be valid because connections are not considered when verifying the processor
- assertEquals("Unexpected results: " + resultList, Outcome.SUCCESSFUL.name(), resultList.get(0).getOutcome());
+ assertEquals(Outcome.SUCCESSFUL.name(), resultList.get(0).getOutcome());
}
@Test
@@ -189,7 +187,7 @@ public class VerifiableControllerServiceSystemIT extends NiFiSystemIT {
final List<ConfigVerificationResultDTO> resultList = getClientUtil().verifyControllerServiceConfig(service.getId(), Collections.singletonMap("Validate Sleep Time", "foo"));
assertEquals(1, resultList.size());
- assertEquals("Unexpected results: " + resultList, Outcome.FAILED.name(), resultList.get(0).getOutcome());
+ assertEquals(Outcome.FAILED.name(), resultList.get(0).getOutcome());
}
}
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableProcessorSystemIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableProcessorSystemIT.java
index dbf1153..40dc32c 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableProcessorSystemIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableProcessorSystemIT.java
@@ -22,7 +22,7 @@ import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.ConfigVerificationResultDTO;
import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -30,8 +30,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class VerifiableProcessorSystemIT extends NiFiSystemIT {
@@ -89,7 +89,7 @@ public class VerifiableProcessorSystemIT extends NiFiSystemIT {
// Verify using attributes that should give us a successful verification
List<ConfigVerificationResultDTO> resultList = getClientUtil().verifyProcessorConfig(processor.getId(), properties, goodAttributes);
- assertEquals("Got unexpected results: " + resultList, 7, resultList.size());
+ assertEquals(7, resultList.size());
// Should have SUCCESS for validation, then 5 successes for the steps. Then 1 skipped for the Fail on Primary Node
for (int i=0; i < resultList.size() - 1; i++) {
@@ -155,9 +155,7 @@ public class VerifiableProcessorSystemIT extends NiFiSystemIT {
getClientUtil().startProcessGroupComponents("root");
getClientUtil().waitForProcessorState(processor.getId(), "RUNNING");
- assertThrows(NiFiClientException.class, () -> {
- getClientUtil().verifyProcessorConfig(processor.getId(), properties);
- });
+ assertThrows(NiFiClientException.class, () -> getClientUtil().verifyProcessorConfig(processor.getId(), properties));
}
@Test
@@ -210,7 +208,7 @@ public class VerifiableProcessorSystemIT extends NiFiSystemIT {
assertEquals(1, resultList.size());
// Even though GenerateFlowFile is not connected, it should be valid because connections are not considered when verifying the processor
- assertEquals("Unexpected results: " + resultList, Outcome.SUCCESSFUL.name(), resultList.get(0).getOutcome());
+ assertEquals(Outcome.SUCCESSFUL.name(), resultList.get(0).getOutcome());
}
@Test
@@ -220,7 +218,7 @@ public class VerifiableProcessorSystemIT extends NiFiSystemIT {
final List<ConfigVerificationResultDTO> resultList = getClientUtil().verifyProcessorConfig(processor.getId(), Collections.singletonMap("File Size", "foo"));
assertEquals(1, resultList.size());
- assertEquals("Unexpected results: " + resultList, Outcome.FAILED.name(), resultList.get(0).getOutcome());
+ assertEquals(Outcome.FAILED.name(), resultList.get(0).getOutcome());
}
}
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableReportingTaskSystemIT.java b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableReportingTaskSystemIT.java
index 4b84297..bc0f661 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableReportingTaskSystemIT.java
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/verification/VerifiableReportingTaskSystemIT.java
@@ -23,7 +23,7 @@ import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.ConfigVerificationResultDTO;
import org.apache.nifi.web.api.entity.ReportingTaskEntity;
import org.apache.nifi.web.api.entity.ReportingTaskRunStatusEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Collections;
@@ -31,8 +31,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class VerifiableReportingTaskSystemIT extends NiFiSystemIT {
@@ -154,7 +154,7 @@ public class VerifiableReportingTaskSystemIT extends NiFiSystemIT {
assertEquals(1, resultList.size());
// Even though GenerateFlowFile is not connected, it should be valid because connections are not considered when verifying the processor
- assertEquals("Unexpected results: " + resultList, Outcome.SUCCESSFUL.name(), resultList.get(0).getOutcome());
+ assertEquals(Outcome.SUCCESSFUL.name(), resultList.get(0).getOutcome());
}
@Test