Polish AbstractServerHttpResponse

This commit simplifies the logic for applying beforeCommit actions
replacing the use of chained Mono.then calls with a single
Flux.concat.

Also renamed writeStatusCode, writeHeaders, and writeCookies to
applyStatusCode, applyHeaders, and applyCookies respectively to
better reflect we're simply setting them on the underlying response
(not necessarily written yet).
This commit is contained in:
Rossen Stoyanchev
2016-10-13 15:59:08 -04:00
parent 336b4d2fb8
commit 9f8e8458c1
6 changed files with 85 additions and 77 deletions

View File

@@ -158,19 +158,19 @@ public class ServerHttpResponseTests {
}
@Override
public void writeStatusCode() {
public void applyStatusCode() {
assertFalse(this.statusCodeWritten);
this.statusCodeWritten = true;
}
@Override
protected void writeHeaders() {
protected void applyHeaders() {
assertFalse(this.headersWritten);
this.headersWritten = true;
}
@Override
protected void writeCookies() {
protected void applyCookies() {
assertFalse(this.cookiesWritten);
this.cookiesWritten = true;
}