Permalink
Browse files

Switch deltaspike to official release

  • Loading branch information...
1 parent 4911267 commit d3e7b7683d309f4b4f8efd159a9108ca00e5cb49 @abstractj committed Apr 30, 2012
Showing with 25 additions and 7 deletions.
  1. +4 −4 pom.xml
  2. +21 −3 src/test/java/org/jboss/aerogear/security/integration/AuthenticationHandlerIT.java
View
@@ -86,22 +86,22 @@
<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-security-module-api</artifactId>
- <version>0.2-incubating-SNAPSHOT</version>
+ <version>0.2-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-security-module-impl</artifactId>
- <version>0.2-incubating-SNAPSHOT</version>
+ <version>0.2-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.deltaspike.core</groupId>
<artifactId>deltaspike-core-api</artifactId>
- <version>0.2-incubating-SNAPSHOT</version>
+ <version>0.2-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.deltaspike.core</groupId>
<artifactId>deltaspike-core-impl</artifactId>
- <version>0.2-incubating-SNAPSHOT</version>
+ <version>0.2-incubating</version>
</dependency>
</dependencies>
@@ -1,6 +1,8 @@
package org.jboss.aerogear.security.integration;
import org.apache.deltaspike.security.api.credential.CredentialAuthInfo;
+import org.jboss.aerogear.security.idm.auth.Credential;
+import org.jboss.aerogear.security.idm.event.LoginEvent;
import org.jboss.aerogear.security.idm.handler.AuthenticationHandler;
import org.jboss.aerogear.security.idm.handler.AuthenticationHandlerImpl;
import org.jboss.aerogear.security.idm.persistence.RoleRegistry;
@@ -44,12 +46,28 @@ public static JavaArchive createDeployment() {
}
@Test
- public void testIsCredentialValid() throws Exception {
+ public void testListenToLogin() throws Exception {
User user = new User("john", "doe");
userRegistry.newUser(user);
- CredentialAuthInfo info = new CredentialAuthInfoImpl("john", "doe");
- assertTrue("Credential should be valid", handler.isCredentialValid(info));
+ handler.listenToLogin(new LoginEvent(buildCredential("john", "doe")));
+ }
+
+ //Fixture
+ private Credential buildCredential(final String login, final String password){
+ return new Credential<String>() {
+
+ @Override
+ public String getPassword() {
+ return password;
+ }
+
+ @Override
+ public String getUsername() {
+ return login;
+ }
+ };
+
}
}

0 comments on commit d3e7b76

Please sign in to comment.