exceptionfactory commented on code in PR #9565:
URL: https://github.com/apache/nifi/pull/9565#discussion_r1871621225
##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/manifest/StandardRuntimeManifestServiceTest.java:
##########
@@ -25,15 +25,22 @@
import org.apache.nifi.c2.protocol.component.api.RuntimeManifest;
import org.apache.nifi.extension.manifest.parser.ExtensionManifestParser;
import
org.apache.nifi.extension.manifest.parser.jaxb.JAXBExtensionManifestParser;
+import org.apache.nifi.nar.ExtensionDefinition;
+import org.apache.nifi.nar.ExtensionDefinition.ExtensionRuntime;
import org.apache.nifi.nar.ExtensionManager;
+import org.apache.nifi.nar.PythonBundle;
+import org.apache.nifi.processor.Processor;
+import org.apache.nifi.python.PythonProcessorDetails;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.mockito.internal.util.collections.Sets;
Review Comment:
Internal Mockito utility classes should never be used. It looks like this
can be replaced with `Set.of()`
##########
nifi-extension-bundles/nifi-py4j-extension-bundle/nifi-py4j-integration-tests/src/test/java/org.apache.nifi.py4j/PythonControllerInteractionIT.java:
##########
@@ -160,6 +161,7 @@ public void testGetProcessorDetails() {
.orElseThrow(() -> new RuntimeException("Could not find
ConvertCsvToExcel"));
assertEquals("0.0.1-SNAPSHOT",
convertCsvToExcel.getProcessorVersion());
+ assertEquals(Arrays.asList("csv", "excel"),
convertCsvToExcel.getTags());
Review Comment:
```suggestion
assertEquals(List.of("csv", "excel"), convertCsvToExcel.getTags());
```
##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/manifest/StandardRuntimeManifestServiceTest.java:
##########
@@ -105,6 +120,49 @@ public void testGetRuntimeManifest() {
assertEquals(1, controllerServiceDefinitions.size());
}
+ @Test
+ public void testGetPythonManifest() {
+ final String CLASS_NAME = "ClassName";
+ final List<String> EXPECTED_TAGS = Arrays.asList("tag1", "tag2");
+
+ when(extensionManager.getAllBundles()).thenReturn(emptySet());
+
when(extensionManager.getExtensions(Processor.class)).thenReturn(Sets.newSet(
Review Comment:
```suggestion
when(extensionManager.getExtensions(Processor.class)).thenReturn(Set.of(
```
##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/manifest/StandardRuntimeManifestServiceTest.java:
##########
@@ -105,6 +120,49 @@ public void testGetRuntimeManifest() {
assertEquals(1, controllerServiceDefinitions.size());
}
+ @Test
+ public void testGetPythonManifest() {
+ final String CLASS_NAME = "ClassName";
+ final List<String> EXPECTED_TAGS = Arrays.asList("tag1", "tag2");
Review Comment:
```suggestion
final List<String> EXPECTED_TAGS = List.of("tag1", "tag2");
```
--
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]