exceptionfactory commented on a change in pull request #5362:
URL: https://github.com/apache/nifi/pull/5362#discussion_r705764678
##########
File path:
nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/test/java/org/apache/nifi/reporting/TestSiteToSiteProvenanceReportingTask.java
##########
@@ -692,7 +691,7 @@ public void setup(ReportingContext reportContext) throws
IOException {
when(client.createTransaction(Mockito.any(TransferDirection.class))).thenReturn(transaction);
} catch (final Exception e) {
e.printStackTrace();
- Assert.fail(e.toString());
+ fail(e.toString());
Review comment:
This should be changed to `assertThrows`
##########
File path:
nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/test/java/org/apache/nifi/reporting/TestSiteToSiteBulletinReportingTask.java
##########
@@ -198,7 +187,7 @@ public void setup(ReportingContext reportContext) throws
IOException {
when(client.createTransaction(Mockito.any(TransferDirection.class))).thenReturn(transaction);
} catch (final Exception e) {
e.printStackTrace();
- Assert.fail(e.toString());
+ fail(e.toString());
Review comment:
This should be changed to `assertThrows`
##########
File path:
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/test/java/org/apache/nifi/processors/solr/TestPutSolrContentStream.java
##########
@@ -636,9 +640,9 @@ protected SolrClient createSolrClient(ProcessContext
context, String solrLocatio
when(mockSolrClient.request(any(SolrRequest.class),
eq(null))).thenThrow(throwable);
} catch (SolrServerException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
} catch (IOException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
Review comment:
Should be changed to use `assertThrows`
##########
File path:
nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/test/java/org/apache/nifi/reporting/sink/TestSiteToSiteReportingRecordSink.java
##########
@@ -164,7 +164,7 @@ protected SiteToSiteClient getClient() {
Mockito.when(client.createTransaction(Mockito.any(TransferDirection.class))).thenReturn(transaction);
} catch (final Exception e) {
e.printStackTrace();
- Assert.fail(e.toString());
+ fail(e.toString());
Review comment:
Should be changed to use `assertThrows`
##########
File path:
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/test/java/org/apache/nifi/processors/solr/TestPutSolrContentStream.java
##########
@@ -636,9 +640,9 @@ protected SolrClient createSolrClient(ProcessContext
context, String solrLocatio
when(mockSolrClient.request(any(SolrRequest.class),
eq(null))).thenThrow(throwable);
} catch (SolrServerException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
Review comment:
Should be changed to use `assertThrows`
##########
File path:
nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/test/java/org/apache/nifi/processors/solr/TestPutSolrRecord.java
##########
@@ -721,7 +723,7 @@ protected SolrClient createSolrClient(ProcessContext
context, String solrLocatio
when(mockSolrClient.request(any(SolrRequest.class),
eq(null))).thenThrow(throwable);
} catch (SolrServerException|IOException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
Review comment:
Should be changed to use `assertThrows`
##########
File path:
nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/test/java/org/apache/nifi/reporting/TestSiteToSiteMetricsReportingTask.java
##########
@@ -319,7 +302,7 @@ public void setup(ReportingContext reportContext) throws
IOException {
when(client.createTransaction(Mockito.any(TransferDirection.class))).thenReturn(transaction);
} catch (final Exception e) {
e.printStackTrace();
- Assert.fail(e.toString());
+ fail(e.toString());
Review comment:
This should be changed to `assertThrows`
##########
File path:
nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/test/java/org/apache/nifi/websocket/util/HeaderMapExtractorTest.java
##########
@@ -51,15 +49,15 @@ public void testMapExtractor() {
final Map<String, List<String>> actual =
HeaderMapExtractor.getHeaderMap(attributes);
// THEN
- assertEquals(expected, actual);
+ Assertions.assertEquals(expected, actual);
Review comment:
Usage should be changed to static imports.
##########
File path:
nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/test/java/org/apache/nifi/websocket/jetty/TestJettyWebSocketClient.java
##########
@@ -33,9 +31,9 @@ public void testValidationRequiredProperties() throws
Exception {
final ControllerServiceTestContext context = new
ControllerServiceTestContext(service, "service-id");
service.initialize(context.getInitializationContext());
final Collection<ValidationResult> results =
service.validate(context.getValidationContext());
- assertEquals(1, results.size());
+ Assertions.assertEquals(1, results.size());
Review comment:
These references to `Assertions` should be changed to use static imports.
##########
File path:
nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/test/java/org/apache/nifi/websocket/jetty/ITJettyWebSocketCommunication.java
##########
@@ -35,18 +37,17 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-
+@DisabledOnOs(OS.WINDOWS)
Review comment:
This annotation can be removed this since is an integration test class.
##########
File path:
nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/test/java/org/apache/nifi/reporting/TestSiteToSiteStatusReportingTask.java
##########
@@ -553,7 +548,7 @@ public void setup(ReportingContext reportContext) throws
IOException {
when(client.createTransaction(Mockito.any(TransferDirection.class))).thenReturn(transaction);
} catch (final Exception e) {
e.printStackTrace();
- Assert.fail(e.toString());
+ fail(e.toString());
Review comment:
Should be changed to use `assertThrows`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]