public DefaultRenderingResponseBuilder(RenderingResponse other) { Assert.notNull(other, "RenderingResponse must not be null"); this.name = other.name(); this.status = (other instanceof DefaultRenderingResponse ? ((DefaultRenderingResponse) other).statusCode : other.statusCode().value()); this.headers.putAll(other.headers()); this.model.putAll(other.model()); }
@Test public void headers() { HttpHeaders headers = new HttpHeaders(); Mono<RenderingResponse> result = RenderingResponse.create("foo").headers(headers).build(); StepVerifier.create(result) .expectNextMatches(response -> headers.equals(response.headers())) .expectComplete() .verify(); }