assertj / assertj/assertj-generator
Support Java 8 Optional Feature
- Lingua principale
- Java
- Stelle
- 72
- Fork
- 47
- Merge medio
- 1g 16h
- PR unite (30g)
- 2
Descrizione
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) {
}
}
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100