exceptionfactory commented on code in PR #9490:
URL: https://github.com/apache/nifi/pull/9490#discussion_r1830265224
##########
nifi-bootstrap/src/test/java/org/apache/nifi/bootstrap/configuration/StandardConfigurationProviderTest.java:
##########
@@ -117,6 +120,34 @@ void testGetManagementServerAddress(@TempDir final Path
applicationHomeDirectory
assertEquals(MANAGEMENT_SERVER_ADDRESS, address.toString());
}
+ @Test
+ void testGetAdditionalArguments(@TempDir final Path
applicationHomeDirectory) throws IOException {
+ final Path bootstrapConfiguration =
setRequiredConfiguration(applicationHomeDirectory);
+ // Properties in random order and containing some java.arg and some
NOT java.arg arguments.
+ List<String> propertyNames = new ArrayList<>(
+ Arrays.asList("java.arg9", "java.arg2", "java.arg.my2",
"non.java.arg.2", "java.arg1", "java.arg.memory", "java.arg", "java.arg.my1",
"non.java.arg.3", "random.nothing"));
+ // The expected returned list of java.arg properties sorted in
ascending alphabetical order.
+ List<String> expectedArguments = new ArrayList<>(
+ Arrays.asList("java.arg", "java.arg.memory", "java.arg.my1",
"java.arg.my2", "java.arg1", "java.arg2", "java.arg9"));
Review Comment:
```suggestion
final List<String> expectedArguments = List.of("java.arg",
"java.arg.memory", "java.arg.my1", "java.arg.my2", "java.arg1", "java.arg2",
"java.arg9");
```
##########
nifi-bootstrap/src/test/java/org/apache/nifi/bootstrap/configuration/StandardConfigurationProviderTest.java:
##########
@@ -117,6 +120,34 @@ void testGetManagementServerAddress(@TempDir final Path
applicationHomeDirectory
assertEquals(MANAGEMENT_SERVER_ADDRESS, address.toString());
}
+ @Test
+ void testGetAdditionalArguments(@TempDir final Path
applicationHomeDirectory) throws IOException {
+ final Path bootstrapConfiguration =
setRequiredConfiguration(applicationHomeDirectory);
+ // Properties in random order and containing some java.arg and some
NOT java.arg arguments.
+ List<String> propertyNames = new ArrayList<>(
+ Arrays.asList("java.arg9", "java.arg2", "java.arg.my2",
"non.java.arg.2", "java.arg1", "java.arg.memory", "java.arg", "java.arg.my1",
"non.java.arg.3", "random.nothing"));
+ // The expected returned list of java.arg properties sorted in
ascending alphabetical order.
+ List<String> expectedArguments = new ArrayList<>(
+ Arrays.asList("java.arg", "java.arg.memory", "java.arg.my1",
"java.arg.my2", "java.arg1", "java.arg2", "java.arg9"));
+
+ final Properties bootstrapProperties = new Properties();
+ for (String propertyName : propertyNames) {
+ bootstrapProperties.put(propertyName, propertyName + ".value");
Review Comment:
Recommend either removing the `.value` addition, or defining a variable and
reusing it here and below to ensure the same suffix is applied.
##########
nifi-bootstrap/src/test/java/org/apache/nifi/bootstrap/configuration/StandardConfigurationProviderTest.java:
##########
@@ -117,6 +120,34 @@ void testGetManagementServerAddress(@TempDir final Path
applicationHomeDirectory
assertEquals(MANAGEMENT_SERVER_ADDRESS, address.toString());
}
+ @Test
+ void testGetAdditionalArguments(@TempDir final Path
applicationHomeDirectory) throws IOException {
+ final Path bootstrapConfiguration =
setRequiredConfiguration(applicationHomeDirectory);
+ // Properties in random order and containing some java.arg and some
NOT java.arg arguments.
+ List<String> propertyNames = new ArrayList<>(
+ Arrays.asList("java.arg9", "java.arg2", "java.arg.my2",
"non.java.arg.2", "java.arg1", "java.arg.memory", "java.arg", "java.arg.my1",
"non.java.arg.3", "random.nothing"));
Review Comment:
```suggestion
final List<String> propertyNames = List.of("java.arg9", "java.arg2",
"java.arg.my2", "non.java.arg.2", "java.arg1", "java.arg.memory", "java.arg",
"java.arg.my1", "non.java.arg.3", "random.nothing");
```
--
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]