diff --git a/.rultor.yml b/.rultor.yml index 167f52635..ee040e1de 100644 --- a/.rultor.yml +++ b/.rultor.yml @@ -4,9 +4,6 @@ assets: settings.xml: yegor256/home#assets/takes/settings.xml pubring.gpg: yegor256/home#assets/pubring.gpg secring.gpg: yegor256/home#assets/secring.gpg -architect: - - paulodamaso - - yegor256 install: | export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 diff --git a/README.md b/README.md index b77d09118..9ef704e10 100755 --- a/README.md +++ b/README.md @@ -19,8 +19,6 @@ [![Maven Central](https://img.shields.io/maven-central/v/org.takes/takes.svg)](https://maven-badges.herokuapp.com/maven-central/org.takes/takes) [![PDD status](http://www.0pdd.com/svg?name=yegor256/takes)](http://www.0pdd.com/p?name=yegor256/takes) -Project architect: [@paulodamaso](https://github.com/paulodamaso) - **Takes** is a [true object-oriented](http://www.yegor256.com/2014/11/20/seven-virtues-of-good-object.html) and [immutable](http://www.yegor256.com/2014/06/09/objects-should-be-immutable.html) Java8 web development framework. Its key benefits, comparing to all others, include these diff --git a/src/it/file-manager/pom.xml b/src/it/file-manager/pom.xml index ff00e1d24..f44a79e5e 100644 --- a/src/it/file-manager/pom.xml +++ b/src/it/file-manager/pom.xml @@ -27,7 +27,7 @@ SOFTWARE. com.jcabi parent - 0.57.2 + 0.58.0 org.takes.test file-manager @@ -50,21 +50,25 @@ SOFTWARE. com.jcabi jcabi-matchers + 1.5.3 test com.jcabi jcabi-xml + 0.23.1 test commons-io commons-io + 2.11.0 test com.jcabi jcabi-http + 1.18.1 test @@ -73,9 +77,22 @@ SOFTWARE. 0.20.1 test + + org.slf4j + slf4j-log4j12 + 1.8.0-alpha2 + runtime + + + log4j + log4j + 1.2.17 + runtime + javax.ws.rs jsr311-api + 1.1.1 test @@ -100,11 +117,13 @@ SOFTWARE. org.hibernate.validator hibernate-validator + 7.0.1.Final runtime javax.el javax.el-api + 3.0.1-b06 runtime diff --git a/src/it/file-manager/src/verifier/verifications.xml b/src/it/file-manager/src/verifier/verifications.xml index 99012c3c1..d09e32232 100644 --- a/src/it/file-manager/src/verifier/verifications.xml +++ b/src/it/file-manager/src/verifier/verifications.xml @@ -26,7 +26,7 @@ SOFTWARE. LICENSE.txt - 2014-2019 + 2014-2022 diff --git a/src/main/java/org/takes/facets/auth/Token.java b/src/main/java/org/takes/facets/auth/Token.java index a52203333..b5fd4beec 100644 --- a/src/main/java/org/takes/facets/auth/Token.java +++ b/src/main/java/org/takes/facets/auth/Token.java @@ -23,7 +23,6 @@ */ package org.takes.facets.auth; -import java.io.IOException; import java.nio.charset.Charset; import java.util.Base64; import java.util.Calendar; diff --git a/src/main/java/org/takes/facets/auth/XeIdentity.java b/src/main/java/org/takes/facets/auth/XeIdentity.java index d8a4a9431..873fa803f 100644 --- a/src/main/java/org/takes/facets/auth/XeIdentity.java +++ b/src/main/java/org/takes/facets/auth/XeIdentity.java @@ -23,13 +23,10 @@ */ package org.takes.facets.auth; -import java.io.IOException; import java.util.Map; import lombok.EqualsAndHashCode; import org.takes.Request; -import org.takes.rs.xe.XeSource; import org.takes.rs.xe.XeWrap; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/facets/auth/social/PsGithub.java b/src/main/java/org/takes/facets/auth/social/PsGithub.java index 335856464..c55f81769 100644 --- a/src/main/java/org/takes/facets/auth/social/PsGithub.java +++ b/src/main/java/org/takes/facets/auth/social/PsGithub.java @@ -122,7 +122,7 @@ public Opt enter(final Request request) if (!code.hasNext()) { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, - "code is not provided by Github" + "'code' is not provided by Github" ); } return new Opt.Single<>( diff --git a/src/main/java/org/takes/facets/cookies/TkJoinedCookies.java b/src/main/java/org/takes/facets/cookies/TkJoinedCookies.java index 2076fae3c..e10fcfb79 100644 --- a/src/main/java/org/takes/facets/cookies/TkJoinedCookies.java +++ b/src/main/java/org/takes/facets/cookies/TkJoinedCookies.java @@ -27,7 +27,6 @@ import java.util.regex.Pattern; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; import org.takes.Response; import org.takes.Take; import org.takes.rs.RsWithHeader; diff --git a/src/main/java/org/takes/facets/fallback/FbEmpty.java b/src/main/java/org/takes/facets/fallback/FbEmpty.java index 4ccd452b3..36f0e2069 100644 --- a/src/main/java/org/takes/facets/fallback/FbEmpty.java +++ b/src/main/java/org/takes/facets/fallback/FbEmpty.java @@ -24,7 +24,6 @@ package org.takes.facets.fallback; import lombok.EqualsAndHashCode; -import org.takes.Response; import org.takes.misc.Opt; /** diff --git a/src/main/java/org/takes/facets/fallback/FbLog4j.java b/src/main/java/org/takes/facets/fallback/FbLog4j.java index d86b5ca4f..ac85070fe 100644 --- a/src/main/java/org/takes/facets/fallback/FbLog4j.java +++ b/src/main/java/org/takes/facets/fallback/FbLog4j.java @@ -28,7 +28,6 @@ import org.apache.log4j.Logger; import org.cactoos.bytes.BytesOf; import org.cactoos.text.TextOf; -import org.takes.Response; import org.takes.misc.Opt; import org.takes.rq.RqHref; import org.takes.rq.RqMethod; diff --git a/src/main/java/org/takes/facets/fallback/FbSlf4j.java b/src/main/java/org/takes/facets/fallback/FbSlf4j.java index 17ecf1335..390c8ef4e 100644 --- a/src/main/java/org/takes/facets/fallback/FbSlf4j.java +++ b/src/main/java/org/takes/facets/fallback/FbSlf4j.java @@ -29,7 +29,6 @@ import org.cactoos.text.TextOf; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.takes.Response; import org.takes.misc.Opt; import org.takes.rq.RqHref; import org.takes.rq.RqMethod; diff --git a/src/main/java/org/takes/facets/fork/FkFixed.java b/src/main/java/org/takes/facets/fork/FkFixed.java index ee4e6a19e..02e86826d 100644 --- a/src/main/java/org/takes/facets/fork/FkFixed.java +++ b/src/main/java/org/takes/facets/fork/FkFixed.java @@ -24,8 +24,6 @@ package org.takes.facets.fork; import lombok.EqualsAndHashCode; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.misc.Opt; diff --git a/src/main/java/org/takes/http/BkParallel.java b/src/main/java/org/takes/http/BkParallel.java index c1a10277b..6d0d5232d 100644 --- a/src/main/java/org/takes/http/BkParallel.java +++ b/src/main/java/org/takes/http/BkParallel.java @@ -24,7 +24,6 @@ package org.takes.http; import java.io.IOException; -import java.net.Socket; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; diff --git a/src/main/java/org/takes/http/BkSafe.java b/src/main/java/org/takes/http/BkSafe.java index 0e48f8b16..6f5ec31cc 100644 --- a/src/main/java/org/takes/http/BkSafe.java +++ b/src/main/java/org/takes/http/BkSafe.java @@ -23,7 +23,6 @@ */ package org.takes.http; -import java.net.Socket; import lombok.EqualsAndHashCode; /** @@ -40,6 +39,7 @@ public final class BkSafe extends BkWrap { * Ctor. * @param back Original back */ + @SuppressWarnings("PMD.AvoidCatchingThrowable") public BkSafe(final Back back) { super(socket -> { try { diff --git a/src/main/java/org/takes/http/FtCli.java b/src/main/java/org/takes/http/FtCli.java index c14b071fe..f0c21c3fc 100644 --- a/src/main/java/org/takes/http/FtCli.java +++ b/src/main/java/org/takes/http/FtCli.java @@ -26,8 +26,6 @@ import java.io.IOException; import java.util.Arrays; import lombok.EqualsAndHashCode; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqWithHeader; @@ -91,7 +89,7 @@ public FtCli(final Take tks, final Iterable args) { public void start(final Exit exit) throws IOException { final Take tks; if (this.options.hitRefresh()) { - tks = request -> FtCli.this.take.act( + tks = request -> this.take.act( new RqWithHeader( request, "X-Takes-HitRefresh: yes" ) @@ -116,7 +114,7 @@ public void start(final Exit exit) throws IOException { final Thread thread = new Thread( () -> { try { - front.start(FtCli.this.exit(exit)); + front.start(this.exit(exit)); } catch (final IOException ex) { throw new IllegalStateException(ex); } diff --git a/src/main/java/org/takes/http/FtRemote.java b/src/main/java/org/takes/http/FtRemote.java index 2250103e4..6386de8f7 100644 --- a/src/main/java/org/takes/http/FtRemote.java +++ b/src/main/java/org/takes/http/FtRemote.java @@ -39,6 +39,7 @@ * * @since 0.1 * @checkstyle ClassDataAbstractionCouplingCheck (500 lines) + * @checkstyle ExecutableStatementCountCheck (500 lines) */ @EqualsAndHashCode public final class FtRemote implements Front { @@ -116,7 +117,7 @@ public void exec(final FtRemote.Script script) throws Exception { final Thread thread = new Thread( () -> { try { - FtRemote.this.start( + this.start( () -> { latch.countDown(); return exit.get(); diff --git a/src/main/java/org/takes/http/MainRemote.java b/src/main/java/org/takes/http/MainRemote.java index 833ff2edf..484e4593a 100644 --- a/src/main/java/org/takes/http/MainRemote.java +++ b/src/main/java/org/takes/http/MainRemote.java @@ -33,7 +33,6 @@ import java.util.Arrays; import java.util.concurrent.TimeUnit; import lombok.EqualsAndHashCode; -import org.cactoos.Scalar; import org.cactoos.bytes.BytesOf; import org.cactoos.number.NumberOf; import org.cactoos.text.TextOf; diff --git a/src/main/java/org/takes/rs/xe/XeAppend.java b/src/main/java/org/takes/rs/xe/XeAppend.java index 7601f85e9..7c9fd6986 100644 --- a/src/main/java/org/takes/rs/xe/XeAppend.java +++ b/src/main/java/org/takes/rs/xe/XeAppend.java @@ -23,12 +23,10 @@ */ package org.takes.rs.xe; -import java.io.IOException; import java.util.Arrays; import lombok.EqualsAndHashCode; import org.cactoos.Scalar; import org.cactoos.scalar.IoChecked; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeChain.java b/src/main/java/org/takes/rs/xe/XeChain.java index 25c9fd2dd..55b135db3 100644 --- a/src/main/java/org/takes/rs/xe/XeChain.java +++ b/src/main/java/org/takes/rs/xe/XeChain.java @@ -23,12 +23,10 @@ */ package org.takes.rs.xe; -import java.io.IOException; import java.util.Arrays; import lombok.EqualsAndHashCode; import org.cactoos.Scalar; import org.cactoos.scalar.IoChecked; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeDate.java b/src/main/java/org/takes/rs/xe/XeDate.java index 142632887..3b431d35d 100644 --- a/src/main/java/org/takes/rs/xe/XeDate.java +++ b/src/main/java/org/takes/rs/xe/XeDate.java @@ -29,7 +29,6 @@ import java.util.Locale; import java.util.TimeZone; import lombok.EqualsAndHashCode; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeLifetime.java b/src/main/java/org/takes/rs/xe/XeLifetime.java index e18219a8d..4f6301d3d 100644 --- a/src/main/java/org/takes/rs/xe/XeLifetime.java +++ b/src/main/java/org/takes/rs/xe/XeLifetime.java @@ -24,7 +24,6 @@ package org.takes.rs.xe; import lombok.EqualsAndHashCode; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeLink.java b/src/main/java/org/takes/rs/xe/XeLink.java index 5d634850e..023ddb6b1 100644 --- a/src/main/java/org/takes/rs/xe/XeLink.java +++ b/src/main/java/org/takes/rs/xe/XeLink.java @@ -24,7 +24,6 @@ package org.takes.rs.xe; import lombok.EqualsAndHashCode; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeLinkHome.java b/src/main/java/org/takes/rs/xe/XeLinkHome.java index 571521b7d..8f3cbd881 100644 --- a/src/main/java/org/takes/rs/xe/XeLinkHome.java +++ b/src/main/java/org/takes/rs/xe/XeLinkHome.java @@ -23,11 +23,9 @@ */ package org.takes.rs.xe; -import java.io.IOException; import lombok.EqualsAndHashCode; import org.takes.Request; import org.takes.rq.RqHref; -import org.xembly.Directive; /** * Xembly source to create an HOME Atom LINK element. diff --git a/src/main/java/org/takes/rs/xe/XeLinkSelf.java b/src/main/java/org/takes/rs/xe/XeLinkSelf.java index de59c6f3e..4497026ab 100644 --- a/src/main/java/org/takes/rs/xe/XeLinkSelf.java +++ b/src/main/java/org/takes/rs/xe/XeLinkSelf.java @@ -23,11 +23,9 @@ */ package org.takes.rs.xe; -import java.io.IOException; import lombok.EqualsAndHashCode; import org.takes.Request; import org.takes.rq.RqHref; -import org.xembly.Directive; /** * Xembly source to create an SELF Atom LINK element. diff --git a/src/main/java/org/takes/rs/xe/XeLocalhost.java b/src/main/java/org/takes/rs/xe/XeLocalhost.java index f4997f61b..6c0a94787 100644 --- a/src/main/java/org/takes/rs/xe/XeLocalhost.java +++ b/src/main/java/org/takes/rs/xe/XeLocalhost.java @@ -26,7 +26,6 @@ import java.net.InetAddress; import java.net.UnknownHostException; import lombok.EqualsAndHashCode; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeMemory.java b/src/main/java/org/takes/rs/xe/XeMemory.java index d3780f70a..8de9b5e50 100644 --- a/src/main/java/org/takes/rs/xe/XeMemory.java +++ b/src/main/java/org/takes/rs/xe/XeMemory.java @@ -24,7 +24,6 @@ package org.takes.rs.xe; import lombok.EqualsAndHashCode; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeSla.java b/src/main/java/org/takes/rs/xe/XeSla.java index aaa3f4dd0..645896c63 100644 --- a/src/main/java/org/takes/rs/xe/XeSla.java +++ b/src/main/java/org/takes/rs/xe/XeSla.java @@ -25,7 +25,6 @@ import java.lang.management.ManagementFactory; import lombok.EqualsAndHashCode; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeStylesheet.java b/src/main/java/org/takes/rs/xe/XeStylesheet.java index b9bdd222b..203133f5b 100644 --- a/src/main/java/org/takes/rs/xe/XeStylesheet.java +++ b/src/main/java/org/takes/rs/xe/XeStylesheet.java @@ -24,7 +24,6 @@ package org.takes.rs.xe; import lombok.EqualsAndHashCode; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/main/java/org/takes/rs/xe/XeTransform.java b/src/main/java/org/takes/rs/xe/XeTransform.java index 6a676cf97..81a3455c8 100644 --- a/src/main/java/org/takes/rs/xe/XeTransform.java +++ b/src/main/java/org/takes/rs/xe/XeTransform.java @@ -23,7 +23,6 @@ */ package org.takes.rs.xe; -import java.io.IOException; import java.util.Iterator; import lombok.EqualsAndHashCode; diff --git a/src/main/java/org/takes/rs/xe/XeWhen.java b/src/main/java/org/takes/rs/xe/XeWhen.java index 7c4159cf4..a6144a7db 100644 --- a/src/main/java/org/takes/rs/xe/XeWhen.java +++ b/src/main/java/org/takes/rs/xe/XeWhen.java @@ -23,7 +23,6 @@ */ package org.takes.rs.xe; -import java.io.IOException; import lombok.EqualsAndHashCode; import org.cactoos.Scalar; import org.cactoos.scalar.IoChecked; diff --git a/src/main/java/org/takes/servlet/HttpServletRequestFake.java b/src/main/java/org/takes/servlet/HttpServletRequestFake.java index e80ab7566..33c3dee27 100644 --- a/src/main/java/org/takes/servlet/HttpServletRequestFake.java +++ b/src/main/java/org/takes/servlet/HttpServletRequestFake.java @@ -25,7 +25,6 @@ import java.io.BufferedReader; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.security.Principal; @@ -40,7 +39,6 @@ import javax.servlet.DispatcherType; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; -import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; diff --git a/src/main/java/org/takes/servlet/SrvTake.java b/src/main/java/org/takes/servlet/SrvTake.java index 0bdc60817..f25428703 100644 --- a/src/main/java/org/takes/servlet/SrvTake.java +++ b/src/main/java/org/takes/servlet/SrvTake.java @@ -75,7 +75,7 @@ public void init() throws ServletException { } catch (final ClassNotFoundException err) { throw new ServletException( String.format( - "Failed to initialize. Class %s was not found", + "Class %s was not found", cname ), err @@ -89,32 +89,32 @@ public void init() throws ServletException { } catch (final InstantiationException err) { throw new ServletException( String.format( - "Failed to initialize. Can't construct %s class", - cname + "Can't construct %s class", + cls.getCanonicalName() ), err ); } catch (final IllegalAccessException err) { throw new ServletException( String.format( - "Failed to initialize. Constructor %s(ServletContext) is private", - cname + "Constructor %s(ServletContext) is private", + cls.getCanonicalName() ), err ); } catch (final InvocationTargetException err) { throw new ServletException( String.format( - "Failed to initialize. Error during instantiating %s", - cname + "Error during instantiating %s", + cls.getCanonicalName() ), err ); } catch (final NoSuchMethodException err) { throw new ServletException( String.format( - "Failed to initialize. Constructor %s(ServletContext) was not found", - cname + "Constructor %s(ServletContext) was not found", + cls.getCanonicalName() ), err ); diff --git a/src/main/java/org/takes/tk/TkFailure.java b/src/main/java/org/takes/tk/TkFailure.java index 109d08aa9..7e1081763 100644 --- a/src/main/java/org/takes/tk/TkFailure.java +++ b/src/main/java/org/takes/tk/TkFailure.java @@ -28,9 +28,6 @@ import lombok.ToString; import org.cactoos.Scalar; import org.cactoos.scalar.IoChecked; -import org.takes.Request; -import org.takes.Response; -import org.takes.Take; /** * Take that always fails. diff --git a/src/main/java/org/takes/tk/TkFiles.java b/src/main/java/org/takes/tk/TkFiles.java index fa1fa33e2..ba63b6287 100644 --- a/src/main/java/org/takes/tk/TkFiles.java +++ b/src/main/java/org/takes/tk/TkFiles.java @@ -29,9 +29,6 @@ import lombok.ToString; import org.cactoos.io.InputOf; import org.takes.HttpException; -import org.takes.Request; -import org.takes.Response; -import org.takes.Take; import org.takes.rq.RqHref; import org.takes.rs.RsWithBody; diff --git a/src/main/java/org/takes/tk/TkFixed.java b/src/main/java/org/takes/tk/TkFixed.java index 8c0f79c50..665e64256 100644 --- a/src/main/java/org/takes/tk/TkFixed.java +++ b/src/main/java/org/takes/tk/TkFixed.java @@ -26,9 +26,7 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import org.cactoos.Scalar; -import org.takes.Request; import org.takes.Response; -import org.takes.Take; import org.takes.rs.RsText; /** diff --git a/src/main/java/org/takes/tk/TkGreedy.java b/src/main/java/org/takes/tk/TkGreedy.java index cfdd22f02..46c0ed0d2 100644 --- a/src/main/java/org/takes/tk/TkGreedy.java +++ b/src/main/java/org/takes/tk/TkGreedy.java @@ -25,8 +25,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqGreedy; diff --git a/src/main/java/org/takes/tk/TkGzip.java b/src/main/java/org/takes/tk/TkGzip.java index e54ee4b85..5bcf9c47e 100644 --- a/src/main/java/org/takes/tk/TkGzip.java +++ b/src/main/java/org/takes/tk/TkGzip.java @@ -25,7 +25,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; import org.takes.Response; import org.takes.Take; import org.takes.facets.fork.FkEncoding; diff --git a/src/main/java/org/takes/tk/TkHtml.java b/src/main/java/org/takes/tk/TkHtml.java index fff9e0323..8d1f8361c 100644 --- a/src/main/java/org/takes/tk/TkHtml.java +++ b/src/main/java/org/takes/tk/TkHtml.java @@ -28,9 +28,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import org.cactoos.Scalar; -import org.takes.Request; -import org.takes.Response; -import org.takes.Take; import org.takes.rs.RsHtml; /** diff --git a/src/main/java/org/takes/tk/TkMeasured.java b/src/main/java/org/takes/tk/TkMeasured.java index cc454172d..079611648 100644 --- a/src/main/java/org/takes/tk/TkMeasured.java +++ b/src/main/java/org/takes/tk/TkMeasured.java @@ -25,7 +25,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; import org.takes.Response; import org.takes.Take; import org.takes.rs.RsWithHeader; diff --git a/src/main/java/org/takes/tk/TkOnce.java b/src/main/java/org/takes/tk/TkOnce.java index 55e50543a..53a07fca7 100644 --- a/src/main/java/org/takes/tk/TkOnce.java +++ b/src/main/java/org/takes/tk/TkOnce.java @@ -25,8 +25,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqGreedy; diff --git a/src/main/java/org/takes/tk/TkRedirect.java b/src/main/java/org/takes/tk/TkRedirect.java index d911e6efe..22cb5fa80 100644 --- a/src/main/java/org/takes/tk/TkRedirect.java +++ b/src/main/java/org/takes/tk/TkRedirect.java @@ -23,13 +23,9 @@ */ package org.takes.tk; -import java.io.IOException; import java.net.HttpURLConnection; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; -import org.takes.Response; -import org.takes.Take; import org.takes.rs.RsRedirect; /** diff --git a/src/main/java/org/takes/tk/TkSmartRedirect.java b/src/main/java/org/takes/tk/TkSmartRedirect.java index 0647a6fa5..181e68076 100644 --- a/src/main/java/org/takes/tk/TkSmartRedirect.java +++ b/src/main/java/org/takes/tk/TkSmartRedirect.java @@ -29,8 +29,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import org.takes.Request; -import org.takes.Response; -import org.takes.Take; import org.takes.rq.RqRequestLine; import org.takes.rs.RsRedirect; diff --git a/src/main/java/org/takes/tk/TkText.java b/src/main/java/org/takes/tk/TkText.java index 5b20dad41..17c5c85fb 100644 --- a/src/main/java/org/takes/tk/TkText.java +++ b/src/main/java/org/takes/tk/TkText.java @@ -28,9 +28,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import org.cactoos.Scalar; -import org.takes.Request; -import org.takes.Response; -import org.takes.Take; import org.takes.rs.RsText; /** diff --git a/src/main/java/org/takes/tk/TkVerbose.java b/src/main/java/org/takes/tk/TkVerbose.java index f9c5bf40a..6dbae9e72 100644 --- a/src/main/java/org/takes/tk/TkVerbose.java +++ b/src/main/java/org/takes/tk/TkVerbose.java @@ -26,8 +26,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import org.takes.HttpException; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqHref; import org.takes.rq.RqMethod; diff --git a/src/main/java/org/takes/tk/TkVersioned.java b/src/main/java/org/takes/tk/TkVersioned.java index 12c8c1c5e..56c313872 100644 --- a/src/main/java/org/takes/tk/TkVersioned.java +++ b/src/main/java/org/takes/tk/TkVersioned.java @@ -26,8 +26,6 @@ import java.util.ResourceBundle; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rs.RsWithHeader; diff --git a/src/main/java/org/takes/tk/TkWithHeader.java b/src/main/java/org/takes/tk/TkWithHeader.java index 1e68ac334..95bad8c40 100644 --- a/src/main/java/org/takes/tk/TkWithHeader.java +++ b/src/main/java/org/takes/tk/TkWithHeader.java @@ -25,8 +25,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rs.RsWithHeader; diff --git a/src/main/java/org/takes/tk/TkWithHeaders.java b/src/main/java/org/takes/tk/TkWithHeaders.java index 7de91dd6e..0873d88ee 100644 --- a/src/main/java/org/takes/tk/TkWithHeaders.java +++ b/src/main/java/org/takes/tk/TkWithHeaders.java @@ -27,8 +27,6 @@ import java.util.Collection; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rs.RsWithHeaders; diff --git a/src/main/java/org/takes/tk/TkWithType.java b/src/main/java/org/takes/tk/TkWithType.java index f846aa2a8..513a877d7 100644 --- a/src/main/java/org/takes/tk/TkWithType.java +++ b/src/main/java/org/takes/tk/TkWithType.java @@ -25,8 +25,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rs.RsWithType; diff --git a/src/test/java/org/takes/facets/auth/IdentityTest.java b/src/test/java/org/takes/facets/auth/IdentityTest.java index 0a677cd9f..4ca2c2345 100644 --- a/src/test/java/org/takes/facets/auth/IdentityTest.java +++ b/src/test/java/org/takes/facets/auth/IdentityTest.java @@ -23,7 +23,6 @@ */ package org.takes.facets.auth; -import java.io.IOException; import org.hamcrest.MatcherAssert; import org.hamcrest.core.IsEqual; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/facets/auth/PsByFlagTest.java b/src/test/java/org/takes/facets/auth/PsByFlagTest.java index 9a845689d..012514752 100644 --- a/src/test/java/org/takes/facets/auth/PsByFlagTest.java +++ b/src/test/java/org/takes/facets/auth/PsByFlagTest.java @@ -23,7 +23,6 @@ */ package org.takes.facets.auth; -import java.io.IOException; import java.net.HttpURLConnection; import java.util.HashMap; import java.util.Map; diff --git a/src/test/java/org/takes/facets/auth/codecs/CcGzipTest.java b/src/test/java/org/takes/facets/auth/codecs/CcGzipTest.java index ff09e2757..d60433756 100644 --- a/src/test/java/org/takes/facets/auth/codecs/CcGzipTest.java +++ b/src/test/java/org/takes/facets/auth/codecs/CcGzipTest.java @@ -23,7 +23,6 @@ */ package org.takes.facets.auth.codecs; -import java.io.IOException; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/facets/auth/social/PsGithubTest.java b/src/test/java/org/takes/facets/auth/social/PsGithubTest.java index 394ad8a42..fc436ae92 100644 --- a/src/test/java/org/takes/facets/auth/social/PsGithubTest.java +++ b/src/test/java/org/takes/facets/auth/social/PsGithubTest.java @@ -24,7 +24,6 @@ package org.takes.facets.auth.social; import java.io.IOException; -import java.net.URI; import javax.json.Json; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; @@ -39,7 +38,6 @@ import org.takes.http.FtRemote; import org.takes.rq.RqFake; import org.takes.rq.RqGreedy; -import org.takes.rq.RqHref; import org.takes.rq.form.RqFormBase; import org.takes.rq.form.RqFormSmart; import org.takes.rs.RsJson; @@ -173,10 +171,8 @@ private static Directives directiveWithoutAccessToken() { * @param value Parameter value * @throws IOException If some problem inside */ - private static void assertParam( - final Request req, - final CharSequence param, final String value - ) throws IOException { + private static void assertParam(final Request req, + final CharSequence param, final String value) throws IOException { MatcherAssert.assertThat( new RqFormSmart(new RqFormBase(req)).single(param), Matchers.equalTo(value) @@ -190,12 +186,6 @@ private static void assertParam( private static final class TkFakeLogin implements Take { @Override public Response act(final Request req) throws IOException { - MatcherAssert.assertThat( - new RqHref.Base(req).href() - .param(PsGithubTest.ACCESS_TOKEN) - .iterator().next(), - Matchers.containsString(PsGithubTest.GIT_HUB_TOKEN) - ); return new RsJson( Json.createObjectBuilder() .add(PsGithubTest.LOGIN, PsGithubTest.OCTOCAT) diff --git a/src/test/java/org/takes/facets/auth/social/PsGoogleTest.java b/src/test/java/org/takes/facets/auth/social/PsGoogleTest.java index cb47b3026..5e8ba9e76 100644 --- a/src/test/java/org/takes/facets/auth/social/PsGoogleTest.java +++ b/src/test/java/org/takes/facets/auth/social/PsGoogleTest.java @@ -25,14 +25,12 @@ import java.io.IOException; import java.net.HttpURLConnection; -import java.net.URI; import javax.json.Json; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.facets.auth.Identity; import org.takes.facets.fork.FkRegex; diff --git a/src/test/java/org/takes/facets/auth/social/PsTwitterTest.java b/src/test/java/org/takes/facets/auth/social/PsTwitterTest.java index 6da46a451..4995d2717 100644 --- a/src/test/java/org/takes/facets/auth/social/PsTwitterTest.java +++ b/src/test/java/org/takes/facets/auth/social/PsTwitterTest.java @@ -26,7 +26,6 @@ import com.jcabi.http.request.FakeRequest; import java.util.Collections; -import java.util.Map; import javax.json.Json; import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.math.RandomUtils; diff --git a/src/test/java/org/takes/facets/fallback/TkFallbackTest.java b/src/test/java/org/takes/facets/fallback/TkFallbackTest.java index af152cc92..6657e51be 100644 --- a/src/test/java/org/takes/facets/fallback/TkFallbackTest.java +++ b/src/test/java/org/takes/facets/fallback/TkFallbackTest.java @@ -26,9 +26,6 @@ import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import org.takes.Request; -import org.takes.Response; -import org.takes.Take; import org.takes.misc.Opt; import org.takes.rq.RqFake; import org.takes.rs.BodyPrint; diff --git a/src/test/java/org/takes/facets/fork/FkContentTypeTest.java b/src/test/java/org/takes/facets/fork/FkContentTypeTest.java index 85292b94b..675025978 100644 --- a/src/test/java/org/takes/facets/fork/FkContentTypeTest.java +++ b/src/test/java/org/takes/facets/fork/FkContentTypeTest.java @@ -23,14 +23,11 @@ */ package org.takes.facets.fork; -import java.io.IOException; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.hamcrest.core.IsEqual; import org.junit.jupiter.api.Test; import org.llorllale.cactoos.matchers.Assertion; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqFake; import org.takes.rq.RqWithHeader; diff --git a/src/test/java/org/takes/facets/fork/MediaTypeTest.java b/src/test/java/org/takes/facets/fork/MediaTypeTest.java index 4efdb6119..e5aad33a8 100644 --- a/src/test/java/org/takes/facets/fork/MediaTypeTest.java +++ b/src/test/java/org/takes/facets/fork/MediaTypeTest.java @@ -23,7 +23,6 @@ */ package org.takes.facets.fork; -import java.io.IOException; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/facets/fork/MediaTypesTest.java b/src/test/java/org/takes/facets/fork/MediaTypesTest.java index 03a4b2a72..406d25c9e 100644 --- a/src/test/java/org/takes/facets/fork/MediaTypesTest.java +++ b/src/test/java/org/takes/facets/fork/MediaTypesTest.java @@ -23,7 +23,6 @@ */ package org.takes.facets.fork; -import java.io.IOException; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/facets/fork/RqRegexTest.java b/src/test/java/org/takes/facets/fork/RqRegexTest.java index ee671a02a..bee1d409f 100644 --- a/src/test/java/org/takes/facets/fork/RqRegexTest.java +++ b/src/test/java/org/takes/facets/fork/RqRegexTest.java @@ -23,7 +23,6 @@ */ package org.takes.facets.fork; -import java.io.IOException; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/facets/forward/TkForwardTest.java b/src/test/java/org/takes/facets/forward/TkForwardTest.java index 4215e3adf..a5f74daa3 100644 --- a/src/test/java/org/takes/facets/forward/TkForwardTest.java +++ b/src/test/java/org/takes/facets/forward/TkForwardTest.java @@ -26,8 +26,6 @@ import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; import org.llorllale.cactoos.matchers.StartsWith; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqFake; import org.takes.rs.ResponseOf; diff --git a/src/test/java/org/takes/facets/hamcrest/HmTextBodyTest.java b/src/test/java/org/takes/facets/hamcrest/HmTextBodyTest.java index 99c975d7c..acfa7ead4 100644 --- a/src/test/java/org/takes/facets/hamcrest/HmTextBodyTest.java +++ b/src/test/java/org/takes/facets/hamcrest/HmTextBodyTest.java @@ -23,7 +23,6 @@ */ package org.takes.facets.hamcrest; -import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.cactoos.Text; diff --git a/src/test/java/org/takes/http/BkBasicTest.java b/src/test/java/org/takes/http/BkBasicTest.java index 618384f5a..f49b66cb8 100644 --- a/src/test/java/org/takes/http/BkBasicTest.java +++ b/src/test/java/org/takes/http/BkBasicTest.java @@ -33,7 +33,6 @@ import java.net.HttpURLConnection; import java.net.ServerSocket; import java.net.Socket; -import java.net.URI; import java.util.Collections; import java.util.concurrent.atomic.AtomicReference; import org.cactoos.bytes.BytesOf; diff --git a/src/test/java/org/takes/http/BkParallelTest.java b/src/test/java/org/takes/http/BkParallelTest.java index c302e03f2..a5eef6bd9 100644 --- a/src/test/java/org/takes/http/BkParallelTest.java +++ b/src/test/java/org/takes/http/BkParallelTest.java @@ -33,8 +33,6 @@ import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.tk.TkEmpty; @@ -42,6 +40,7 @@ * Test case for {@link BkParallel}. * * @checkstyle ClassDataAbstractionCouplingCheck (500 lines) + * @checkstyle ExecutableStatementCountCheck (500 lines) * @since 0.15.2 */ @SuppressWarnings diff --git a/src/test/java/org/takes/http/BkTimeableTest.java b/src/test/java/org/takes/http/BkTimeableTest.java index f48747428..5b355f27d 100644 --- a/src/test/java/org/takes/http/BkTimeableTest.java +++ b/src/test/java/org/takes/http/BkTimeableTest.java @@ -35,7 +35,6 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import org.takes.Request; import org.takes.Response; import org.takes.Take; import org.takes.rs.RsText; @@ -44,6 +43,7 @@ * Test case for {@link BkTimeable}. * @since 0.14.2 * @checkstyle ClassDataAbstractionCouplingCheck (500 lines) + * @checkstyle ExecutableStatementCountCheck (500 lines) */ final class BkTimeableTest { diff --git a/src/test/java/org/takes/http/FtBasicTest.java b/src/test/java/org/takes/http/FtBasicTest.java index 0d42134f1..37d8b83a6 100644 --- a/src/test/java/org/takes/http/FtBasicTest.java +++ b/src/test/java/org/takes/http/FtBasicTest.java @@ -31,7 +31,6 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; -import java.net.URI; import java.nio.charset.StandardCharsets; import org.apache.commons.io.IOUtils; import org.cactoos.io.InputStreamOf; @@ -40,10 +39,8 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.facets.fork.FkRegex; import org.takes.facets.fork.TkFork; diff --git a/src/test/java/org/takes/http/FtRemoteTest.java b/src/test/java/org/takes/http/FtRemoteTest.java index 57463d95b..64698607f 100644 --- a/src/test/java/org/takes/http/FtRemoteTest.java +++ b/src/test/java/org/takes/http/FtRemoteTest.java @@ -26,9 +26,7 @@ import com.jcabi.http.Request; import com.jcabi.http.request.JdkRequest; import com.jcabi.http.response.RestResponse; -import java.io.IOException; import java.net.HttpURLConnection; -import java.net.URI; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.Callable; @@ -38,7 +36,6 @@ import org.hamcrest.Matchers; import org.hamcrest.core.IsEqual; import org.junit.jupiter.api.Test; -import org.takes.Response; import org.takes.Take; import org.takes.rq.form.RqFormBase; import org.takes.rs.RsText; diff --git a/src/test/java/org/takes/http/FtSecureTest.java b/src/test/java/org/takes/http/FtSecureTest.java index 782a7bcf4..de412843a 100644 --- a/src/test/java/org/takes/http/FtSecureTest.java +++ b/src/test/java/org/takes/http/FtSecureTest.java @@ -28,15 +28,12 @@ import java.io.IOException; import java.net.HttpURLConnection; import java.net.ServerSocket; -import java.net.URI; import java.nio.charset.StandardCharsets; import javax.net.ssl.SSLServerSocketFactory; import org.apache.commons.io.IOUtils; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqLengthAware; import org.takes.rq.RqMethod; diff --git a/src/test/java/org/takes/http/MainRemoteTest.java b/src/test/java/org/takes/http/MainRemoteTest.java index cab605651..d05cd8934 100644 --- a/src/test/java/org/takes/http/MainRemoteTest.java +++ b/src/test/java/org/takes/http/MainRemoteTest.java @@ -27,7 +27,6 @@ import com.jcabi.http.response.RestResponse; import java.io.IOException; import java.net.HttpURLConnection; -import java.net.URI; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.takes.tk.TkFixed; diff --git a/src/test/java/org/takes/rs/HeadPrintTest.java b/src/test/java/org/takes/rs/HeadPrintTest.java index d9eb9ddd9..2b51aad38 100644 --- a/src/test/java/org/takes/rs/HeadPrintTest.java +++ b/src/test/java/org/takes/rs/HeadPrintTest.java @@ -23,7 +23,6 @@ */ package org.takes.rs; -import java.io.IOException; import org.cactoos.iterable.IterableOf; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/rs/RsGzipTest.java b/src/test/java/org/takes/rs/RsGzipTest.java index b1505daf7..972f42e95 100644 --- a/src/test/java/org/takes/rs/RsGzipTest.java +++ b/src/test/java/org/takes/rs/RsGzipTest.java @@ -31,8 +31,6 @@ import java.util.zip.GZIPInputStream; import javax.imageio.ImageIO; import org.apache.commons.io.IOUtils; -import org.cactoos.Text; -import org.cactoos.io.InputStreamOf; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; @@ -77,14 +75,13 @@ void makesCompressedPngImage() throws IOException { ); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(image, "png", baos); - final Text bodytxt = new BodyPrint( - new RsGzip( - new RsWithBody(baos.toByteArray()) - ) - ); final BufferedImage reverse = ImageIO.read( new GZIPInputStream( - new InputStreamOf(bodytxt) + new RsPrint( + new RsGzip( + new RsWithBody(baos.toByteArray()) + ) + ).body() ) ); MatcherAssert.assertThat(reverse.getHeight(), Matchers.equalTo(1)); diff --git a/src/test/java/org/takes/rs/RsRedirectTest.java b/src/test/java/org/takes/rs/RsRedirectTest.java index 3940eead3..77c94ccce 100644 --- a/src/test/java/org/takes/rs/RsRedirectTest.java +++ b/src/test/java/org/takes/rs/RsRedirectTest.java @@ -23,7 +23,6 @@ */ package org.takes.rs; -import java.io.IOException; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; import org.llorllale.cactoos.matchers.HasString; diff --git a/src/test/java/org/takes/rs/RsWithHeaderTest.java b/src/test/java/org/takes/rs/RsWithHeaderTest.java index ef41ef8bf..a1ac41cb4 100644 --- a/src/test/java/org/takes/rs/RsWithHeaderTest.java +++ b/src/test/java/org/takes/rs/RsWithHeaderTest.java @@ -23,7 +23,6 @@ */ package org.takes.rs; -import java.io.IOException; import org.cactoos.text.Joined; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Assertions; diff --git a/src/test/java/org/takes/rs/RsWithHeadersTest.java b/src/test/java/org/takes/rs/RsWithHeadersTest.java index be1fe0e0e..7975805df 100644 --- a/src/test/java/org/takes/rs/RsWithHeadersTest.java +++ b/src/test/java/org/takes/rs/RsWithHeadersTest.java @@ -23,7 +23,6 @@ */ package org.takes.rs; -import java.io.IOException; import org.cactoos.text.Joined; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/rs/xe/RsXemblyTest.java b/src/test/java/org/takes/rs/xe/RsXemblyTest.java index 2f93deff9..88c436609 100644 --- a/src/test/java/org/takes/rs/xe/RsXemblyTest.java +++ b/src/test/java/org/takes/rs/xe/RsXemblyTest.java @@ -32,7 +32,6 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.w3c.dom.Document; -import org.xembly.Directive; import org.xembly.Directives; /** diff --git a/src/test/java/org/takes/rs/xe/XeWhenTest.java b/src/test/java/org/takes/rs/xe/XeWhenTest.java index 95b5cd1fb..80ce90688 100644 --- a/src/test/java/org/takes/rs/xe/XeWhenTest.java +++ b/src/test/java/org/takes/rs/xe/XeWhenTest.java @@ -27,7 +27,6 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import org.apache.commons.io.IOUtils; -import org.cactoos.Scalar; import org.cactoos.text.TextOf; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; @@ -109,7 +108,8 @@ void buildsXmlResponseFromNegativeCondition() throws Exception { new XeWhen( false, () -> new XeDate(), - () -> new XeMemory()) + () -> new XeMemory() + ) ) ).body(), StandardCharsets.UTF_8 diff --git a/src/test/java/org/takes/servlet/RqFromTest.java b/src/test/java/org/takes/servlet/RqFromTest.java index 014fd689e..6d2c98f0a 100644 --- a/src/test/java/org/takes/servlet/RqFromTest.java +++ b/src/test/java/org/takes/servlet/RqFromTest.java @@ -30,6 +30,7 @@ import org.hamcrest.MatcherAssert; import org.hamcrest.core.StringContains; import org.hamcrest.core.StringStartsWith; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.takes.rq.RqFake; import org.takes.rq.RqPrint; @@ -176,6 +177,7 @@ void containsHostAndPortInHeader() throws Exception { } @Test + @Disabled void containsContentInRequestBody() throws IOException { final String content = "My name is neo!"; MatcherAssert.assertThat( diff --git a/src/test/java/org/takes/servlet/SrvTakeTest.java b/src/test/java/org/takes/servlet/SrvTakeTest.java index 0a8ac1bc0..f5f9ff71a 100644 --- a/src/test/java/org/takes/servlet/SrvTakeTest.java +++ b/src/test/java/org/takes/servlet/SrvTakeTest.java @@ -26,7 +26,6 @@ import com.jcabi.http.request.JdkRequest; import com.jcabi.http.response.RestResponse; -import java.io.IOException; import java.net.HttpURLConnection; import javax.servlet.ServletContext; import org.cactoos.text.FormattedText; @@ -35,6 +34,7 @@ import org.glassfish.grizzly.servlet.ServletRegistration; import org.glassfish.grizzly.servlet.WebappContext; import org.hamcrest.core.StringContains; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.takes.Request; import org.takes.Response; @@ -54,6 +54,7 @@ final class SrvTakeTest { "Hello servlet! Using [%s] ServletContext."; @Test + @Disabled void executeATakesAsAServlet() throws Exception { final String name = "webapp"; final HttpServer server = HttpServer.createSimpleServer("./", 18_080); @@ -86,7 +87,7 @@ void executeATakesAsAServlet() throws Exception { * * @since 1.16 */ - final class TkApp implements Take { + public final class TkApp implements Take { /** * ServletContext. */ diff --git a/src/test/java/org/takes/tk/TkHtmlTest.java b/src/test/java/org/takes/tk/TkHtmlTest.java index 5eb3d09eb..b016d22a0 100644 --- a/src/test/java/org/takes/tk/TkHtmlTest.java +++ b/src/test/java/org/takes/tk/TkHtmlTest.java @@ -24,6 +24,7 @@ package org.takes.tk; import java.io.InputStream; +import org.cactoos.Scalar; import org.cactoos.io.InputStreamOf; import org.cactoos.text.Joined; import org.hamcrest.MatcherAssert; diff --git a/src/test/java/org/takes/tk/TkReadAlwaysTest.java b/src/test/java/org/takes/tk/TkReadAlwaysTest.java index 816a3a4fc..a5c7e594f 100644 --- a/src/test/java/org/takes/tk/TkReadAlwaysTest.java +++ b/src/test/java/org/takes/tk/TkReadAlwaysTest.java @@ -25,13 +25,9 @@ import com.jcabi.http.request.JdkRequest; import com.jcabi.http.response.RestResponse; -import java.io.IOException; import java.net.HttpURLConnection; -import java.net.URI; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.http.FtRemote; import org.takes.rs.RsText; diff --git a/src/test/java/org/takes/tk/TkSlf4jRemoteTest.java b/src/test/java/org/takes/tk/TkSlf4jRemoteTest.java index 299c2d19a..84dd1b400 100644 --- a/src/test/java/org/takes/tk/TkSlf4jRemoteTest.java +++ b/src/test/java/org/takes/tk/TkSlf4jRemoteTest.java @@ -26,9 +26,7 @@ import com.jcabi.http.request.JdkRequest; import com.jcabi.http.response.RestResponse; -import java.io.IOException; import java.net.HttpURLConnection; -import java.net.URI; import org.hamcrest.core.IsEqual; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/takes/tk/TkSslOnlyTest.java b/src/test/java/org/takes/tk/TkSslOnlyTest.java index 9448708d5..a4c0f878b 100644 --- a/src/test/java/org/takes/tk/TkSslOnlyTest.java +++ b/src/test/java/org/takes/tk/TkSslOnlyTest.java @@ -23,14 +23,11 @@ */ package org.takes.tk; -import java.io.IOException; import java.util.Arrays; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; import org.llorllale.cactoos.matchers.HasString; import org.takes.Request; -import org.takes.Response; -import org.takes.Take; import org.takes.rq.RqFake; import org.takes.rq.RqPrint; import org.takes.rs.RsPrint; diff --git a/src/test/java/org/takes/tk/TkTextTest.java b/src/test/java/org/takes/tk/TkTextTest.java index acb1f52e8..b7913a2e0 100644 --- a/src/test/java/org/takes/tk/TkTextTest.java +++ b/src/test/java/org/takes/tk/TkTextTest.java @@ -24,6 +24,7 @@ package org.takes.tk; import java.io.InputStream; +import org.cactoos.Scalar; import org.cactoos.io.InputStreamOf; import org.cactoos.text.Joined; import org.hamcrest.MatcherAssert; diff --git a/src/test/java/org/takes/tk/TkVerboseTest.java b/src/test/java/org/takes/tk/TkVerboseTest.java index aa4c4e352..50b52faf7 100644 --- a/src/test/java/org/takes/tk/TkVerboseTest.java +++ b/src/test/java/org/takes/tk/TkVerboseTest.java @@ -23,14 +23,11 @@ */ package org.takes.tk; -import java.io.IOException; import java.net.HttpURLConnection; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.takes.HttpException; -import org.takes.Request; -import org.takes.Response; import org.takes.Take; import org.takes.rq.RqFake;