From e21c219e0997d044baa4327a37dff722307b1881 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 8 Jan 2024 16:35:13 +0300 Subject: [PATCH] ReportPortalHook: Tests WIP --- .../karate/name/SimpleItemNameTest.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/epam/reportportal/karate/name/SimpleItemNameTest.java b/src/test/java/com/epam/reportportal/karate/name/SimpleItemNameTest.java index 982fcea..8ee70a3 100644 --- a/src/test/java/com/epam/reportportal/karate/name/SimpleItemNameTest.java +++ b/src/test/java/com/epam/reportportal/karate/name/SimpleItemNameTest.java @@ -5,8 +5,10 @@ import com.epam.reportportal.service.ReportPortalClient; import com.epam.reportportal.util.test.CommonUtils; import com.epam.ta.reportportal.ws.model.StartTestItemRQ; +import com.intuit.karate.Results; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.mockito.ArgumentCaptor; import java.util.List; @@ -20,6 +22,7 @@ import static org.mockito.Mockito.*; public class SimpleItemNameTest { + private static final String TEST_FEATURE = "classpath:feature/simple.feature"; private final String featureId = CommonUtils.namedId("feature_"); private final String scenarioId = CommonUtils.namedId("scenario_"); private final List stepIds = Stream.generate(() -> CommonUtils.namedId("step_")) @@ -37,9 +40,15 @@ public void setupMock() { mockBatchLogging(client); } - @Test - public void test_item_names_simple() { - var results = TestUtils.runAsReport(rp, "classpath:feature/simple.feature"); + @ParameterizedTest + @ValueSource(booleans = {true, false}) + public void test_item_names_simple(boolean report) { + Results results; + if (report) { + results = TestUtils.runAsReport(rp, TEST_FEATURE); + } else { + results = TestUtils.runAsHook(rp, TEST_FEATURE); + } assertThat(results.getFailCount(), equalTo(0)); ArgumentCaptor featureCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class);