use of org.webpieces.webserver.test.FullResponse in project webpieces by deanhiller.
the class TestDomainMatching method testDomain1RequestDomain1RouteWithPort.
@Test
public void testDomain1RequestDomain1RouteWithPort() {
HttpRequest req = Requests.createGetRequest("mydomain.com:9000", "/domain1");
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("This is domain1");
}
use of org.webpieces.webserver.test.FullResponse in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method verifyPageContents.
private void verifyPageContents(String contents) {
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains(contents);
}
use of org.webpieces.webserver.test.FullResponse in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method verify500PageContents.
private void verify500PageContents(String contents) {
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_500_INTERNAL_SVR_ERROR);
response.assertContains(contents);
}
use of org.webpieces.webserver.test.FullResponse 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.webserver.test.FullResponse 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");
}
Aggregations