weizhouapache commented on code in PR #13032:
URL: https://github.com/apache/cloudstack/pull/13032#discussion_r3334211968
##########
engine/orchestration/src/test/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestratorTest.java:
##########
@@ -1010,4 +1020,63 @@ public void testImportNicWithIP4Address() throws
Exception {
assertEquals("testtag", nicProfile.getName());
}
}
+
+ // -----------------------------------------------------------------------
+ // Tests for getNetworkElementsIncludingExtensions
+ // -----------------------------------------------------------------------
+
+ @Test
+ public void
getNetworkElementsIncludingExtensionsReturnsBaseListWhenNoExtensions() {
+
when(testOrchestrator.extensionHelper.listExtensionsByType(Extension.Type.NetworkOrchestrator))
+ .thenReturn(Collections.emptyList());
+
+ DhcpServiceProvider dhcpProvider = mock(DhcpServiceProvider.class);
+ List<NetworkElement> elements = new ArrayList<>(List.of(dhcpProvider));
+ testOrchestrator.networkElements = elements;
+
+ @SuppressWarnings("unchecked")
+ List<NetworkElement> result =
+ (List<NetworkElement>) ReflectionTestUtils
+ .invokeMethod(testOrchestrator,
"getNetworkElementsIncludingExtensions");
Review Comment:
make sense. changing to protected.
--
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]