diff --git a/src/main/java/com/lpvs/LicensePreValidationSystem.java b/src/main/java/com/lpvs/LicensePreValidationSystem.java index 5f4a9819..3acc2bfa 100644 --- a/src/main/java/com/lpvs/LicensePreValidationSystem.java +++ b/src/main/java/com/lpvs/LicensePreValidationSystem.java @@ -71,7 +71,7 @@ public static void main(String[] args) { public TaskExecutor getAsyncExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(corePoolSize); - executor.setThreadNamePrefix("LPVS-ASYNC::"); + executor.setThreadNamePrefix("LPVS::"); return executor; } } diff --git a/src/main/java/com/lpvs/service/LPVSQueueService.java b/src/main/java/com/lpvs/service/LPVSQueueService.java index f76780bd..3664df78 100644 --- a/src/main/java/com/lpvs/service/LPVSQueueService.java +++ b/src/main/java/com/lpvs/service/LPVSQueueService.java @@ -147,6 +147,7 @@ public BlockingDeque getQueue() { * @throws InterruptedException If interrupted while processing the queue. */ public void checkForQueue() throws InterruptedException { + QUEUE.clear(); log.debug("Checking for previous queue"); List webhookConfigList = queueRepository.getQueueList(); for (LPVSQueue webhook : webhookConfigList) { diff --git a/src/main/java/com/lpvs/util/LPVSCommentUtil.java b/src/main/java/com/lpvs/util/LPVSCommentUtil.java index 3464195a..cf5fccab 100644 --- a/src/main/java/com/lpvs/util/LPVSCommentUtil.java +++ b/src/main/java/com/lpvs/util/LPVSCommentUtil.java @@ -66,7 +66,7 @@ public static String getMatchedLinesAsLink( if (vcs != null && vcs.equals(LPVSVcs.GITHUB)) { matchedLines = matchedLines.concat( - "" + lineInfo + ""); + "" + lineInfo + " "); } else { matchedLines = matchedLines.concat(lineInfo + " (" + link + ") "); } diff --git a/src/test/java/com/lpvs/LicensePreValidationSystemTest.java b/src/test/java/com/lpvs/LicensePreValidationSystemTest.java index 081d494f..de7d4f89 100644 --- a/src/test/java/com/lpvs/LicensePreValidationSystemTest.java +++ b/src/test/java/com/lpvs/LicensePreValidationSystemTest.java @@ -37,7 +37,7 @@ public void testGetAsyncExecutor() { assertEquals(executor, mocked_constructed_executor); verify(mocked_constructed_executor, times(1)).setCorePoolSize(testNumCores); - verify(mocked_constructed_executor, times(1)).setThreadNamePrefix("LPVS-ASYNC::"); + verify(mocked_constructed_executor, times(1)).setThreadNamePrefix("LPVS::"); verifyNoMoreInteractions(mocked_constructed_executor); } } diff --git a/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java b/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java index 942104ea..c1db362e 100644 --- a/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java +++ b/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java @@ -2170,7 +2170,7 @@ class TestCommentResults__ProhibitedPresentConflictsPresent { + "**File:** src/main/java/com/lpvs/service/LPVSGitHubService.java\n" + "**License(s):** MIT (prohibited)\n" + "**Component:** LPVS::Services (src/main/java/com/lpvs/service/LPVSGitHubService.java)\n" - + "**Matched Lines:** 1-6\n" + + "**Matched Lines:** 1-6 \n" + "**Snippet Match:** /**\n" + " * Copyright (c) 2022, Samsung Electronics Co., Ltd. All rights reserved.\n" + " *\n" @@ -2499,7 +2499,7 @@ class TestCommentResults__EmptyPresentConflictsPresent { + "**File:** src/main/java/com/lpvs/service/LPVSGitHubService.java\n" + "**License(s):** MIT ()\n" + "**Component:** LPVS::Services (src/main/java/com/lpvs/service/LPVSGitHubService.java)\n" - + "**Matched Lines:** 1-6\n" + + "**Matched Lines:** 1-6 \n" + "**Snippet Match:** /**\n" + " * Copyright (c) 2022, Samsung Electronics Co., Ltd. All rights reserved.\n" + " *\n" @@ -2827,7 +2827,7 @@ class TestCommentResults__UnreviewedPresentConflictsPresent { + "**File:** src/main/java/com/lpvs/service/LPVSGitHubService.java\n" + "**License(s):** MIT (unreviewed)\n" + "**Component:** LPVS::Services (src/main/java/com/lpvs/service/LPVSGitHubService.java)\n" - + "**Matched Lines:** 1-6\n" + + "**Matched Lines:** 1-6 \n" + "**Snippet Match:** /**\n" + " * Copyright (c) 2022, Samsung Electronics Co., Ltd. All rights reserved.\n" + " *\n" @@ -3157,7 +3157,7 @@ class TestCommentResults__RestrictedPresentConflictsPresent { + "**File:** src/main/java/com/lpvs/service/LPVSGitHubService.java\n" + "**License(s):** MIT (restricted)\n" + "**Component:** LPVS::Services (src/main/java/com/lpvs/service/LPVSGitHubService.java)\n" - + "**Matched Lines:** 1-6\n" + + "**Matched Lines:** 1-6 \n" + "**Snippet Match:** /**\n" + " * Copyright (c) 2022, Samsung Electronics Co., Ltd. All rights reserved.\n" + " *\n" @@ -3472,7 +3472,7 @@ class TestCommentResults__ProhibitedAbsentConflictsAbsent { + "**File:** src/main/java/com/lpvs/service/LPVSGitHubService.java\n" + "**License(s):** MIT (permitted)\n" + "**Component:** LPVS::Services (src/main/java/com/lpvs/service/LPVSGitHubService.java)\n" - + "**Matched Lines:** 1-6\n" + + "**Matched Lines:** 1-6 \n" + "**Snippet Match:** /**\n" + " * Copyright (c) 2022, Samsung Electronics Co., Ltd. All rights reserved.\n" + " *\n" @@ -4105,7 +4105,7 @@ class TestGetMatchedLinesAsLink_NotAll { final String matched_lines_1 = "1-6"; final String expected_result = - "1-6"; + "1-6 "; @BeforeEach void setUp() { diff --git a/src/test/java/com/lpvs/util/LPVSCommentUtilTest.java b/src/test/java/com/lpvs/util/LPVSCommentUtilTest.java index fec1fb65..b66c0e3a 100644 --- a/src/test/java/com/lpvs/util/LPVSCommentUtilTest.java +++ b/src/test/java/com/lpvs/util/LPVSCommentUtilTest.java @@ -91,9 +91,9 @@ public void testGetMatchedLinesAsLinkMultipleLines() { Mockito.when(webhookConfig.getHeadCommitSHA()).thenReturn("headCommitSHA"); String result = LPVSCommentUtil.getMatchedLinesAsLink(webhookConfig, file, LPVSVcs.GITHUB); assertEquals( - "1-5" - + "7" - + "9-12", + "1-5 " + + "7 " + + "9-12 ", result); }