use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestDomainMatching method testStaticFileFromDomain2.
@Test
public void testStaticFileFromDomain2() {
HttpRequest req = Requests.createGetRequest("domain2.com", "/public/myfile");
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("org.webpieces.webserver");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestDomainMatching method testDomain2RequestDomain1Route.
@Test
public void testDomain2RequestDomain1Route() {
HttpRequest req = Requests.createGetRequest("domain2.com", "/domain1");
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
response.assertStatusCode(KnownStatusCode.HTTP_404_NOTFOUND);
response.assertContains("Your page was not found");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestDomainMatching method testStaticDirFromDomain2.
@Test
public void testStaticDirFromDomain2() {
HttpRequest req = Requests.createGetRequest("domain2.com", "/public/asyncMeta.txt");
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("org.webpieces.webserver");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestJson method testReadOnly.
@Test
public void testReadOnly() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/json/read");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("{`searchTime`:1,`matches`:[]}".replace("`", "\""));
response.assertContentType("application/json");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestDomainMatching method testStaticDirFromDomain1.
@Test
public void testStaticDirFromDomain1() {
HttpRequest req = Requests.createGetRequest("mydomain.com", "/public/asyncMeta.txt");
httpsSocket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(httpsSocket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("org.webpieces.webserver");
}
Aggregations