Skip to content
Snippets Groups Projects
Commit 7f908158 authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

Merge branch 'feature/authentication' into develop

parents 074f5f8e f8f84fe6
No related branches found
No related tags found
No related merge requests found
package fr.univtln.bruno.samples.jaxrs.security;
import org.junit.Test;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.EnumSet;
import static org.junit.Assert.assertTrue;
public class UserTest {
@Test
public void testBuilder() throws InvalidKeySpecException, NoSuchAlgorithmException {
String lastname="Doe", firstname="John", email="j.d@here.com", password="mypass";
User user = User.builder()
.lastName(lastname)
.firstName(firstname)
.email(email)
.password(password)
.roles(EnumSet.of(InMemoryLoginModule.Role.ADMIN))
.build();
assertTrue(user.checkPassword(password));
assertTrue(user.contains(InMemoryLoginModule.Role.valueOf("ADMIN")));
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment