diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2019-12-04 10:30:09 +0200 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2019-12-04 10:30:09 +0200 |
commit | 4e2d89221395442475eb2d681dfe61a3584d2496 (patch) | |
tree | b4db87f9deaf2cc8786d35dbf9099e8cf61d6527 /vid-automation/src/main/java | |
parent | 9e65dc01257d59b78f89077b94cc6393efef1893 (diff) |
improve test deployTwoServicesGetServicesFilterByModelId
Issue-ID: VID-724
Test validate that only expected jobIds are in service info list +
always mute jobs att the end of the test
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: I3cfa35ae5f31cf72dcf8b4ac3e250f9473080693
Diffstat (limited to 'vid-automation/src/main/java')
-rw-r--r-- | vid-automation/src/main/java/vid/automation/test/services/AsyncJobsService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/services/AsyncJobsService.java b/vid-automation/src/main/java/vid/automation/test/services/AsyncJobsService.java index 35849b481..05d6553d3 100644 --- a/vid-automation/src/main/java/vid/automation/test/services/AsyncJobsService.java +++ b/vid-automation/src/main/java/vid/automation/test/services/AsyncJobsService.java @@ -1,16 +1,18 @@ package vid.automation.test.services; import com.google.common.collect.ImmutableList; -import vid.automation.test.utils.DB_CONFIG; - import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.List; +import vid.automation.test.utils.DB_CONFIG; public class AsyncJobsService { + private static final String MUTE_JOB_STATEMENT = + "UPDATE `vid_job` SET `TAKEN_BY`='muteAllAsyncJobs', `JOB_STATUS`=CONCAT('MUTED_', `JOB_STATUS`), `AGE`=`AGE`+5 "; + public void dropAllAsyncJobs() { runStatementsInDb(ImmutableList.of( "DELETE FROM `vid_service_info`", @@ -44,7 +46,11 @@ public class AsyncJobsService { public void muteAllAsyncJobs() { - runStatementInDb("UPDATE `vid_job` SET `TAKEN_BY`='muteAllAsyncJobs', `JOB_STATUS`=CONCAT('MUTED_', `JOB_STATUS`), `AGE`=`AGE`+5 WHERE `TAKEN_BY` is NULL or `TAKEN_BY`<>'muteAllAsyncJobs'"); + runStatementInDb(MUTE_JOB_STATEMENT + "WHERE `TAKEN_BY` is NULL or `TAKEN_BY`<>'muteAllAsyncJobs'"); + } + + public void muteAsyncJobById(String uuid) { + runStatementInDb(MUTE_JOB_STATEMENT + String.format("WHERE JOB_ID='%s'",uuid)); } public void dropAllFromNameCounter() { |