From b144db76e04271147bb8ef6315088c83c1a1a802 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Thu, 4 Apr 2024 17:17:37 +0300 Subject: [PATCH] Fix tests --- src/main/java/com/epam/reportportal/testng/TestNGService.java | 2 +- .../java/com/epam/reportportal/testng/TestNGServiceTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/reportportal/testng/TestNGService.java b/src/main/java/com/epam/reportportal/testng/TestNGService.java index 40360e6..2fba44a 100644 --- a/src/main/java/com/epam/reportportal/testng/TestNGService.java +++ b/src/main/java/com/epam/reportportal/testng/TestNGService.java @@ -376,7 +376,7 @@ protected FinishTestItemRQ buildFinishTestMethodRq(@Nonnull ItemStatus status, @ FinishTestItemRQ rq = new FinishTestItemRQ(); rq.setEndTime(new Date(testResult.getEndMillis())); rq.setStatus(status.name()); - if (!testResult.isSuccess()) { + if (!testResult.isSuccess() && ItemStatus.SKIPPED != status) { rq.setDescription(getLogMessage(testResult)); } return rq; diff --git a/src/test/java/com/epam/reportportal/testng/TestNGServiceTest.java b/src/test/java/com/epam/reportportal/testng/TestNGServiceTest.java index ba6c26c..0501269 100644 --- a/src/test/java/com/epam/reportportal/testng/TestNGServiceTest.java +++ b/src/test/java/com/epam/reportportal/testng/TestNGServiceTest.java @@ -177,6 +177,7 @@ public void startTestMethod() { public void finishTestMethod() { when(launch.getParameters()).thenReturn(new ListenerParameters()); when(testResult.getAttribute(RP_ID)).thenReturn(id); + when(testResult.isSuccess()).thenReturn(true); testNGService.finishTestMethod(ItemStatus.PASSED, testResult); verify(launch, times(1)).finishTestItem(eq(id), any(FinishTestItemRQ.class));