Skip to content

Commit 34507c9

Browse files
author
Alexey Semenyuk
committed
#39 Use cactoos FormattedText instead of static String format.
1 parent 8dc242c commit 34507c9

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

src/test/java/org/cactoos/http/HtAutoRedirectTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.cactoos.text.FormattedText;
2828
import org.cactoos.text.JoinedText;
2929
import org.cactoos.text.TextOf;
30-
import org.cactoos.text.UncheckedText;
3130
import org.hamcrest.MatcherAssert;
3231
import org.hamcrest.Matchers;
3332
import org.junit.Test;
@@ -41,7 +40,6 @@
4140
* @version $Id$
4241
* @since 0.1
4342
* @checkstyle JavadocMethodCheck (500 lines)
44-
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
4543
*/
4644
public final class HtAutoRedirectTest {
4745

@@ -56,10 +54,8 @@ public void redirectsRequestAutomatically() throws Exception {
5654
new JoinedText(
5755
"\r\n",
5856
"HTTP/1.1 301",
59-
new UncheckedText(
60-
new FormattedText(
61-
"Location: %s", home
62-
)
57+
new FormattedText(
58+
"Location: %s", home
6359
).asString()
6460
)
6561
)

src/test/java/org/cactoos/http/HtSecureWireTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.cactoos.text.FormattedText;
3333
import org.cactoos.text.JoinedText;
3434
import org.cactoos.text.TextOf;
35-
import org.cactoos.text.UncheckedText;
3635
import org.hamcrest.MatcherAssert;
3736
import org.hamcrest.Matchers;
3837
import org.junit.Test;
@@ -134,11 +133,9 @@ public InputStream stream() throws IOException {
134133
new JoinedText(
135134
delimiter,
136135
"GET / HTTP/1.1",
137-
new UncheckedText(
138-
new FormattedText(
139-
"Host: %s",
140-
this.host
141-
)
136+
new FormattedText(
137+
"Host: %s",
138+
this.host
142139
).asString(),
143140
"Connection: close",
144141
delimiter

src/test/java/org/cactoos/http/HtWireTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.cactoos.text.FormattedText;
3333
import org.cactoos.text.JoinedText;
3434
import org.cactoos.text.TextOf;
35-
import org.cactoos.text.UncheckedText;
3635
import org.hamcrest.MatcherAssert;
3736
import org.hamcrest.Matchers;
3837
import org.junit.Test;
@@ -80,11 +79,9 @@ public void worksWithProvidedHostNameAndPort() throws IOException {
8079
new JoinedText(
8180
"\r\n",
8281
"GET / HTTP/1.1",
83-
new UncheckedText(
84-
new FormattedText(
85-
"Host:%s",
86-
home.getHost()
87-
)
82+
new FormattedText(
83+
"Host:%s",
84+
home.getHost()
8885
).asString()
8986
).asString()
9087
)

0 commit comments

Comments
 (0)