test_class.declarator: dao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ManagementServerHostDao dao;
test_class.type: ManagementServerHostDao
test_class.var_name: dao
test_class.file: cosmic-core/server/src/test/java/com/cloud/managementserver/ManagementServerServiceTest.java
test_class.identifier: ManagementServerServiceTest
test_case.body: @Test
      public void discoverManagementServerIps_whenBothIpsArePublic() throws Exception {
          PowerMockito.mockStatic(AddressUtils.class);
          given(AddressUtils.isPublicAddress("server1Ip")).willReturn(true);
          given(AddressUtils.isPublicAddress("server2Ip")).willReturn(true);
  
          final Date now = new Date();
          when(dao.listAll()).thenReturn(Arrays.asList(new ManagementServerHostVO(1l, 1l, "server1Ip", 1, now), new ManagementServerHostVO(2l, 2l, "server2Ip", 2, now)));
  
          final Collection<String> ips = new ManagementServerService(dao).discoverManagementServerIps().collect(toList());
  
          assertThat(ips, notNullValue());
          assertThat(ips, hasSize(2));
          assertThat(ips, containsInAnyOrder("server1Ip", "server2Ip"));
      }
test_case.class_method_signature: ManagementServerServiceTest.discoverManagementServerIps_whenBothIpsArePublic()
test_case.full_signature: @Test public void discoverManagementServerIps_whenBothIpsArePublic()
test_case.identifier: discoverManagementServerIps_whenBothIpsArePublic
test_case.invocations: mockStatic willReturn given isPublicAddress willReturn given isPublicAddress thenReturn when listAll asList collect discoverManagementServerIps toList assertThat notNullValue assertThat hasSize assertThat containsInAnyOrder
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void discoverManagementServerIps_whenBothIpsArePublic()
focal_class.declarator: logger = LoggerFactory.getLogger(ManagementServerService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ManagementServerService.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: managementServerHostDao
focal_class.modifier: private final
focal_class.original_string: private final ManagementServerHostDao managementServerHostDao;
focal_class.type: ManagementServerHostDao
focal_class.var_name: managementServerHostDao
focal_class.file: cosmic-core/server/src/main/java/com/cloud/managementserver/ManagementServerService.java
focal_class.identifier: ManagementServerService
focal_class.class_method_signature: ManagementServerService.ManagementServerService(final ManagementServerHostDao managementServerHostDao)
focal_class.full_signature: @Autowired public  ManagementServerService(final ManagementServerHostDao managementServerHostDao)
focal_class.identifier: ManagementServerService
focal_class.modifiers: @Autowired public
focal_class.parameters: (final ManagementServerHostDao managementServerHostDao)
focal_class.signature:  ManagementServerService(final ManagementServerHostDao managementServerHostDao)
focal_class.class_method_signature: ManagementServerService.discoverManagementServerIps()
focal_class.full_signature: public Stream<String> discoverManagementServerIps()
focal_class.identifier: discoverManagementServerIps
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Stream<String>
focal_class.signature: Stream<String> discoverManagementServerIps()
focal_class.class_method_signature: ManagementServerService.getServerPublicIp()
focal_class.full_signature: protected Function<ManagementServerHostVO, String> getServerPublicIp()
focal_class.identifier: getServerPublicIp
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Function<ManagementServerHostVO, String>
focal_class.signature: Function<ManagementServerHostVO, String> getServerPublicIp()
focal_class.class_method_signature: ManagementServerService.isAddressUsableForAgents(final ManagementServerHostVO managementServerHostVO, final String serviceIP)
focal_class.full_signature: private boolean isAddressUsableForAgents(final ManagementServerHostVO managementServerHostVO, final String serviceIP)
focal_class.identifier: isAddressUsableForAgents
focal_class.modifiers: private
focal_class.parameters: (final ManagementServerHostVO managementServerHostVO, final String serviceIP)
focal_class.return: boolean
focal_class.signature: boolean isAddressUsableForAgents(final ManagementServerHostVO managementServerHostVO, final String serviceIP)
focal_class.class_method_signature: ManagementServerService.logUnresolvableHostname(final ManagementServerHostVO managementServerHostVO, final UnknownHostException e)
focal_class.full_signature: private void logUnresolvableHostname(final ManagementServerHostVO managementServerHostVO, final UnknownHostException e)
focal_class.identifier: logUnresolvableHostname
focal_class.modifiers: private
focal_class.parameters: (final ManagementServerHostVO managementServerHostVO, final UnknownHostException e)
focal_class.return: void
focal_class.signature: void logUnresolvableHostname(final ManagementServerHostVO managementServerHostVO, final UnknownHostException e)
focal_class.class_method_signature: ManagementServerService.discoverManagementServers()
focal_class.full_signature: private Collection<ManagementServerHostVO> discoverManagementServers()
focal_class.identifier: discoverManagementServers
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Collection<ManagementServerHostVO>
focal_class.signature: Collection<ManagementServerHostVO> discoverManagementServers()
focal_method.body: public Stream<String> discoverManagementServerIps() {
          return discoverManagementServers().stream().map(getServerPublicIp()).distinct();
      }
focal_method.class_method_signature: ManagementServerService.discoverManagementServerIps()
focal_method.full_signature: public Stream<String> discoverManagementServerIps()
focal_method.identifier: discoverManagementServerIps
focal_method.invocations: distinct map stream discoverManagementServers getServerPublicIp
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Stream<String>
focal_method.signature: Stream<String> discoverManagementServerIps()