@@ -204,6 +204,17 @@ public void shouldAcceptCustomClaimOfTypeInteger() throws Exception {
204204 assertThat (parts [1 ], is ("eyJuYW1lIjoxMjN9" ));
205205 }
206206
207+ @ Test
208+ public void shouldAcceptCustomClaimOfTypeLong () throws Exception {
209+ String jwt = JWTCreator .init ()
210+ .withClaim ("name" , Long .MAX_VALUE )
211+ .sign (Algorithm .HMAC256 ("secret" ));
212+
213+ assertThat (jwt , is (notNullValue ()));
214+ String [] parts = jwt .split ("\\ ." );
215+ assertThat (parts [1 ], is ("eyJuYW1lIjo5MjIzMzcyMDM2ODU0Nzc1ODA3fQ" ));
216+ }
217+
207218 @ Test
208219 public void shouldAcceptCustomClaimOfTypeDouble () throws Exception {
209220 String jwt = JWTCreator .init ()
@@ -259,4 +270,15 @@ public void shouldAcceptCustomArrayClaimOfTypeInteger() throws Exception {
259270 String [] parts = jwt .split ("\\ ." );
260271 assertThat (parts [1 ], is ("eyJuYW1lIjpbMSwyLDNdfQ" ));
261272 }
273+
274+ @ Test
275+ public void shouldAcceptCustomArrayClaimOfTypeLong () throws Exception {
276+ String jwt = JWTCreator .init ()
277+ .withArrayClaim ("name" , new Long []{1L , 2L , 3L })
278+ .sign (Algorithm .HMAC256 ("secret" ));
279+
280+ assertThat (jwt , is (notNullValue ()));
281+ String [] parts = jwt .split ("\\ ." );
282+ assertThat (parts [1 ], is ("eyJuYW1lIjpbMSwyLDNdfQ" ));
283+ }
262284}
0 commit comments