use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class FileAuthenticationHandlerTests method verifyFailsUserNotInFileWithDefaultSeparator.
@Test
public void verifyFailsUserNotInFileWithDefaultSeparator() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
c.setUsername("fds");
c.setPassword("rutgers");
this.thrown.expect(AccountNotFoundException.class);
this.thrown.expectMessage("fds not found in backing file.");
this.authenticationHandler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class FileAuthenticationHandlerTests method verifyAuthenticatesUserInFileWithDefaultSeparator.
@Test
public void verifyAuthenticatesUserInFileWithDefaultSeparator() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
c.setUsername("scott");
c.setPassword("rutgers");
assertNotNull(this.authenticationHandler.authenticate(c));
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class RejectUsersAuthenticationHandlerTests method verifySupportsProperUserCredentials.
@Test
public void verifySupportsProperUserCredentials() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
c.setUsername("fff");
c.setPassword("rutgers");
assertNotNull(this.authenticationHandler.authenticate(c));
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class RejectUsersAuthenticationHandlerTests method verifyPassesUserNotInMap.
@Test
public void verifyPassesUserNotInMap() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
c.setUsername("fds");
c.setPassword("rutgers");
assertNotNull(this.authenticationHandler.authenticate(c));
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class SearchModeSearchDatabaseAuthenticationHandlerTests method verifyNotFoundUser.
@Test
public void verifyNotFoundUser() throws Exception {
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("hello", "world");
this.thrown.expect(FailedLoginException.class);
this.thrown.expectMessage("hello not found with SQL query.");
this.handler.authenticate(c);
}
Aggregations