exceptionfactory commented on code in PR #11724:
URL: https://github.com/apache/nifi/pull/11724#discussion_r4107998876
##########
nifi-extension-bundles/nifi-standard-services/nifi-file-resource-service-bundle/nifi-file-resource-service/src/test/java/org/apache/nifi/fileresource/service/StandardFileResourceServiceTest.java:
##########
@@ -16,7 +16,6 @@
*/
package org.apache.nifi.fileresource.service;
-import org.apache.commons.io.FileUtils;
Review Comment:
With this removal, it looks like `commons-io` can be removed from this module
##########
nifi-extension-bundles/nifi-protobuf-bundle/nifi-protobuf-services/src/test/java/org/apache/nifi/services/protobuf/TestProtobufReader.java:
##########
@@ -198,22 +202,21 @@ void testCreateRecordReaderWithRepeatedFields() throws
Exception {
@Test
void testValidationWithCircularReferenceProto() throws IOException {
- final Path testTempDir =
createTempDirWithProtoFile("test_circular_reference.proto");
+ createProtoFile("test_circular_reference.proto");
runner.setProperty(protobufReader, PROTOBUF_DIRECTORY,
testTempDir.toString());
runner.setProperty(protobufReader, MESSAGE_TYPE, "A");
final Collection<ValidationResult> results =
runner.validate(protobufReader);
assertTrue(results.stream().allMatch(ValidationResult::isValid));
}
- private Path createTempDirWithProtoFile(final String protoFileName) throws
IOException {
- final Path testTempDir = Files.createTempDirectory("proto-test-");
+ private void createProtoFile(final String protoFileName) throws
IOException {
+ Path protoFileNamePath = testTempDir.resolve(protoFileName);
Review Comment:
```suggestion
final Path protoFileNamePath = testTempDir.resolve(protoFileName);
```
##########
nifi-stateless/nifi-stateless-api/src/test/java/org/apache/nifi/stateless/config/PropertiesFileEngineConfigurationParserTest.java:
##########
@@ -43,16 +43,13 @@ public class PropertiesFileEngineConfigurationParserTest {
private static Path workingDirectory;
+ @TempDir
+ private static Path tmpDir;
Review Comment:
```suggestion
private static Path tempDir;
```
##########
nifi-stateless/nifi-stateless-api/src/test/java/org/apache/nifi/stateless/config/PropertiesFileEngineConfigurationParserTest.java:
##########
@@ -17,10 +17,10 @@
package org.apache.nifi.stateless.config;
import org.apache.nifi.stateless.engine.StatelessEngineConfiguration;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
import java.io.File;
Review Comment:
The `getPropertiesFile` should also use the tempDir
--
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]