You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-13Lines changed: 1 addition & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,8 +115,8 @@ ArrayList:
115
115
### Customize Property With Lambda
116
116
```java
117
117
TestDto result = fixture.build(TestDto.class)
118
-
.with(x -> x.myPublicField =123)
119
118
.with(x -> x.setMyPrivateField("HELLO!"))
119
+
.with(x -> x.myPublicField =123)
120
120
.create();
121
121
```
122
122
#### Sample Result
@@ -186,18 +186,6 @@ Optional result = fixture.create(SpecimenType.fromClass(Optional.class));
186
186
Optional result = fixture.create(Optional.class); // convenience method for above
187
187
```
188
188
189
-
## Optionals
190
-
To quickly create an `Optional<T>` of your desired type `T` without the need to use `SpecimenType<Optional<T>>` as described [above](#generics), here is some syntactic sugar:
191
-
```java
192
-
Optional<String> result = fixture.createOptional(String.class);
193
-
```
194
-
Or with customisation:
195
-
```java
196
-
Optional<TestDto> result = fixture.build(TestDto.class)
197
-
.without("myPublicField")
198
-
.createOptional();
199
-
```
200
-
201
189
## Constructor
202
190
There might be some cases when you want to create an object not by instantiating it and setting all fields, but by calling one of its constructors and feeding it random values.
0 commit comments