Skip to content

Commit

Permalink
Merge branch '2.3.x' into 2.4.x
Browse files Browse the repository at this point in the history
Closes gh-24670
  • Loading branch information
philwebb committed Jan 6, 2021
2 parents c014bb9 + 848ed65 commit 2b497b6
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -45,6 +45,9 @@ class OperationMethodParameterTests {
private Method exampleMetaJsr305 = ReflectionUtils.findMethod(getClass(), "exampleMetaJsr305", String.class,
String.class);

private Method exampleJsr305NonNull = ReflectionUtils.findMethod(getClass(), "exampleJsr305NonNull", String.class,
String.class);

@Test
void getNameShouldReturnName() {
OperationMethodParameter parameter = new OperationMethodParameter("name", this.example.getParameters()[0]);
Expand Down Expand Up @@ -83,16 +86,22 @@ void isMandatoryWhenJsrMetaNullableAnnotationShouldReturnFalse() {
assertThat(parameter.isMandatory()).isFalse();
}

void example(String one, @Nullable String two) {
public void isMandatoryWhenJsrNonnullAnnotationShouldReturnTrue() {
OperationMethodParameter parameter = new OperationMethodParameter("name",
this.exampleJsr305NonNull.getParameters()[1]);
assertThat(parameter.isMandatory()).isTrue();
}

void example(String one, @Nullable String two) {
}

void exampleJsr305(String one, @javax.annotation.Nullable String two) {

}

void exampleMetaJsr305(String one, @MetaNullable String two) {
}

void exampleJsr305NonNull(String one, @javax.annotation.Nonnull String two) {
}

@TypeQualifier
Expand Down

0 comments on commit 2b497b6

Please sign in to comment.