exceptionfactory commented on code in PR #10720:
URL: https://github.com/apache/nifi/pull/10720#discussion_r2656670994
##########
nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/test/java/org/apache/nifi/nar/AbstractTestNarLoader.java:
##########
@@ -53,15 +55,16 @@ public abstract class AbstractTestNarLoader {
@BeforeEach
public void setup() throws IOException, ClassNotFoundException {
- deleteDir(getWorkDir());
- deleteDir(getNarAutoloadDir());
-
- final File extensionsDir = new File(getNarAutoloadDir());
- assertTrue(extensionsDir.mkdirs());
+ Files.createDirectories(tempDir.resolve(getWorkDir()));
+ Files.createDirectories(tempDir.resolve(getNarAutoloadDir()));
// Create NiFiProperties
- final String propertiesFile = getPropertiesFile();
- properties = NiFiProperties.createBasicNiFiProperties(propertiesFile,
Collections.emptyMap());
+ final Path originalPropertiesFile = Paths.get(getPropertiesFile());
+ final String originalPropertiesFileContent =
Files.readString(originalPropertiesFile);
+ final String modifiedPropertiesFileContent =
originalPropertiesFileContent.replaceAll("\\./target", tempDir.toString());
Review Comment:
Instead of replacing `./target` in the properties file, it seems better to
remove the current property value and then explicit set the specific property
values needed.
--
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]