assertj / assertj/assertj-generator
Support Java 8 Optional Feature
- Vorherrschende Sprache
- Java
- Sterne
- 72
- Forks
- 47
- Ø Merge
- 1 T. 16 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
Is it possible to support Java 8 Optional feature for the generator?
Sample model class:
``` java
public class Person {
private String name;
public Person(String name) {
this.name = name;
}
public Optional getName() {
return name == null ? Optional.empty() : Optional.of(name);
}
}
```
Generated assertion class:
``` java
public class PersonAssert extends AbstractAssert {
public PersonAssert hasName(java.util.Optional name) {
}
}
```
Suggested assert class:
``` java
public class PersonAssert extends AbstractAssert {
// Generator might lookup generic type of the Optional and generate the method without Optional parameter
public PersonAssert hasName(String name) {
}
public PersonAssert hasName(java.util.Optional name) {
}
}
```
Beitragsleitfaden
Rechercherichtung
No source file or test is named in the issue. Start by locating the generator entry point that handles getter return types and generic types, then compare its output for the provided Person model. Done means Optional getters produce the requested assertion overloads with the intended String and Optional parameters.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100