Skip to content

Commit

Permalink
Merge pull request #728 from akto-api-security/feature/configure_cicd…
Browse files Browse the repository at this point in the history
…_action

fix id
  • Loading branch information
ankush-jain-akto authored Nov 20, 2023
2 parents 208fc9b + eb5cfe7 commit 4837c85
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@
import org.bson.conversions.Bson;
import org.bson.types.ObjectId;

import java.util.HashMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;

public class StartTestAction extends UserAction {
Expand Down Expand Up @@ -139,7 +133,8 @@ private TestingRun createTestingRun(int scheduleTimestamp, int periodInSeconds)
return null;
}
if (this.selectedTests != null) {
TestingRunConfig testingRunConfig = new TestingRunConfig(Context.now(), null, this.selectedTests,authMechanism.getId(), this.overriddenTestAppUrl);
int id = UUID.randomUUID().hashCode();
TestingRunConfig testingRunConfig = new TestingRunConfig(id, null, this.selectedTests,authMechanism.getId(), this.overriddenTestAppUrl);
this.testIdConfig = testingRunConfig.getId();
TestingRunConfigDao.instance.insertOne(testingRunConfig);
}
Expand Down Expand Up @@ -193,9 +188,12 @@ public String startTest() {
Updates.set(TestingRun.SCHEDULE_TIMESTAMP,scheduleTimestamp)
));

TestingRunConfig testingRunConfig = new TestingRunConfig(Context.now(), null, this.selectedTests, null, this.overriddenTestAppUrl);
this.testIdConfig = testingRunConfig.getId();
TestingRunConfigDao.instance.insertOne(testingRunConfig);
if (this.overriddenTestAppUrl != null || this.selectedTests != null) {
int id = UUID.randomUUID().hashCode();
TestingRunConfig testingRunConfig = new TestingRunConfig(id, null, this.selectedTests, null, this.overriddenTestAppUrl);
this.testIdConfig = testingRunConfig.getId();
TestingRunConfigDao.instance.insertOne(testingRunConfig);
}

}

Expand Down

0 comments on commit 4837c85

Please sign in to comment.