public void TestListDlpJobs() { var dlp = DlpServiceClient.Create(); var dlpJob = dlp.CreateDlpJob(Fixture.GetTestRiskAnalysisJobRequest()); TestRetryRobot.ShouldRetry = ex => true; TestRetryRobot.Eventually(() => { var response = JobsList.ListDlpJobs(Fixture.ProjectId, "state=DONE", "RiskAnalysisJob"); Assert.True(response.Any()); }); }
public void TestDeleteJob() { using var randomBucketFixture = new RandomBucketFixture(); using var bucketCollector = new BucketCollector(randomBucketFixture.BucketName); var bucketName = randomBucketFixture.BucketName; var fileName = Guid.NewGuid().ToString(); var objectName = $"gs://{bucketName}/{fileName}"; bucketCollector.CopyToBucket(Path.Combine(Fixture.ResourcePath, "dates-input.csv"), fileName); var job = JobsCreate.CreateJob(Fixture.ProjectId, objectName); JobsDelete.DeleteJob(job.Name); var activeJobs = JobsList.ListDlpJobs(Fixture.ProjectId, "state = RUNNING", DlpJobType.InspectJob); Assert.DoesNotContain(activeJobs, j => j.Name == job.Name); }
public void TestCreateDlpJob() { using var randomBucketFixture = new RandomBucketFixture(); using var bucketCollector = new BucketCollector(randomBucketFixture.BucketName); var bucketName = randomBucketFixture.BucketName; var fileName = Guid.NewGuid().ToString(); var objectName = $"gs://{bucketName}/{fileName}"; bucketCollector.CopyToBucket(Path.Combine(Fixture.ResourcePath, "dates-input.csv"), fileName); var job = JobsCreate.CreateJob(Fixture.ProjectId, objectName); TestRetryRobot.ShouldRetry = ex => true; TestRetryRobot.Eventually(() => { var response = JobsList.ListDlpJobs(Fixture.ProjectId, "state=DONE", "InspectJob"); Assert.True(response.Any()); }); }