@@ -0,0 +1,1754 @@
+package com.quizdeck.services;%0A%0Aimport com.quizdeck.QuizDeckApplication;%0Aimport io.jsonwebtoken.Claims;%0Aimport io.jsonwebtoken.Jwts;%0Aimport io.jsonwebtoken.SignatureAlgorithm;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport javax.annotation.Resource;%0Aimport java.util.Date;%0A%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.hamcrest.core.IsEqual.equalTo;%0Aimport static org.junit.Assert.assertThat;%0A%0A/**%0A * Created by Brandon on 2/13/2016.%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@SpringApplicationConfiguration(classes = QuizDeckApplication.class)%0Apublic class AuthenticationServiceTest %7B%0A    @Autowired%0A    private AuthenticationService authService;%0A%0A    @Resource(name = %22secretKey%22)%0A    private String secretKey;%0A%0A    @Test%0A    public void buildTokenSuccess() %7B%0A        String serviceTtoken = authService.buildToken(%22testUser%22, %22User%22);%0A        Claims claims = Jwts%0A                .parser()%0A                .setSigningKey(this.secretKey)%0A                .parseClaimsJws(serviceTtoken)%0A                .getBody();%0A%0A        assertThat(claims.get(%22user%22), is(equalTo(%22testUser%22)));%0A        assertThat(claims.get(%22role%22), is(equalTo(%22User%22)));%0A%0A        serviceTtoken = authService.buildToken(%22otherUser%22, %22Admin%22);%0A        claims = Jwts%0A                .parser()%0A                .setSigningKey(this.secretKey)%0A                .parseClaimsJws(serviceTtoken)%0A                .getBody();%0A%0A        assertThat(claims.get(%22user%22), is(equalTo(%22otherUser%22)));%0A        assertThat(claims.get(%22role%22), is(equalTo(%22Admin%22)));%0A    %7D%0A%7D%0A

Add Auth Service test