Skip to content

Commit e17d7c4

Browse files
committed
Update readme for release 2.8.0
1 parent ec4c48b commit e17d7c4

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The purpose of this project is to generate full object graphs for use in test su
2222
<dependency>
2323
<groupId>com.github.nylle</groupId>
2424
<artifactId>javafixture</artifactId>
25-
<version>2.7.0</version>
25+
<version>2.8.0</version>
2626
<scope>test</scope>
2727
</dependency>
2828
```
@@ -45,6 +45,15 @@ String result = fixture.create(String.class);
4545
#### Sample Result
4646
String: "c3932f6f-59ae-43df-8ee9-8788474a3f87"
4747

48+
#### Note
49+
If a `String`-field is annotated with `@Size`, those limits will be respected:
50+
```java
51+
public class TestObjectWithJavaxValidationAnnotations {
52+
@Size(min = 3, max = 6)
53+
private String withMinMaxAnnotation;
54+
}
55+
```
56+
4857
### Autogenerated Number
4958
```java
5059
int result = fixture.create(int.class);
@@ -299,6 +308,16 @@ void injectParameterViaMethodExtension(TestDto testObject, int intValue, Optiona
299308
assertThat(genericObject.get()).isInstanceOf(String.class);
300309
}
301310
```
311+
Additional annotated arguments are allowed:
312+
```java
313+
@TestWithFixture
314+
@DisplayName("Annotated parameters will work when they are at the end of the list")
315+
void injectTempDirViaJunit(Integer intValue, @TempDir Path injectedTempDir) {
316+
assertThat(injectedTempDir).isEqualTo(tempPath);
317+
assertThat(intValue).isNotNull();
318+
}
319+
```
320+
302321
You can also configure Fixture inline:
303322
```java
304323
@TestWithFixture(minCollectionSize = 11, maxCollectionSize = 11, positiveNumbersOnly = true)

0 commit comments

Comments
 (0)