use of org.jvnet.hudson.test.recipes.PresetData in project jenkins by jenkinsci.
the class LoginRedirectTest method redirect2.
/*
* Verifies that HTTP 403 is sent first. This is important for machine agents.
*/
@PresetData(DataSet.NO_ANONYMOUS_READACCESS)
@Test
public void redirect2() throws Exception {
WebClient wc = j.createWebClient();
wc.assertFails("", HttpURLConnection.HTTP_FORBIDDEN);
}
use of org.jvnet.hudson.test.recipes.PresetData in project jenkins by jenkinsci.
the class LoginTest method loginDisabledRememberMe.
/**
* Test that 'remember me' cookie will not be set if disabled even if requested by user.
* This models the case when the feature is disabled between another user loading and submitting the login page.
*/
@Test
@PresetData(DataSet.SECURED_ACEGI)
public void loginDisabledRememberMe() throws Exception {
WebClient wc = j.createWebClient();
HtmlForm form = prepareLoginFormWithRememberMeChecked(wc);
j.jenkins.setDisableRememberMe(true);
HtmlFormUtil.submit(form, null);
assertNull(getRememberMeCookie(wc));
}
use of org.jvnet.hudson.test.recipes.PresetData in project implied-labels-plugin by jenkinsci.
the class ConfigTest method notAuthorizedToRead.
@PresetData(DataSet.NO_ANONYMOUS_READACCESS)
@Test
public void notAuthorizedToRead() throws Exception {
WebClient wc = j.createWebClient();
try {
wc.getOptions().setPrintContentOnFailingStatusCode(false);
wc.goTo("label-implications");
} catch (FailingHttpStatusCodeException ex) {
assertThat(ex.getStatusMessage(), equalTo("Forbidden"));
}
}
Aggregations