assertj / assertj/assertj-generator

Support Java 8 Optional Feature

Abierto
#51 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
72
Forks
47
Merge medio
1 d 16 h
PR fusionados (30 d)
2

Descripción

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) {
}
}
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.