Skip to content

Commit 893af68

Browse files
committed
Fix readme to use maven-link without version
Also, bumped pom version for release.
1 parent bf2c09a commit 893af68

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![Tests](https://github.com/Nylle/JavaFixture/workflows/test/badge.svg?branch=master)](https://github.com/Nylle/JavaFixture/actions?query=workflow%3ATest)
2-
[![Maven Central](https://img.shields.io/maven-central/v/com.github.nylle/javafixture.svg?label=maven-central)](http://search.maven.org/#artifactdetails|com.github.nylle|javafixture|2.2.0|)
2+
[![Maven Central](https://img.shields.io/maven-central/v/com.github.nylle/javafixture.svg?label=maven-central)](https://maven-badges.herokuapp.com/maven-central/com.github.nylle/javafixture)
33
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](http://opensource.org/licenses/MIT)
44

55
# JavaFixture
@@ -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.2.0</version>
25+
<version>2.3.0</version>
2626
<scope>test</scope>
2727
</dependency>
2828
```
@@ -71,7 +71,7 @@ ParentDto result = fixture.create(ParentDto.class);
7171
List<String> result = fixture.createMany(String.class).collect(Collectors.toList());
7272
```
7373
#### Sample Result
74-
ArrayList:
74+
ArrayList:
7575
- String: "333af3f6-4ed1-4580-9cae-aaee271d7ba7"
7676
- String: "9452541b-c6f9-4316-b254-28d00b327d0d"
7777
- String: "4ed0f3c4-5ea3-4dbb-b31c-f92c036af463"
@@ -81,7 +81,7 @@ ArrayList:
8181
List<String> result = fixture.build(String.class).createMany(4).collect(Collectors.toList());
8282
```
8383
#### Sample Result
84-
ArrayList:
84+
ArrayList:
8585
- String: "333af3f6-4ed1-4580-9cae-aaee271d7ba7"
8686
- String: "9452541b-c6f9-4316-b254-28d00b327d0d"
8787
- String: "4ed0f3c4-5ea3-4dbb-b31c-f92c036af463"
@@ -94,7 +94,7 @@ result.add("HELLO!");
9494
fixture.addManyTo(result, String.class);
9595
```
9696
#### Sample Result
97-
ArrayList:
97+
ArrayList:
9898
- String: "HELLO!"
9999
- String: "333af3f6-4ed1-4580-9cae-aaee271d7ba7"
100100
- String: "9452541b-c6f9-4316-b254-28d00b327d0d"
@@ -263,18 +263,25 @@ All arguments of the test-method below will be provided as a random object gener
263263
@TestWithFixture
264264
void injectParameterViaMethodExtension(TestDto testObject, int intValue, Optional<String> genericObject) {
265265
assertThat(testObject).isInstanceOf(TestDto.class);
266-
266+
267267
assertThat(intValue).isBetween(Integer.MIN_VALUE, Integer.MAX_VALUE);
268-
268+
269269
assertThat(genericObject).isInstanceOf(Optional.class);
270270
assertThat(genericObject).isPresent();
271271
assertThat(genericObject.get()).isInstanceOf(String.class);
272272
}
273273
```
274-
274+
You can also configure Fixture inline:
275+
```java
276+
@TestWithFixture(minCollectionSize = 11, maxCollectionSize = 11, positiveNumbersOnly = true)
277+
void configurableFixture(List<Integer> input) {
278+
assertThat(input).hasSize(11);
279+
assertThat(input).allMatch(x -> x > 1);
280+
}
281+
```
275282

276283
### Parameterized Tests
277-
For some syntactic sugar, this library comes with a wrapper for JUnit5's parameterized
284+
For some syntactic sugar, this library comes with a wrapper for JUnit5's parameterized
278285
test feature, called `@TestWithCases`.
279286
```java
280287
@TestWithCases
@@ -292,9 +299,9 @@ the test's arguments.
292299
Due to Java's limited annotation design, the following rules apply:
293300
- Values can only be of type `String`, `Class` or primitive like `int`, `boolean`, `float`,
294301
etc.
295-
- Annotation parameters are indexed and they must fit to the test method argument.
302+
- Annotation parameters are indexed and they must fit to the test method argument.
296303
_Example:_ `str1 = "foo"` can only be applied to the first argument which must be of type
297304
`String`, while `int2 = 3` can only be applied to the second argument which obviously must
298-
be of type `int` and so on.
305+
be of type `int` and so on.
299306
- The current implementation only supports up to 6 arguments per test method.
300307

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>com.github.nylle</groupId>
88
<artifactId>javafixture</artifactId>
99
<packaging>jar</packaging>
10-
<version>2.2.0</version>
10+
<version>2.3.0</version>
1111

1212
<name>JavaFixture</name>
1313
<url>https://github.com/Nylle/JavaFixture</url>

0 commit comments

Comments
 (0)