@@ -0,0 +1,2813 @@
+package com.ducreyna.jwt;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * Created by nathan on 19/02/15.%0A */%0Apublic class JwtTest %7B%0A    private final String key = %22secret%22;%0A%0A    @Test%0A    public void shouldPayloadEmpty() throws Exception %7B%0A        HashMap%3CString, Object%3E payload = new HashMap%3CString, Object%3E();%0A        String token = Jwt.encode(payload, key);%0A        Map%3CString, Object%3E decoded = Jwt.decode(token, key, true);%0A%0A        assertEquals(payload, decoded);%0A    %7D%0A%0A    @Test (expected = IllegalArgumentException.class)%0A    public void shouldKeyEncodingEmpty() throws Exception %7B%0A        HashMap%3CString, Object%3E payload = new HashMap%3CString, Object%3E();%0A        Jwt.encode(payload, %22%22);%0A    %7D%0A%0A    @Test (expected = IllegalArgumentException.class)%0A    public void shouldKeyDecodingEmpty() throws Exception %7B%0A        Jwt.decode(%22token%22, null, null);%0A    %7D%0A%0A    @Test (expected = IllegalStateException.class)%0A    public void shouldTokenEmpty() throws Exception %7B%0A        Jwt.decode(%22%22, key, null);%0A    %7D%0A%0A    @Test (expected = IllegalStateException.class)%0A    public void shouldBadSegments() throws Exception %7B%0A        Jwt.decode(%22segment1.segment2%22, key, true);%0A    %7D%0A%0A    @Test%0A    public void shouldVerifyGoodToken() throws Exception %7B%0A        HashMap%3CString, Object%3E payload = new HashMap%3CString, Object%3E();%0A        payload.put(%22name%22, %22ducreyna%22);%0A        payload.put(%22admin%22, true);%0A        payload.put(%22state%22, new HashMap%3CString, Object%3E());%0A        String token = Jwt.encode(payload, key);%0A        Map%3CString, Object%3E decoded = Jwt.decode(token, key, true);%0A%0A        assertEquals(payload, decoded);%0A    %7D%0A%0A    @Test%0A    public void shouldVerifyGoodTokenWithAlgorithm() throws Exception %7B%0A        HashMap%3CString, Object%3E payload = new HashMap%3CString, Object%3E();%0A        payload.put(%22name%22, %22ducreyna%22);%0A        String token = Jwt.encode(payload, key, Algorithm.HS512);%0A        Map%3CString, Object%3E decoded = Jwt.decode(token, key, true);%0A%0A        assertEquals(payload, decoded);%0A    %7D%0A%0A    @Test (expected = VerifyException.class)%0A    public void shouldVerifyBadToken() throws Exception %7B%0A        HashMap%3CString, Object%3E payload = new HashMap%3CString, Object%3E();%0A        payload.put(%22name%22, %22ducreyna%22);%0A        String token = Jwt.encode(payload, key);%0A        token = token.concat(%22IAMJOKER%22);%0A        Jwt.decode(token, key, true);%0A    %7D%0A%0A    @Test%0A    public void shouldNotVerify() throws Exception %7B%0A        HashMap%3CString, Object%3E payload = new HashMap%3CString, Object%3E();%0A        payload.put(%22name%22, %22ducreyna%22);%0A        String token = Jwt.encode(payload, key);%0A        token.concat(%22IAMBATMAN%22);%0A        Map%3CString, Object%3E decoded = Jwt.decode(token, key, false);%0A%0A        assertEquals(payload, decoded);%0A    %7D%0A%7D%0A

Add JUnit tests