assertj / assertj/assertj-generator

Generating logical equivalence assertions

Aperta
#184 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
72
Fork
47
Merge medio
1g 16h
PR unite (30g)
2

Descrizione

In our project, we have a module which defines an API - it's essentially a bunch of interfaces which are meant to be implemented elsewhere, possibly multiple times. We use the assertion generator plugin to generate asserts for these, which works great, but it becomes tedious if you want to assert multiple properties. We don't want to use the recursive comparator since this uses fields, not the properties as defined by the interfaces.

Is it possible to have the generator also generate a method which essentially chains all the generated single property asserts against an actual object of the same interface type? I feel like that should be possible, but maybe I'm missing something. That way you get the nice error messages from the single assertions without having to manually type all of this.

(bonus points if it can do it recursively (i.e. a nested interface which also has a generated assertion class for it would be reused), but I get that that would increase the complexity, and it's something we can easily glue ourselves)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando il plugin generatore di assertion e i metodi di assertion generati per una singola proprietà; nell’issue non sono indicati file o test specifici. Definisci l’interfaccia del metodo concatenato generato e decidi come riutilizzare le classi di assertion generate annidate, quindi verifica l’output generato e i relativi messaggi di errore rispetto a un’interfaccia con più proprietà.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
testing, tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.