@@ -197,6 +197,17 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
197197 Answer finalAnswer = new Answer (msg1 );
198198 List <TestCaseExecutionQueue > insertedList = new ArrayList <>();
199199
200+ // Feed all queue entries already existing in tag contaxt.
201+ executionQueueService = appContext .getBean (ITestCaseExecutionQueueService .class );
202+ Map <String , TestCaseExecutionQueue > queueAlreadyInsertedInTag = new HashMap <>();
203+ if (StringUtil .isNotEmptyOrNull (tag )) {
204+ LOG .debug ("We don't have the list of all already inserted entries. Let's get it from tag value : " + tag );
205+ List <TestCaseExecutionQueue > queueFromTag = executionQueueService .convert (executionQueueService .readByTagByCriteria (tag , 0 , 0 , null , null , null ));
206+ for (TestCaseExecutionQueue tceQueue : queueFromTag ) {
207+ queueAlreadyInsertedInTag .put (executionQueueService .getUniqKey (tceQueue .getTest (), tceQueue .getTestCase (), tceQueue .getCountry (), tceQueue .getEnvironment ()), tceQueue );
208+ }
209+ }
210+
200211 for (Long myId : idList ) {
201212
202213 id = myId ;
@@ -222,7 +233,6 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
222233 /**
223234 * All data seems cleans so we can call the services.
224235 */
225- executionQueueService = appContext .getBean (ITestCaseExecutionQueueService .class );
226236 executionQueueFactory = appContext .getBean (IFactoryTestCaseExecutionQueue .class );
227237
228238 if (actionSave .equals ("save" )) {
@@ -259,14 +269,6 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
259269 finalAnswer = AnswerUtil .agregateAnswer (finalAnswer , ansItem );
260270 if (ansItem .isCodeEquals (MessageEventEnum .DATA_OPERATION_OK .getCode ())) {
261271
262- // Feed all queue entries already existing in tag contaxt.
263- LOG .debug ("We don't have the list of all already inserted entries. Let's get it from tag value : " + tag );
264- List <TestCaseExecutionQueue > queueFromTag = executionQueueService .convert (executionQueueService .readByTagByCriteria (tag , 0 , 0 , null , null , null ));
265- Map <String , TestCaseExecutionQueue > queueAlreadyInsertedInTag = new HashMap <>();
266- for (TestCaseExecutionQueue tceQueue : queueFromTag ) {
267- queueAlreadyInsertedInTag .put (executionQueueService .getUniqKey (tceQueue .getTest (), tceQueue .getTestCase (), tceQueue .getCountry (), tceQueue .getEnvironment ()), tceQueue );
268- }
269-
270272 ansItem = executionQueueService .create (executionQueueData , withNewDep , id , TestCaseExecutionQueue .State .QUEUED , queueAlreadyInsertedInTag );
271273 TestCaseExecutionQueue addedExecution = (TestCaseExecutionQueue ) ansItem .getItem ();
272274 insertedList .add (addedExecution );
0 commit comments