Skip to content

Commit

Permalink
update junit-dataprovider to 1.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSchumacher authored and joel-costigliola committed Feb 26, 2016
1 parent 25c54f0 commit 1199aa0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<version>1.10.2</version>
<version>1.10.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Expand Up @@ -46,20 +46,17 @@ public void should_format_description_if_value_is_not_empty_or_null() {
}

@Test
@UseDataProvider("testDescriptionGenerator")
@UseDataProvider("descriptionGeneratorDataProvider")
public void should_return_empty_String(TestDescription testDescription) {
assertThat(formatter.format(testDescription)).isEmpty();
}

// Workaround with custom format because TestDescription#toString returns the value
// and junit-dataprovider 1.10.2 fails if toString of a parameter returns null
// see: https://github.com/TNG/junit-dataprovider/issues/66
@DataProvider(format = "%m[%i]")
public static Object[][] testDescriptionGenerator() {
// @format:off
return new Object[][] { { null },
{ new TestDescription(null) },
{ new TestDescription("") }};
// @format:on
@DataProvider
public static Object[][] descriptionGeneratorDataProvider() {
return new Object[][] {
{ null },
{ new TestDescription(null) },
{ new TestDescription("") }
};
}
}

0 comments on commit 1199aa0

Please sign in to comment.