@@ -0,0 +1,1528 @@
+package net.davidvoid.thor.lightning.service.security;%0D%0A%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0Aimport static org.junit.Assert.fail;%0D%0Aimport net.davidvoid.thor.lightning.exception.AuthenticationException;%0D%0A%0D%0Aimport org.junit.Test;%0D%0Aimport org.springframework.security.core.Authentication;%0D%0Aimport org.springframework.security.core.GrantedAuthority;%0D%0A%0D%0Apublic class JwtAuthenticationServiceTest %7B%0D%0A%0D%0A    @Test%0D%0A    public void Authenticate_GivenInvalidToken_WillThrow() %7B%0D%0A        JwtAuthenticationService service = new JwtAuthenticationService();%0D%0A        %0D%0A        try %7B%0D%0A            service.authenticate(%22eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ%22);%0D%0A            fail(%22should throw%22);%0D%0A        %7D catch (AuthenticationException e) %7B%7D%0D%0A    %7D%0D%0A    @Test%0D%0A    public void Authenticate_GivenValid_WillSuccess() %7B%0D%0A        JwtAuthenticationService service = new JwtAuthenticationService();%0D%0A        String jwtToken = service.getToken(%22david%22);%0D%0A        Authentication auth = service.authenticate(jwtToken);%0D%0A        assertEquals(%22david%22, auth.getName());%0D%0A        assertEquals(%22david%22, auth.getPrincipal());%0D%0A        assertEquals(%22%22, auth.getCredentials());%0D%0A        assertEquals(1, auth.getAuthorities().size());%0D%0A        GrantedAuthority role = (GrantedAuthority) auth.getAuthorities().toArray()%5B0%5D;%0D%0A        assertEquals(%22USER%22, role.toString());%0D%0A        assertEquals(true, auth.isAuthenticated());%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

add test for JWT authentication