test_class.file: nvadaemon-azure/src/test/java/com/microsoft/azure/practices/nvadaemon/config/NvaConfigurationTest.java
test_class.identifier: NvaConfigurationTest
test_case.body: @Test
      void test_validate_invalid_probe_network_interfaces() {
          AzureClient azureClient = mock(AzureClient.class);
          List<NamedResourceId> networkInterfaces = new ArrayList<>();
          networkInterfaces.add(new NamedResourceId("nic1", "nic1-id"));
          NvaConfiguration nvaConfiguration = new NvaConfiguration("probe-network-interface",
              1234, networkInterfaces);
          when(azureClient.checkExistenceById(anyString()))
              .thenReturn(true);
          when(azureClient.getNetworkInterfaceById(anyString()))
              .thenReturn(null);
          Assertions.assertThrows(ConfigurationException.class,
              () -> nvaConfiguration.validate(azureClient));
      }
test_case.class_method_signature: NvaConfigurationTest.test_validate_invalid_probe_network_interfaces()
test_case.full_signature: @Test void test_validate_invalid_probe_network_interfaces()
test_case.identifier: test_validate_invalid_probe_network_interfaces
test_case.invocations: mock add thenReturn when checkExistenceById anyString thenReturn when getNetworkInterfaceById anyString assertThrows validate
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_validate_invalid_probe_network_interfaces()
focal_class.declarator: probeNetworkInterface
focal_class.modifier: private
focal_class.original_string: private String probeNetworkInterface;
focal_class.type: String
focal_class.var_name: probeNetworkInterface
focal_class.declarator: probePort
focal_class.modifier: private
focal_class.original_string: private int probePort;
focal_class.type: int
focal_class.var_name: probePort
focal_class.declarator: networkInterfaces = new ArrayList<>()
focal_class.modifier: private
focal_class.original_string: private List<NamedResourceId> networkInterfaces = new ArrayList<>();
focal_class.type: List<NamedResourceId>
focal_class.var_name: networkInterfaces
focal_class.declarator: probeSocketAddress
focal_class.modifier: @JsonIgnore
      private
focal_class.original_string: @JsonIgnore
      private SocketAddress probeSocketAddress;
focal_class.type: SocketAddress
focal_class.var_name: probeSocketAddress
focal_class.file: nvadaemon-azure/src/main/java/com/microsoft/azure/practices/nvadaemon/config/NvaConfiguration.java
focal_class.identifier: NvaConfiguration
focal_class.interfaces: implements ConfigurationValidation
focal_class.class_method_signature: NvaConfiguration.NvaConfiguration(@JsonProperty("probeNetworkInterface")String probeNetworkInterface,
                              @JsonProperty("probePort")Integer probePort,
                              @JsonProperty("networkInterfaces")List<NamedResourceId> networkInterfaces)
focal_class.full_signature: @JsonCreator public  NvaConfiguration(@JsonProperty("probeNetworkInterface")String probeNetworkInterface,
                              @JsonProperty("probePort")Integer probePort,
                              @JsonProperty("networkInterfaces")List<NamedResourceId> networkInterfaces)
focal_class.identifier: NvaConfiguration
focal_class.modifiers: @JsonCreator public
focal_class.parameters: (@JsonProperty("probeNetworkInterface")String probeNetworkInterface,
                              @JsonProperty("probePort")Integer probePort,
                              @JsonProperty("networkInterfaces")List<NamedResourceId> networkInterfaces)
focal_class.signature:  NvaConfiguration(@JsonProperty("probeNetworkInterface")String probeNetworkInterface,
                              @JsonProperty("probePort")Integer probePort,
                              @JsonProperty("networkInterfaces")List<NamedResourceId> networkInterfaces)
focal_class.class_method_signature: NvaConfiguration.getProbeSocketAddress()
focal_class.full_signature: @JsonIgnore public SocketAddress getProbeSocketAddress()
focal_class.identifier: getProbeSocketAddress
focal_class.modifiers: @JsonIgnore public
focal_class.parameters: ()
focal_class.return: SocketAddress
focal_class.signature: SocketAddress getProbeSocketAddress()
focal_class.class_method_signature: NvaConfiguration.getNetworkInterfaces()
focal_class.full_signature: public List<NamedResourceId> getNetworkInterfaces()
focal_class.identifier: getNetworkInterfaces
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<NamedResourceId>
focal_class.signature: List<NamedResourceId> getNetworkInterfaces()
focal_class.class_method_signature: NvaConfiguration.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");
  
          List<String> invalidNetworkInterfaces = this.networkInterfaces.stream()
              .map(r -> r.getId())
              .filter(id -> !azureClient.checkExistenceById(id))
              .collect(Collectors.toList());
          if (invalidNetworkInterfaces.size() > 0) {
              throw new ConfigurationException("Invalid network interface(s): " +
                  invalidNetworkInterfaces.stream().collect(Collectors.joining(", ")));
          }
  
          // Get the probe network interface and save the private ip
          NetworkInterface probeNetworkInterface =
              azureClient.getNetworkInterfaceById(this.probeNetworkInterface);
          if (probeNetworkInterface == null) {
              throw new ConfigurationException("probeNetworkInterface '" +
                  this.probeNetworkInterface + "' does not exist");
          }
  
          this.probeSocketAddress = new InetSocketAddress(probeNetworkInterface.primaryPrivateIp(),
              this.probePort);
      }
focal_method.class_method_signature: NvaConfiguration.validate(AzureClient azureClient)
focal_method.full_signature: public void validate(AzureClient azureClient)
focal_method.identifier: validate
focal_method.invocations: checkNotNull collect filter map stream getId checkExistenceById toList size collect stream joining getNetworkInterfaceById primaryPrivateIp
focal_method.modifiers: public
focal_method.parameters: (AzureClient azureClient)
focal_method.return: void
focal_method.signature: void validate(AzureClient azureClient)