use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method testNotFoundDisplaysWithIframeANDSpecialUrl.
@Test
public void testNotFoundDisplaysWithIframeANDSpecialUrl() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/notFound");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_404_NOTFOUND);
//platform should convert request into a development not found page which has an iframe
//of the original page with a query param to tell platform to display original
//page requested
response.assertContains("<iframe src=\"/notFound?webpiecesShowPage=true");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method testNotFoundFilterModified.
@Test
public void testNotFoundFilterModified() throws IOException {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/enableFilter?webpiecesShowPage=true");
http11Socket.send(req);
verify303("http://myhost.com/home");
simulateDeveloperMakesChanges("src/test/devServerTest/notFound");
http11Socket.send(req);
verify303("http://myhost.com/filter");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestHttps method testSameRouteHttpAndHttpsCorrectOrder.
@Test
public void testSameRouteHttpAndHttpsCorrectOrder() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/same2");
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("Https Route");
httpSocket.send(req);
response = ResponseExtract.assertSingleResponse(httpSocket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("Http Route");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestHttps method testSecureAndLoggedInAlready.
@Test
public void testSecureAndLoggedInAlready() {
Header cookie = simulateLogin();
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/secure/internal");
req.addHeader(cookie);
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
//before we can show you the page, you need to be logged in, redirect to login page...
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("This is some home page");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestHttps method testSecureLoginNotFoundHttpsPage.
@Test
public void testSecureLoginNotFoundHttpsPage() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/secure/notFoundPage");
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
//Even though the page doesn't exist, we redirect all /secure/* to login page
response.assertStatusCode(KnownStatusCode.HTTP_303_SEEOTHER);
}
Aggregations