Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 21, 2023
1 parent 74d3147 commit 61861a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import org.mockito.ArgumentCaptor;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.epam.reportportal.karate.utils.TestUtils.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.*;
import static org.mockito.ArgumentMatchers.same;
import static org.mockito.Mockito.*;

Expand All @@ -26,7 +26,6 @@ public class BackgroundTest {
private final List<String> stepIds = Stream.generate(() -> CommonUtils.namedId("step_"))
.limit(3).collect(Collectors.toList());


private final ReportPortalClient client = mock(ReportPortalClient.class);
private final ReportPortal rp = ReportPortal.create(client, standardParameters(), testExecutor());

Expand All @@ -52,6 +51,9 @@ public void test_background_steps() {
List<StartTestItemRQ> steps = stepCaptor.getAllValues();
assertThat(steps, hasSize(3));

assertThat(steps.get(0).getName(), equalTo("BACKGROUND: Given def four = 4"));
Set<String> stepNames = steps.stream().map(StartTestItemRQ::getName).collect(Collectors.toSet());

assertThat(stepNames, allOf(hasItem("BACKGROUND: Given def four = 4"), hasItem("When def actualFour = 2 * 2"),
hasItem("Then assert actualFour == four")));
}
}
4 changes: 2 additions & 2 deletions src/test/resources/feature/background.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Feature: the test to show item description reporting
Given def four = 4

Scenario: Verify math
When def acualFour = 2 * 2
Then assert acualFour == four
When def actualFour = 2 * 2
Then assert actualFour == four

0 comments on commit 61861a5

Please sign in to comment.