Examples of shouldHaveCorrectFields()


Examples of org.jamesdbloom.acceptance.login.LoginPage.shouldHaveCorrectFields()

        // when - hit secured page
        HttpResponse landingPageResponse = httpClient.execute(new HttpGet("http://127.0.0.1:8080/"));

        // then - login page is displayed
        LoginPage securePageResponse = new LoginPage(getBodyAndClose(landingPageResponse));
        securePageResponse.shouldHaveCorrectFields();
        csrf = securePageResponse.csrfValue();

        // when - login is performed
        HttpPost login = new HttpPost("https://127.0.0.1:8443/login");
        login.setEntity(new UrlEncodedFormEntity(Arrays.asList(
View Full Code Here

Examples of org.jamesdbloom.acceptance.login.LoginPage.shouldHaveCorrectFields()

        httpClient = createApacheClient();
        HttpResponse logoutResponse = httpClient.execute(new HttpGet("https://127.0.0.1:8443/logout"));

        // then - should get redirected to login page
        LoginPage logoutRequestResponse = new LoginPage(getBodyAndClose(logoutResponse));
        logoutRequestResponse.shouldHaveCorrectFields();
    }

    private String getBodyAndClose(HttpResponse httpResponse) throws IOException {
        String body = EntityUtils.toString(httpResponse.getEntity());
        EntityUtils.consumeQuietly(httpResponse.getEntity());
View Full Code Here

Examples of org.jamesdbloom.acceptance.registration.RegistrationPage.shouldHaveCorrectFields()

        HttpClient httpClient = createApacheClient();

        // when - register
        HttpResponse registerPageResponse = httpClient.execute(new HttpGet("https://127.0.0.1:8443/register"));
        RegistrationPage registrationPage = new RegistrationPage(getBodyAndClose(registerPageResponse));
        registrationPage.shouldHaveCorrectFields();
        String csrf = registrationPage.csrfValue();

        HttpPost register = new HttpPost("https://127.0.0.1:8443/register");
        register.setEntity(new UrlEncodedFormEntity(Arrays.asList(
                new BasicNameValuePair("name", "test_user"),
View Full Code Here

Examples of org.jamesdbloom.acceptance.updatepassword.UpdatePasswordPage.shouldHaveCorrectFields()

        String updatePasswordURL = registrationEmail.shouldHaveCorrectFields("fake@email.com");

        // when - updating password
        HttpResponse updatePasswordPageResponse = httpClient.execute(new HttpGet(updatePasswordURL));
        UpdatePasswordPage updatePasswordPage = new UpdatePasswordPage(getBodyAndClose(updatePasswordPageResponse));
        updatePasswordPage.shouldHaveCorrectFields();
        csrf = updatePasswordPage.csrfValue();

        HttpPost updatePasswordRequest = new HttpPost(updatePasswordURL);
        updatePasswordRequest.setEntity(new UrlEncodedFormEntity(Arrays.asList(
                new BasicNameValuePair("password", "NewPassword123"),
View Full Code Here

Examples of org.jamesdbloom.email.NewRegistrationEmail.shouldHaveCorrectFields()

        TimeUnit.SECONDS.sleep(2);
        assertThat(wiser.getMessages(), is(not(empty())));
        WiserMessage registrationWiserMessage = wiser.getMessages().get(0);
        MimeMessage mimeMessage = registrationWiserMessage.getMimeMessage();
        NewRegistrationEmail registrationEmail = new NewRegistrationEmail(mimeMessage.getContent().toString());
        String updatePasswordURL = registrationEmail.shouldHaveCorrectFields("fake@email.com");

        // when - updating password
        HttpResponse updatePasswordPageResponse = httpClient.execute(new HttpGet(updatePasswordURL));
        UpdatePasswordPage updatePasswordPage = new UpdatePasswordPage(getBodyAndClose(updatePasswordPageResponse));
        updatePasswordPage.shouldHaveCorrectFields();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.