diff --git a/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java b/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java index eab2fa6ddd..500456adb6 100644 --- a/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java +++ b/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java @@ -1,15 +1,20 @@ package com.akto.action.testing; +import com.akto.DaoInit; +import com.akto.action.ExportSampleDataAction; import com.akto.action.AccountAction; import com.akto.action.UserAction; import com.akto.dao.RBACDao; +import com.akto.dao.AccountsDao; import com.akto.dao.context.Context; import com.akto.dao.test_editor.YamlTemplateDao; import com.akto.dao.testing.sources.TestSourceConfigsDao; import com.akto.dao.testing_run_findings.TestingRunIssuesDao; import com.akto.dao.testing.*; +import com.akto.dto.Account; import com.akto.dto.testing.config.EditableTestingRunConfig; import com.akto.dto.ApiInfo; +import com.akto.dto.MiniTestingServiceHeartbeat; import com.akto.dto.User; import com.akto.dto.ApiToken.Utility; import com.akto.dto.RBAC; @@ -28,11 +33,13 @@ import com.akto.log.LoggerMaker.LogDb; import com.akto.util.Constants; import com.akto.util.DashboardMode; +import com.akto.util.Pair; import com.akto.util.enums.GlobalEnums; import com.akto.util.enums.GlobalEnums.TestErrorSource; import com.akto.utils.DeleteTestRunUtils; import com.akto.utils.Utils; import com.google.gson.Gson; +import com.mongodb.ConnectionString; import com.mongodb.client.model.*; import com.mongodb.client.result.InsertOneResult; import com.opensymphony.xwork2.Action; @@ -114,7 +121,7 @@ private static List getTestsWithSeverity(List severities) { private boolean sendSlackAlert = false; private boolean sendMsTeamsAlert = false; - private TestingRun createTestingRun(int scheduleTimestamp, int periodInSeconds) { + private TestingRun createTestingRun(int scheduleTimestamp, int periodInSeconds, String miniTestingServiceName) { User user = getSUser(); if (!StringUtils.isEmpty(this.overriddenTestAppUrl)) { @@ -170,9 +177,10 @@ private TestingRun createTestingRun(int scheduleTimestamp, int periodInSeconds) return new TestingRun(scheduleTimestamp, user.getLogin(), testingEndpoints, testIdConfig, State.SCHEDULED, periodInSeconds, testName, this.testRunTime, - this.maxConcurrentRequests, this.sendSlackAlert, this.sendMsTeamsAlert); + this.maxConcurrentRequests, this.sendSlackAlert, this.sendMsTeamsAlert, miniTestingServiceName); } + String selectedMiniTestingServiceName; private List selectedTests; private List testConfigsAdvancedSettings; @@ -213,7 +221,7 @@ public String startTest() { } if (localTestingRun == null) { try { - localTestingRun = createTestingRun(scheduleTimestamp, this.recurringDaily ? 86400 : 0); + localTestingRun = createTestingRun(scheduleTimestamp, this.recurringDaily ? 86400 : 0, selectedMiniTestingServiceName); // pass boolean from ui, which will tell if testing is coniinuous on new endpoints if (this.continuousTesting) { localTestingRun.setPeriodInSeconds(-1); @@ -252,7 +260,7 @@ public String startTest() { Updates.set(TestingRun.STATE, TestingRun.State.COMPLETED), Updates.set(TestingRun.END_TIMESTAMP, Context.now()))); } - + } if (this.overriddenTestAppUrl != null || this.selectedTests != null) { @@ -260,7 +268,7 @@ public String startTest() { TestingRunConfig testingRunConfig = new TestingRunConfig(id, null, this.selectedTests, null, this.overriddenTestAppUrl, this.testRoleId); this.testIdConfig = testingRunConfig.getId(); TestingRunConfigDao.instance.insertOne(testingRunConfig); - } + } } @@ -654,7 +662,7 @@ public String fetchTestRunResultsCount() { return ERROR.toUpperCase(); } - + int accountId = Context.accountId.get(); testCountMap = new HashMap<>(); @@ -681,9 +689,9 @@ public String fetchTestRunResultsCount() { } catch (Exception e) { e.printStackTrace(); } - + } - + } catch (Exception e) { e.printStackTrace(); return ERROR.toUpperCase(); @@ -816,9 +824,9 @@ public String fetchVulnerableTestRunResults() { }else{ testingRunResultList = TestingRunResultDao.instance.findAll(filters, skip, 50, null); } - - + + // Map sampleDataVsCurlMap = new HashMap<>(); // for (TestingRunResult runResult: testingRunResultList) { // WorkflowTest workflowTest = runResult.getWorkflowTest(); @@ -1171,31 +1179,31 @@ public String modifyTestingRunConfig(){ if (editableTestingRunConfig.getConfigsAdvancedSettings() != null && !editableTestingRunConfig.getConfigsAdvancedSettings().equals(existingTestingRunConfig.getConfigsAdvancedSettings())) { updates.add(Updates.set(TestingRunConfig.TEST_CONFIGS_ADVANCED_SETTINGS, editableTestingRunConfig.getConfigsAdvancedSettings())); } - + if (editableTestingRunConfig.getTestSubCategoryList() != null && !editableTestingRunConfig.getTestSubCategoryList().equals(existingTestingRunConfig.getTestSubCategoryList())) { updates.add(Updates.set(TestingRunConfig.TEST_SUBCATEGORY_LIST, editableTestingRunConfig.getTestSubCategoryList())); } - + if (editableTestingRunConfig.getTestRoleId() != null && !editableTestingRunConfig.getTestRoleId().equals(existingTestingRunConfig.getTestRoleId())) { updates.add(Updates.set(TestingRunConfig.TEST_ROLE_ID, editableTestingRunConfig.getTestRoleId())); } - + if (editableTestingRunConfig.getOverriddenTestAppUrl() != null && !editableTestingRunConfig.getOverriddenTestAppUrl().equals(existingTestingRunConfig.getOverriddenTestAppUrl())) { updates.add(Updates.set(TestingRunConfig.OVERRIDDEN_TEST_APP_URL, editableTestingRunConfig.getOverriddenTestAppUrl())); } - + if (!updates.isEmpty()) { TestingRunConfigDao.instance.updateOne( Filters.eq(Constants.ID, this.testingRunConfigId), - Updates.combine(updates) + Updates.combine(updates) ); } } if (editableTestingRunConfig.getTestingRunHexId() != null) { - + TestingRun existingTestingRun = TestingRunDao.instance.findOne(Filters.eq(Constants.ID, new ObjectId(editableTestingRunConfig.getTestingRunHexId()))); if (existingTestingRun != null) { @@ -1234,15 +1242,15 @@ public String modifyTestingRunConfig(){ if (existingTestingRun.getPeriodInSeconds() != periodInSeconds) { updates.add(Updates.set(TestingRun.PERIOD_IN_SECONDS, periodInSeconds)); } - + if (!updates.isEmpty()) { TestingRunDao.instance.updateOne( Filters.eq(Constants.ID,new ObjectId(editableTestingRunConfig.getTestingRunHexId())), - Updates.combine(updates) + Updates.combine(updates) ); } } - + } @@ -1327,7 +1335,7 @@ public void run() { Updates.set(TestingRunResult.IS_IGNORED_RESULT, true) ); } - + } catch (Exception e) { e.printStackTrace(); } @@ -1337,6 +1345,32 @@ public void run() { return SUCCESS.toUpperCase(); } + private Set miniTestingServiceNames; + private boolean isHybridTestingEnabled; + public String fetchMiniTestingServiceNames() { + int accountId = Context.accountId.get(); + Account account = AccountsDao.instance.findOne(Filters.eq("_id", accountId), Projections.include(Account.HYBRID_TESTING_ENABLED, Account.MINI_TESTING_HEARTBEAT)); + if(account == null || !account.getHybridTestingEnabled() || account.getMiniTestingHeartbeat() == null) { + return SUCCESS.toUpperCase(); + } + + List miniTestingHeartbeats = account.getMiniTestingHeartbeat(); + isHybridTestingEnabled = account.getHybridTestingEnabled(); + + miniTestingServiceNames = new HashSet<>(); + + for(MiniTestingServiceHeartbeat miniTestingHeartbeat : miniTestingHeartbeats) { + String miniTestingServiceName = miniTestingHeartbeat.getMiniTestingServiceName(); + int miniTestingLastHeartbeat = miniTestingHeartbeat.getLastHeartbeatTimestamp(); + + if(Math.abs(Context.now() - miniTestingLastHeartbeat) <= 300) { + miniTestingServiceNames.add(miniTestingServiceName); + } + } + + return SUCCESS.toUpperCase(); + } + public void setType(TestingEndpoints.Type type) { this.type = type; @@ -1719,4 +1753,24 @@ public boolean getSendMsTeamsAlert() { public void setSendMsTeamsAlert(boolean sendMsTeamsAlert) { this.sendMsTeamsAlert = sendMsTeamsAlert; } + + public Set getMiniTestingServiceNames() { + return miniTestingServiceNames; + } + + public void setMiniTestingServiceNames(Set miniTestingServiceNames) { + this.miniTestingServiceNames = miniTestingServiceNames; + } + + public boolean getIsHybridTestingEnabled() { + return isHybridTestingEnabled; + } + + public void setIsHybridTestingEnabled(boolean isHybridTestingEnabled) { + this.isHybridTestingEnabled = isHybridTestingEnabled; + } + + public void setSelectedMiniTestingServiceName(String selectedMiniTestingServiceName) { + this.selectedMiniTestingServiceName = selectedMiniTestingServiceName; + } } diff --git a/apps/dashboard/src/main/resources/struts.xml b/apps/dashboard/src/main/resources/struts.xml index 96d884ce72..708b910442 100644 --- a/apps/dashboard/src/main/resources/struts.xml +++ b/apps/dashboard/src/main/resources/struts.xml @@ -8126,6 +8126,27 @@ + + + + + TEST_RESULTS + READ + + + + 403 + false + ^actionErrors.* + + + + 422 + false + ^actionErrors.* + + + \ No newline at end of file diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api.js index 83d6f0182a..1f1c795af6 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api.js @@ -573,20 +573,20 @@ export default { data: {} }) }, - scheduleTestForCollection(apiCollectionId, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources) { + scheduleTestForCollection(apiCollectionId, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources, selectedMiniTestingServiceName) { return request({ url: '/api/startTest', method: 'post', - data: { apiCollectionId, type: "COLLECTION_WISE", startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources} + data: { apiCollectionId, type: "COLLECTION_WISE", startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources, selectedMiniTestingServiceName} }).then((resp) => { return resp }) }, - scheduleTestForCustomEndpoints(apiInfoKeyList, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, source, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources) { + scheduleTestForCustomEndpoints(apiInfoKeyList, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, source, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources, selectedMiniTestingServiceName) { return request({ url: '/api/startTest', method: 'post', - data: {apiInfoKeyList, type: "CUSTOM", startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, source, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources} + data: {apiInfoKeyList, type: "CUSTOM", startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, source, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, testConfigsAdvancedSettings, cleanUpTestingResources, selectedMiniTestingServiceName} }).then((resp) => { return resp }) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTest.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTest.jsx index 9cd30ad6ea..e6ff58c4b0 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTest.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTest.jsx @@ -39,7 +39,8 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu testRoleId: "", sendSlackAlert: false, sendMsTeamsAlert: false, - cleanUpTestingResources: false + cleanUpTestingResources: false, + miniTestingServiceName: "" } const navigate = useNavigate() @@ -73,6 +74,9 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu const [slackIntegrated, setSlackIntegrated] = useState(false) const [teamsTestingWebhookIntegrated, setTeamsTestingWebhookIntegrated] = useState(false) + const [miniTestingServiceNames, setMiniTestingServiceNames] = useState([]) + const [isHybridTestingEnabled, setIsHybridTestingEnabled] = useState(false) + const emptyCondition = { data: { key: '', value: '' }, operator: { 'type': 'ADD_HEADER' } } const [conditions, dispatchConditions] = useReducer(produce((draft, action) => func.conditionsReducer(draft, action)), []); @@ -158,6 +162,17 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu const authMechanismDataResponse = await testingApi.fetchAuthMechanismData() if (authMechanismDataResponse.authMechanism) authMechanismPresent = true + testingApi.fetchMiniTestingServiceNames().then(({miniTestingServiceNames, isHybridTestingEnabled}) => { + const miniTestingServiceNamesOptions = (miniTestingServiceNames || []).map(name => { + return { + label: name, + value: name + } + }) + setMiniTestingServiceNames(miniTestingServiceNamesOptions) + setIsHybridTestingEnabled(isHybridTestingEnabled) + }) + setTestRun(prev => { const state = { ...prev, @@ -488,7 +503,7 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu } async function handleRun() { - const { startTimestamp, recurringDaily, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, cleanUpTestingResources } = testRun + const { startTimestamp, recurringDaily, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, cleanUpTestingResources, miniTestingServiceName } = testRun const collectionId = parseInt(apiCollectionId) const tests = testRun.tests @@ -529,9 +544,9 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu } if (filtered || selectedResourcesForPrimaryAction?.length > 0) { - await observeApi.scheduleTestForCustomEndpoints(apiInfoKeyList, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, "TESTING_UI", testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, finalAdvancedConditions, cleanUpTestingResources) + await observeApi.scheduleTestForCustomEndpoints(apiInfoKeyList, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, "TESTING_UI", testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, finalAdvancedConditions, cleanUpTestingResources, (miniTestingServiceName || miniTestingServiceNames?.[0]?.value)) } else { - await observeApi.scheduleTestForCollection(collectionId, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, finalAdvancedConditions, cleanUpTestingResources) + await observeApi.scheduleTestForCollection(collectionId, startTimestamp, recurringDaily, selectedTests, testName, testRunTime, maxConcurrentRequests, overriddenTestAppUrl, testRoleId, continuousTesting, sendSlackAlert, sendMsTeamsAlert, finalAdvancedConditions, cleanUpTestingResources, (miniTestingServiceName || miniTestingServiceNames?.[0]?.value)) } setActive(false) @@ -622,7 +637,7 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu setTestMode(check); } - // only for configurations + // only for configurations const handleModifyConfig = async () => { const settings = transform.prepareConditionsForTesting(conditions) const editableConfigObject = transform.prepareEditableConfigObject(testRun, settings, testIdConfig.hexId) @@ -678,6 +693,8 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu generateLabelForSlackIntegration={generateLabelForSlackIntegration} generateLabelForTeamsIntegration={generateLabelForTeamsIntegration} getLabel={getLabel} + isHybridTestingEnabled={isHybridTestingEnabled} + miniTestingServiceNames={miniTestingServiceNames} /> @@ -852,6 +869,8 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu generateLabelForSlackIntegration={generateLabelForSlackIntegration} generateLabelForTeamsIntegration={generateLabelForTeamsIntegration} getLabel={getLabel} + isHybridTestingEnabled={isHybridTestingEnabled} + miniTestingServiceNames={miniTestingServiceNames} /> @@ -882,6 +901,8 @@ function RunTest({ endpoints, filtered, apiCollectionId, disabled, runTestFromOu generateLabelForSlackIntegration={generateLabelForSlackIntegration} generateLabelForTeamsIntegration={generateLabelForTeamsIntegration} getLabel={getLabel} + isHybridTestingEnabled={isHybridTestingEnabled} + miniTestingServiceNames={miniTestingServiceNames} /> diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTestConfiguration.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTestConfiguration.jsx index c9d6f85d4c..7598b2be61 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTestConfiguration.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/RunTestConfiguration.jsx @@ -3,7 +3,7 @@ import { VerticalStack, HorizontalGrid, Checkbox, TextField, Text } from '@shopi import Dropdown from "../../../components/layouts/Dropdown"; import func from "@/util/func" -const RunTestConfiguration = ({ testRun, setTestRun, runTypeOptions, hourlyTimes, testRunTimeOptions, testRolesArr, maxConcurrentRequestsOptions, slackIntegrated, generateLabelForSlackIntegration,getLabel, timeFieldsDisabled, teamsTestingWebhookIntegrated, generateLabelForTeamsIntegration}) => { +const RunTestConfiguration = ({ testRun, setTestRun, runTypeOptions, hourlyTimes, testRunTimeOptions, testRolesArr, maxConcurrentRequestsOptions, slackIntegrated, generateLabelForSlackIntegration,getLabel, timeFieldsDisabled, teamsTestingWebhookIntegrated, generateLabelForTeamsIntegration, isHybridTestingEnabled, miniTestingServiceNames}) => { return ( @@ -104,6 +104,21 @@ const RunTestConfiguration = ({ testRun, setTestRun, runTypeOptions, hourlyTimes }} /> + { + isHybridTestingEnabled && miniTestingServiceNames?.length > 0 ? + { + const miniTestingServiceNameOption = getLabel(miniTestingServiceNames, requests) + setTestRun(prev => ({ + ...prev, + miniTestingServiceName: miniTestingServiceNameOption.value + })) + }} + /> : <> + } miniTestingHeartbeat; public Account() {} @@ -105,4 +109,12 @@ public boolean getHybridTestingEnabled() { public void setHybridTestingEnabled(boolean hybridTestingEnabled) { this.hybridTestingEnabled = hybridTestingEnabled; } + + public List getMiniTestingHeartbeat() { + return miniTestingHeartbeat; + } + + public void setMiniTestingHeartbeat(List miniTestingHeartbeat) { + this.miniTestingHeartbeat = miniTestingHeartbeat; + } } diff --git a/libs/dao/src/main/java/com/akto/dto/MiniTestingServiceHeartbeat.java b/libs/dao/src/main/java/com/akto/dto/MiniTestingServiceHeartbeat.java new file mode 100644 index 0000000000..1a319cddf4 --- /dev/null +++ b/libs/dao/src/main/java/com/akto/dto/MiniTestingServiceHeartbeat.java @@ -0,0 +1,33 @@ +package com.akto.dto; + +public class MiniTestingServiceHeartbeat { + + public static final String MINI_TESTING_SERVICE_NAME = "miniTestingServiceName"; + private String miniTestingServiceName; + + public static final String LAST_HEARTBEAT_TIME_STAMP = "lastHeartbeatTimeStamp"; + private int lastHeartbeatTimestamp; + + public MiniTestingServiceHeartbeat() {} + + public MiniTestingServiceHeartbeat(String miniTestingServiceName, int lastHeartbeatTimestamp) { + this.miniTestingServiceName = miniTestingServiceName; + this.lastHeartbeatTimestamp = lastHeartbeatTimestamp; + } + + public String getMiniTestingServiceName() { + return miniTestingServiceName; + } + + public void setMiniTestingServiceName(String miniTestingServiceName) { + this.miniTestingServiceName = miniTestingServiceName; + } + + public int getLastHeartbeatTimestamp() { + return lastHeartbeatTimestamp; + } + + public void setLastHeartbeatTimestamp(int lastHeartbeatTimestamp) { + this.lastHeartbeatTimestamp = lastHeartbeatTimestamp; + } +} diff --git a/libs/dao/src/main/java/com/akto/dto/testing/TestingRun.java b/libs/dao/src/main/java/com/akto/dto/testing/TestingRun.java index 9fa4f6ec94..ae284e9867 100644 --- a/libs/dao/src/main/java/com/akto/dto/testing/TestingRun.java +++ b/libs/dao/src/main/java/com/akto/dto/testing/TestingRun.java @@ -41,6 +41,9 @@ public class TestingRun { public static final String NAME = "name"; private String name; + public static final String MINI_TESTING_SERVICE_NAME = "miniTestingServiceName"; + private String miniTestingServiceName; + public enum TestingRunType{ ONE_TIME, RECURRING, CI_CD, CONTINUOUS_TESTING } @@ -70,11 +73,11 @@ public TestingRun(int scheduleTimestamp, String userEmail, TestingEndpoints test this.isNewTestRun = true; } - public TestingRun(int scheduleTimestamp, String userEmail, TestingEndpoints testingEndpoints, int testIdConfig, State state, int periodInSeconds, String name, int testRunTime, int maxConcurrentRequests, boolean sendSlackAlert) { - this(scheduleTimestamp, userEmail,testingEndpoints,testIdConfig, state, periodInSeconds, name, testRunTime, maxConcurrentRequests, sendSlackAlert, false); + public TestingRun(int scheduleTimestamp, String userEmail, TestingEndpoints testingEndpoints, int testIdConfig, State state, int periodInSeconds, String name, int testRunTime, int maxConcurrentRequests, boolean sendSlackAlert, String miniTestingServiceName) { + this(scheduleTimestamp, userEmail,testingEndpoints,testIdConfig, state, periodInSeconds, name, testRunTime, maxConcurrentRequests, sendSlackAlert, false, miniTestingServiceName); } - public TestingRun(int scheduleTimestamp, String userEmail, TestingEndpoints testingEndpoints, int testIdConfig, State state, int periodInSeconds, String name, int testRunTime, int maxConcurrentRequests, boolean sendSlackAlert, boolean sendMsTeamsAlert) { + public TestingRun(int scheduleTimestamp, String userEmail, TestingEndpoints testingEndpoints, int testIdConfig, State state, int periodInSeconds, String name, int testRunTime, int maxConcurrentRequests, boolean sendSlackAlert, boolean sendMsTeamsAlert, String miniTestingServiceName) { this.scheduleTimestamp = scheduleTimestamp; this.testRunTime = testRunTime; this.maxConcurrentRequests = maxConcurrentRequests; @@ -87,6 +90,7 @@ public TestingRun(int scheduleTimestamp, String userEmail, TestingEndpoints test this.periodInSeconds = periodInSeconds; this.name = name; this.sendSlackAlert = sendSlackAlert; + this.miniTestingServiceName = miniTestingServiceName; this.isNewTestRun = true; this.sendMsTeamsAlert = sendMsTeamsAlert; } @@ -232,6 +236,14 @@ public void setSendMsTeamsAlert(boolean sendMsTeamsAlert) { this.sendMsTeamsAlert = sendMsTeamsAlert; } + public String getMiniTestingServiceName() { + return miniTestingServiceName; + } + + public void setMiniTestingServiceName(String miniTestingServiceName) { + this.miniTestingServiceName = miniTestingServiceName; + } + @Override public String toString() { return "{" +