File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ The purpose of this project is to generate full object graphs for use in test su
1818<dependency >
1919 <groupId >com.github.nylle</groupId >
2020 <artifactId >javafixture</artifactId >
21- <version >2.15 .0</version >
21+ <version >2.16 .0</version >
2222 <scope >test</scope >
2323</dependency >
2424```
@@ -327,6 +327,22 @@ void canCreateEnumFromString(TestEnum testEnum, String string) {
327327}
328328```
329329
330+ #### Enums can be Strictly Validated
331+ Adding the ` @Strict ` -annotation in front of an Enum will ensure that all enum-values are covered by ` @TestCase ` s.
332+ ``` java
333+ @TestWithCases
334+ @TestCase (str1 = " VALUE1" , str2 = " VALUE1" )
335+ @TestCase (str1 = " VALUE3" , str2 = " VALUE3" )
336+ void canCreateEnumFromString(@Strict TestEnum testEnum, String string) {
337+ assertThat(testEnum). isEqualTo(TestEnum . valueOf(string));
338+ }
339+ ```
340+ This test will fail with a message similar to:
341+ ``` text
342+ @Strict requires all Enum values to be covered by test-cases. Missing values for arg0:
343+ TestEnum.VALUE2
344+ ```
345+
330346#### Random Injected Values
331347If you are using ` @TestWithFixture ` and want to make the test parameterized, you can do so by using the annotation ` @Fixture ` inline:
332348``` java
Original file line number Diff line number Diff line change 77 <groupId >com.github.nylle</groupId >
88 <artifactId >javafixture</artifactId >
99 <packaging >jar</packaging >
10- <version >2.15 .0</version >
10+ <version >2.16 .0</version >
1111
1212 <name >JavaFixture</name >
1313 <url >https://github.com/Nylle/JavaFixture</url >
You can’t perform that action at this time.
0 commit comments