Skip to content

Commit

Permalink
yegor256#47 fix TsFlashTest, RsFlashTest
Browse files Browse the repository at this point in the history
  • Loading branch information
dmzaytsev committed Mar 29, 2015
1 parent 379a1ff commit c65de23
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/test/java/org/takes/facets/flash/RsFlashTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public void addsCookieToResponse() throws IOException {
new StringBuilder("Set-Cookie: RsFlash=")
.append(
DatatypeConverter.printBase64Binary(
new StringBuilder(Level.INFO.getName())
new StringBuilder(msg)
.append('/')
.append(msg)
.append(Level.INFO.getName())
.toString()
.getBytes(Charset.defaultCharset())
)
Expand Down
15 changes: 14 additions & 1 deletion src/test/java/org/takes/facets/flash/TsFlashTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

import com.jcabi.matchers.XhtmlMatchers;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.logging.Level;
import javax.xml.bind.DatatypeConverter;
import org.apache.commons.io.IOUtils;
import org.hamcrest.MatcherAssert;
import org.junit.Test;
Expand Down Expand Up @@ -71,7 +74,17 @@ public Take route(final Request request) {
IOUtils.toString(
takes.route(
new RqWithHeader(
new RqFake(), "Cookie: RsFlash=Hello!"
new RqFake(),
new StringBuilder("Cookie: RsFlash=")
.append(
DatatypeConverter.printBase64Binary(
new StringBuilder("Hello!")
.append('/')
.append(Level.INFO.getName())
.toString()
.getBytes(Charset.defaultCharset())
)
).toString()
)
).act().body()
),
Expand Down

0 comments on commit c65de23

Please sign in to comment.