@Test
  public void testScanConfigList() throws IOException {
    // try to get the list of scan configs - it must fail
    WebSecurityScannerSettings wssSetting = getWssSettingWithCredentials();
    final String formattedParent = ProjectName.format(OUT_VPCSC_PROJECT);
    try (WebSecurityScannerClient wssClient = WebSecurityScannerClient.create(wssSetting)) {
      ListScanConfigsRequest lscRequest =
          ListScanConfigsRequest.newBuilder().setParent(formattedParent).build();
      ListScanConfigsPagedResponse scanConfigsList = wssClient.listScanConfigs(lscRequest);
      fail("Exception must occur for non-acceessible project scan-configs");
    } catch (PermissionDeniedException expected) {
    }
  }
Negative Integration tests for VPC-SC.
java-websecurityscanner/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/it/v1beta/VPCServiceControlNegativeTest.java