Skip to content

Commit

Permalink
#1378 test enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 15, 2022
1 parent 7522a0d commit 45dea59
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/rultor/web/TkTicks.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import org.xembly.Xembler;

/**
* SVG with pulse.
* PNG with pulse.
*
* @author Yegor Bugayenko ([email protected])
* @version $Id$
Expand Down
29 changes: 22 additions & 7 deletions src/test/java/com/rultor/web/TkHomeITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@
import org.apache.http.HttpHeaders;
import org.junit.Assume;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
* Integration case for {@link HomeRs}.
* Integration case for {@link TkHome}.
* @author Yegor Bugayenko ([email protected])
* @version $Id$
* @since 0.5
Expand All @@ -67,10 +66,8 @@ public static void before() {
* @throws Exception If some problem inside
*/
@Test
@Disabled
public void renderAbsentPages() throws Exception {
final String[] pages = {
"/page-doesnt-exist",
"/xsl/xsl-stylesheet-doesnt-exist.xsl",
"/css/stylesheet-is-absent.css",
};
Expand All @@ -80,9 +77,27 @@ public void renderAbsentPages() throws Exception {
.method(Request.GET)
.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_NOT_FOUND)
.as(XmlResponse.class)
.assertXPath("//xhtml:title[contains(.,'page not found')]");
.assertStatus(HttpURLConnection.HTTP_NOT_FOUND);
}
}

/**
* Redirects from absent URL.
* @throws Exception If some problem inside
*/
@Test
public void redirectsOnAbsence() throws Exception {
final String[] pages = {
"/page-doesnt-exist",
"/oops",
};
final Request request = new JdkRequest(TkHomeITCase.HOME);
for (final String page : pages) {
request.uri().path(page).back()
.method(Request.GET)
.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_SEE_OTHER);
}
}

Expand Down

0 comments on commit 45dea59

Please sign in to comment.