-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
import org.xembly.Xembler; | ||
|
||
/** | ||
* SVG with pulse. | ||
* PNG with pulse. | ||
* | ||
* @author Yegor Bugayenko ([email protected]) | ||
* @version $Id$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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", | ||
}; | ||
|
@@ -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); | ||
} | ||
} | ||
|
||
|