test_class.declarator: azureConfiguration = new AzureConfiguration(
          "subscription-id", new AzureConfiguration.ServicePrincipal("tenant-id", "client-id",
          "client-secret", null))
test_class.modifier: public static final
test_class.original_string: public static final AzureConfiguration azureConfiguration = new AzureConfiguration(
          "subscription-id", new AzureConfiguration.ServicePrincipal("tenant-id", "client-id",
          "client-secret", null));
test_class.type: AzureConfiguration
test_class.var_name: azureConfiguration
test_class.declarator: nvaConfigurations = Arrays.asList(
          new NvaConfiguration("nva-1-probe-network-interface", 1234,
              Arrays.asList(
                  new NamedResourceId("nic1", "nva1-network-interface-id1"),
                  new NamedResourceId("nic2", "nva1-network-interface-id2"))
          ),
          new NvaConfiguration("nva-2-probe-network-interface", 1234,
              Arrays.asList(
                  new NamedResourceId("nic1", "nva2-network-interface-id1"),
                  new NamedResourceId("nic2", "nva2-network-interface-id2"))
          )
      )
test_class.modifier: public static final
test_class.original_string: public static final List<NvaConfiguration> nvaConfigurations = Arrays.asList(
          new NvaConfiguration("nva-1-probe-network-interface", 1234,
              Arrays.asList(
                  new NamedResourceId("nic1", "nva1-network-interface-id1"),
                  new NamedResourceId("nic2", "nva1-network-interface-id2"))
          ),
          new NvaConfiguration("nva-2-probe-network-interface", 1234,
              Arrays.asList(
                  new NamedResourceId("nic1", "nva2-network-interface-id1"),
                  new NamedResourceId("nic2", "nva2-network-interface-id2"))
          )
      );
test_class.type: List<NvaConfiguration>
test_class.var_name: nvaConfigurations
test_class.declarator: routeTables =
          Arrays.asList("route-table-id1", "route-table-id2", "route-table-id3")
test_class.modifier: public static final
test_class.original_string: public static final List<String> routeTables =
          Arrays.asList("route-table-id1", "route-table-id2", "route-table-id3");
test_class.type: List<String>
test_class.var_name: routeTables
test_class.declarator: publicIpAddresses =
          Arrays.asList(new NamedResourceId("nic1", "public-ip-address-id1"))
test_class.modifier: public static final
test_class.original_string: public static final List<NamedResourceId> publicIpAddresses =
          Arrays.asList(new NamedResourceId("nic1", "public-ip-address-id1"));
test_class.type: List<NamedResourceId>
test_class.var_name: publicIpAddresses
test_class.file: nvadaemon-azure/src/test/java/com/microsoft/azure/practices/nvadaemon/config/AzureProbeMonitorConfigurationTest.java
test_class.identifier: AzureProbeMonitorConfigurationTest
test_case.body: @Test
      void test_validate_invalid_route_table() throws ConfigurationException {
          AzureProbeMonitorConfiguration azureProbeMonitorConfiguration =
              new AzureProbeMonitorConfiguration(azureConfiguration,
                  nvaConfigurations, routeTables, publicIpAddresses,
                  null, null, null);
  
          AzureClient azureClient = mock(AzureClient.class);
          when(azureClient.checkExistenceById(contains("network-interface")))
              .thenReturn(true);
          when(azureClient.checkExistenceById(contains("public-ip-address")))
              .thenReturn(true);
          NetworkInterface networkInterface = mock(NetworkInterface.class);
          when(networkInterface.primaryPrivateIp())
              .thenReturn("127.0.0.1")
              .thenReturn("127.0.0.2");
          when(azureClient.getNetworkInterfaceById(anyString()))
              .thenReturn(networkInterface);
  
          Assertions.assertThrows(ConfigurationException.class,
              () -> azureProbeMonitorConfiguration.validate(azureClient));
      }
test_case.class_method_signature: AzureProbeMonitorConfigurationTest.test_validate_invalid_route_table()
test_case.full_signature: @Test void test_validate_invalid_route_table()
test_case.identifier: test_validate_invalid_route_table
test_case.invocations: mock thenReturn when checkExistenceById contains thenReturn when checkExistenceById contains mock thenReturn thenReturn when primaryPrivateIp thenReturn when getNetworkInterfaceById anyString assertThrows validate
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_validate_invalid_route_table()
focal_class.declarator: log = LoggerFactory.getLogger(AzureProbeMonitorConfiguration.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(AzureProbeMonitorConfiguration.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: DEFAULT_NUMBER_OF_FAILURES_THRESHOLD = 3
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_NUMBER_OF_FAILURES_THRESHOLD = 3;
focal_class.type: int
focal_class.var_name: DEFAULT_NUMBER_OF_FAILURES_THRESHOLD
focal_class.declarator: DEFAULT_PROBE_CONNECT_TIMEOUT = 10000
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_PROBE_CONNECT_TIMEOUT = 10000;
focal_class.type: int
focal_class.var_name: DEFAULT_PROBE_CONNECT_TIMEOUT
focal_class.declarator: DEFAULT_PROBE_POLLING_INTERVAL = 3000
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_PROBE_POLLING_INTERVAL = 3000;
focal_class.type: int
focal_class.var_name: DEFAULT_PROBE_POLLING_INTERVAL
focal_class.declarator: routeTables = new ArrayList<>()
focal_class.modifier: private
focal_class.original_string: private List<String> routeTables = new ArrayList<>();
focal_class.type: List<String>
focal_class.var_name: routeTables
focal_class.declarator: publicIpAddresses = new ArrayList<>()
focal_class.modifier: private
focal_class.original_string: private List<NamedResourceId> publicIpAddresses = new ArrayList<>();
focal_class.type: List<NamedResourceId>
focal_class.var_name: publicIpAddresses
focal_class.declarator: nvaConfigurations = new ArrayList<>()
focal_class.modifier: @JsonProperty("nvas")
      private
focal_class.original_string: @JsonProperty("nvas")
      private List<NvaConfiguration> nvaConfigurations = new ArrayList<>();
focal_class.type: List<NvaConfiguration>
focal_class.var_name: nvaConfigurations
focal_class.declarator: azureConfiguration
focal_class.modifier: @JsonProperty("azure")
      private
focal_class.original_string: @JsonProperty("azure")
      private AzureConfiguration azureConfiguration;
focal_class.type: AzureConfiguration
focal_class.var_name: azureConfiguration
focal_class.declarator: numberOfFailuresThreshold = DEFAULT_NUMBER_OF_FAILURES_THRESHOLD
focal_class.modifier: private
focal_class.original_string: private int numberOfFailuresThreshold = DEFAULT_NUMBER_OF_FAILURES_THRESHOLD;
focal_class.type: int
focal_class.var_name: numberOfFailuresThreshold
focal_class.declarator: probeConnectTimeout = DEFAULT_PROBE_CONNECT_TIMEOUT
focal_class.modifier: private
focal_class.original_string: private int probeConnectTimeout = DEFAULT_PROBE_CONNECT_TIMEOUT;
focal_class.type: int
focal_class.var_name: probeConnectTimeout
focal_class.declarator: probePollingInterval = DEFAULT_PROBE_POLLING_INTERVAL
focal_class.modifier: private
focal_class.original_string: private int probePollingInterval = DEFAULT_PROBE_POLLING_INTERVAL;
focal_class.type: int
focal_class.var_name: probePollingInterval
focal_class.file: nvadaemon-azure/src/main/java/com/microsoft/azure/practices/nvadaemon/config/AzureProbeMonitorConfiguration.java
focal_class.identifier: AzureProbeMonitorConfiguration
focal_class.interfaces: implements ConfigurationValidation
focal_class.class_method_signature: AzureProbeMonitorConfiguration.create(MonitorConfiguration monitorConfiguration)
focal_class.full_signature: public static AzureProbeMonitorConfiguration create(MonitorConfiguration monitorConfiguration)
focal_class.identifier: create
focal_class.modifiers: public static
focal_class.parameters: (MonitorConfiguration monitorConfiguration)
focal_class.return: AzureProbeMonitorConfiguration
focal_class.signature: AzureProbeMonitorConfiguration create(MonitorConfiguration monitorConfiguration)
focal_class.class_method_signature: AzureProbeMonitorConfiguration.AzureProbeMonitorConfiguration(@JsonProperty("azure")AzureConfiguration azureConfiguration,
                                            @JsonProperty("nvas")List<NvaConfiguration> nvaConfigurations,
                                            @JsonProperty("routeTables")List<String> routeTables,
                                            @JsonProperty("publicIpAddresses")List<NamedResourceId> publicIpAddresses,
                                            @JsonProperty("numberOfFailuresThreshold")Integer numberOfFailuresThreshold,
                                            @JsonProperty("probeConnectTimeout")Integer probeConnectTimeout,
                                            @JsonProperty("probePollingInterval")Integer probePollingInterval)
focal_class.full_signature: @JsonCreator public  AzureProbeMonitorConfiguration(@JsonProperty("azure")AzureConfiguration azureConfiguration,
                                            @JsonProperty("nvas")List<NvaConfiguration> nvaConfigurations,
                                            @JsonProperty("routeTables")List<String> routeTables,
                                            @JsonProperty("publicIpAddresses")List<NamedResourceId> publicIpAddresses,
                                            @JsonProperty("numberOfFailuresThreshold")Integer numberOfFailuresThreshold,
                                            @JsonProperty("probeConnectTimeout")Integer probeConnectTimeout,
                                            @JsonProperty("probePollingInterval")Integer probePollingInterval)
focal_class.identifier: AzureProbeMonitorConfiguration
focal_class.modifiers: @JsonCreator public
focal_class.parameters: (@JsonProperty("azure")AzureConfiguration azureConfiguration,
                                            @JsonProperty("nvas")List<NvaConfiguration> nvaConfigurations,
                                            @JsonProperty("routeTables")List<String> routeTables,
                                            @JsonProperty("publicIpAddresses")List<NamedResourceId> publicIpAddresses,
                                            @JsonProperty("numberOfFailuresThreshold")Integer numberOfFailuresThreshold,
                                            @JsonProperty("probeConnectTimeout")Integer probeConnectTimeout,
                                            @JsonProperty("probePollingInterval")Integer probePollingInterval)
focal_class.signature:  AzureProbeMonitorConfiguration(@JsonProperty("azure")AzureConfiguration azureConfiguration,
                                            @JsonProperty("nvas")List<NvaConfiguration> nvaConfigurations,
                                            @JsonProperty("routeTables")List<String> routeTables,
                                            @JsonProperty("publicIpAddresses")List<NamedResourceId> publicIpAddresses,
                                            @JsonProperty("numberOfFailuresThreshold")Integer numberOfFailuresThreshold,
                                            @JsonProperty("probeConnectTimeout")Integer probeConnectTimeout,
                                            @JsonProperty("probePollingInterval")Integer probePollingInterval)
focal_class.class_method_signature: AzureProbeMonitorConfiguration.getAzureConfiguration()
focal_class.full_signature: public AzureConfiguration getAzureConfiguration()
focal_class.identifier: getAzureConfiguration
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: AzureConfiguration
focal_class.signature: AzureConfiguration getAzureConfiguration()
focal_class.class_method_signature: AzureProbeMonitorConfiguration.getProbeConnectTimeout()
focal_class.full_signature: public int getProbeConnectTimeout()
focal_class.identifier: getProbeConnectTimeout
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getProbeConnectTimeout()
focal_class.class_method_signature: AzureProbeMonitorConfiguration.getProbePollingInterval()
focal_class.full_signature: public int getProbePollingInterval()
focal_class.identifier: getProbePollingInterval
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getProbePollingInterval()
focal_class.class_method_signature: AzureProbeMonitorConfiguration.getNumberOfFailuresThreshold()
focal_class.full_signature: public int getNumberOfFailuresThreshold()
focal_class.identifier: getNumberOfFailuresThreshold
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNumberOfFailuresThreshold()
focal_class.class_method_signature: AzureProbeMonitorConfiguration.getRouteTables()
focal_class.full_signature: public List<String> getRouteTables()
focal_class.identifier: getRouteTables
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> getRouteTables()
focal_class.class_method_signature: AzureProbeMonitorConfiguration.getPublicIpAddresses()
focal_class.full_signature: public List<NamedResourceId> getPublicIpAddresses()
focal_class.identifier: getPublicIpAddresses
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<NamedResourceId>
focal_class.signature: List<NamedResourceId> getPublicIpAddresses()
focal_class.class_method_signature: AzureProbeMonitorConfiguration.getNvaConfigurations()
focal_class.full_signature: public List<NvaConfiguration> getNvaConfigurations()
focal_class.identifier: getNvaConfigurations
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<NvaConfiguration>
focal_class.signature: List<NvaConfiguration> getNvaConfigurations()
focal_class.class_method_signature: AzureProbeMonitorConfiguration.validate(AzureClient azureClient)
focal_class.full_signature: public void validate(AzureClient azureClient)
focal_class.identifier: validate
focal_class.modifiers: public
focal_class.parameters: (AzureClient azureClient)
focal_class.return: void
focal_class.signature: void validate(AzureClient azureClient)
focal_method.body: public void validate(AzureClient azureClient) throws ConfigurationException {
          Preconditions.checkNotNull(azureClient, "azureClient cannot be null");
  
          for (NvaConfiguration config : this.nvaConfigurations) {
              config.validate(azureClient);
          }
  
          if (this.nvaConfigurations.stream()
              .map(c -> ((InetSocketAddress)c.getProbeSocketAddress()).getHostName())
              .distinct()
              .count() != this.nvaConfigurations.size()) {
              throw new ConfigurationException("Duplicate probe IP Address found");
          }
  
          List<String> invalidPublicIpAddresses = this.publicIpAddresses.stream()
              .map(r -> r.getId())
              .filter(id -> !azureClient.checkExistenceById(id))
              .collect(Collectors.toList());
          if (invalidPublicIpAddresses.size() > 0) {
              throw new ConfigurationException("Invalid public ip address(es): " +
                  invalidPublicIpAddresses.stream().collect(Collectors.joining(", ")));
          }
  
          List<String> invalidRouteTables = this.routeTables.stream()
              .filter(id -> !azureClient.checkExistenceById(id))
              .collect(Collectors.toList());
  
          if (invalidRouteTables.size() > 0) {
              throw new ConfigurationException("Invalid route table(s): " +
              invalidRouteTables.stream().collect(Collectors.joining(", ")));
          }
      }
focal_method.class_method_signature: AzureProbeMonitorConfiguration.validate(AzureClient azureClient)
focal_method.full_signature: public void validate(AzureClient azureClient)
focal_method.identifier: validate
focal_method.invocations: checkNotNull validate count distinct map stream getHostName getProbeSocketAddress size collect filter map stream getId checkExistenceById toList size collect stream joining collect filter stream checkExistenceById toList size collect stream joining
focal_method.modifiers: public
focal_method.parameters: (AzureClient azureClient)
focal_method.return: void
focal_method.signature: void validate(AzureClient azureClient)