Skip to content

Commit

Permalink
Merge branch '5.2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed May 28, 2020
2 parents 90ccabd + a92f425 commit d706899
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Expand Up @@ -67,6 +67,8 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping

private static final ProducesRequestCondition EMPTY_PRODUCES = new ProducesRequestCondition();

private static final RequestConditionHolder EMPTY_CUSTOM = new RequestConditionHolder(null);


@Nullable
private final String name;
Expand Down Expand Up @@ -98,7 +100,7 @@ public RequestMappingInfo(@Nullable String name, @Nullable PatternsRequestCondit
this.headersCondition = (headers != null ? headers : EMPTY_HEADERS);
this.consumesCondition = (consumes != null ? consumes : EMPTY_CONSUMES);
this.producesCondition = (produces != null ? produces : EMPTY_PRODUCES);
this.customConditionHolder = new RequestConditionHolder(custom);
this.customConditionHolder = (custom != null ? new RequestConditionHolder(custom) : EMPTY_CUSTOM);
}

/**
Expand Down
Expand Up @@ -69,6 +69,7 @@ public void createEmpty() {
assertThat(info.getHeadersCondition()).isSameAs(anotherInfo.getHeadersCondition());
assertThat(info.getConsumesCondition()).isSameAs(anotherInfo.getConsumesCondition());
assertThat(info.getProducesCondition()).isSameAs(anotherInfo.getProducesCondition());
assertThat(info.getCustomCondition()).isSameAs(anotherInfo.getCustomCondition());

RequestMappingInfo result = info.combine(anotherInfo);
assertThat(info.getPatternsCondition()).isSameAs(result.getPatternsCondition());
Expand All @@ -77,6 +78,7 @@ public void createEmpty() {
assertThat(info.getHeadersCondition()).isSameAs(result.getHeadersCondition());
assertThat(info.getConsumesCondition()).isSameAs(result.getConsumesCondition());
assertThat(info.getProducesCondition()).isSameAs(result.getProducesCondition());
assertThat(info.getCustomCondition()).isSameAs(result.getCustomCondition());
}

@Test
Expand Down
Expand Up @@ -69,6 +69,9 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping

private static final ProducesRequestCondition EMPTY_PRODUCES = new ProducesRequestCondition();

private static final RequestConditionHolder EMPTY_CUSTOM = new RequestConditionHolder(null);



@Nullable
private final String name;
Expand Down Expand Up @@ -100,7 +103,7 @@ public RequestMappingInfo(@Nullable String name, @Nullable PatternsRequestCondit
this.headersCondition = (headers != null ? headers : EMPTY_HEADERS);
this.consumesCondition = (consumes != null ? consumes : EMPTY_CONSUMES);
this.producesCondition = (produces != null ? produces : EMPTY_PRODUCES);
this.customConditionHolder = new RequestConditionHolder(custom);
this.customConditionHolder = (custom != null ? new RequestConditionHolder(custom) : EMPTY_CUSTOM);
}

/**
Expand Down
Expand Up @@ -63,6 +63,7 @@ public void createEmpty() {
assertThat(info.getHeadersCondition()).isSameAs(anotherInfo.getHeadersCondition());
assertThat(info.getConsumesCondition()).isSameAs(anotherInfo.getConsumesCondition());
assertThat(info.getProducesCondition()).isSameAs(anotherInfo.getProducesCondition());
assertThat(info.getCustomCondition()).isSameAs(anotherInfo.getCustomCondition());

RequestMappingInfo result = info.combine(anotherInfo);
assertThat(info.getPatternsCondition()).isSameAs(result.getPatternsCondition());
Expand All @@ -71,6 +72,7 @@ public void createEmpty() {
assertThat(info.getHeadersCondition()).isSameAs(result.getHeadersCondition());
assertThat(info.getConsumesCondition()).isSameAs(result.getConsumesCondition());
assertThat(info.getProducesCondition()).isSameAs(result.getProducesCondition());
assertThat(info.getCustomCondition()).isSameAs(result.getCustomCondition());
}

@Test
Expand Down

0 comments on commit d706899

Please sign in to comment.