Skip to content

Commit

Permalink
Merge pull request #14 from epam-deik-cooperation/testng-to-jupiter
Browse files Browse the repository at this point in the history
 Moved from TestNG to Jupiter
  • Loading branch information
ferencbarta authored Oct 13, 2020
2 parents a171d8b + ae65d64 commit b0b2900
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@
<version>2.11.2</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions week-4/order-of-everything/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

/**
* # Order of everything
Expand All @@ -34,7 +36,8 @@
*/
public class OrderOfEverythingTest {

@Test(dataProvider = "collectionsToSortDataProvider")
@ParameterizedTest
@MethodSource("collectionsToSortDataProvider")
public void testOrderShouldReturnExpectedListWhenCollectionIsPassed(Collection<Integer> input, List<Integer> expectedOutput) {
// Given as parameters

Expand All @@ -47,13 +50,12 @@ public void testOrderShouldReturnExpectedListWhenCollectionIsPassed(Collection<I
assertThat(actualOutput, equalTo(expectedOutput));
}

@DataProvider
private Object[][] collectionsToSortDataProvider() {
return new Object[][] {
{Collections.emptySet(), Collections.emptyList()},
{Set.of(1), List.of(1)},
{Set.of(2,1), List.of(1,2)}
};
private static Stream<Arguments> collectionsToSortDataProvider() {
return Stream.of(
Arguments.of(Collections.emptySet(), Collections.emptyList()),
Arguments.of(Set.of(1), List.of(1)),
Arguments.of(Set.of(2,1), List.of(1,2))
);
}

private <T extends Comparable<T>> List<T> createOrderedList(Collection<T> input) {
Expand Down
4 changes: 2 additions & 2 deletions week-5/kindof-equal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

/**
* # Kind of equal
Expand Down

0 comments on commit b0b2900

Please sign in to comment.