use of org.webpieces.plugin.secure.sslcert.acme.AcmeInfo in project webpieces by deanhiller.
the class TestSslSetup method testAlreadyLoggedInAndFirstTimeNoProperties.
@Test
public void testAlreadyLoggedInAndFirstTimeNoProperties() throws MalformedURLException {
URI terms = URI.create("http://somerandom.com/place");
URL website = new URL("http://website.com");
mockStorage.addReadResponse(XFuture.completedFuture(new HashMap<>()));
HttpFullRequest req = Requests.createRequest(KnownHttpMethod.GET, "/@sslcert");
// response from logging in taken from TestLogin in backend plugin test suite
// set-cookie: webSession=1-xjrs6SeNeSxmJQtaTwM8gDorNiQ=:backendUser=admin; path=/; HttpOnly
req.addHeader(new Header(KnownHeaderName.COOKIE, "webSession=1-xjrs6SeNeSxmJQtaTwM8gDorNiQ=:backendUser=admin"));
mockAcmeClient.setRemoteInfo(XFuture.completedFuture(new AcmeInfo(terms, website)));
XFuture<HttpFullResponse> respFuture = https11Socket.send(req);
ResponseWrapper response = ResponseExtract.waitResponseAndWrap(respFuture);
// redirect to the login page in the backend plugin...
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("You Must agree to the terms found at");
}
use of org.webpieces.plugin.secure.sslcert.acme.AcmeInfo in project webpieces by deanhiller.
the class TestFullSslSetupWizard method renderFirstPage.
private void renderFirstPage(String url) throws MalformedURLException {
URI terms = URI.create("http://somerandom.com/place");
URL website = new URL("http://website.com");
mockAcmeClient.setRemoteInfo(XFuture.completedFuture(new AcmeInfo(terms, website)));
HttpFullRequest req = Requests.createRequest(KnownHttpMethod.GET, url);
// response from logging in taken from TestLogin in backend plugin test suite
// set-cookie: webSession=1-xjrs6SeNeSxmJQtaTwM8gDorNiQ=:backendUser=admin; path=/; HttpOnly
req.addHeader(new Header(KnownHeaderName.COOKIE, "webSession=1-xjrs6SeNeSxmJQtaTwM8gDorNiQ=:backendUser=admin"));
XFuture<HttpFullResponse> respFuture = https11Socket.send(req);
ResponseWrapper response = ResponseExtract.waitResponseAndWrap(respFuture);
// redirect to the login page in the backend plugin...
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("You Must agree to the terms found at");
response.assertContains(terms + "");
}
Aggregations