assertj / assertj/assertj-assertions-generator-maven-plugin

Add option to generate chained assertions

Open
#38 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
30
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Enhancement

Use case:

* You have an object "objectA" of type ObjectA which contains (among other fields) a field objectB of type ObjectB
* To assert it, I do
```java
assertThat(objectA).hasFieldOfObjectA("field");
assertThat(objectA.objectB).hasFieldOfObjectB("fieldOfObjectB");
```
* I'd like to be able to assert like this:
```java
assertThat(objectA)
.hasFieldOfObjectA("field")
.withObjectB()
.hasFieldOfObjectB("fieldOfObjectB");
```
I already do that manually, but I think it could be useful to be able to add this behavior automatically.

What do you think?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.