mirror of
https://github.com/jwtk/jjwt.git
synced 2025-02-13 18:44:51 +00:00
moved Java test into groovy
This commit is contained in:
parent
39ee58a511
commit
4be4912cb2
@ -124,4 +124,28 @@ class JwtMapTest {
|
|||||||
def s = ['b', 'd']
|
def s = ['b', 'd']
|
||||||
assertTrue m.values().containsAll(s) && s.containsAll(m.values())
|
assertTrue m.values().containsAll(s) && s.containsAll(m.values())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testEquals() throws Exception {
|
||||||
|
def m1 = new JwtMap();
|
||||||
|
m1.put("a", "a");
|
||||||
|
|
||||||
|
def m2 = new JwtMap();
|
||||||
|
m2.put("a", "a");
|
||||||
|
|
||||||
|
assertEquals(m1, m2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testHashcode() throws Exception {
|
||||||
|
def m = new JwtMap();
|
||||||
|
def hashCodeEmpty = m.hashCode();
|
||||||
|
|
||||||
|
m.put("a", "b");
|
||||||
|
def hashCodeNonEmpty = m.hashCode();
|
||||||
|
assertTrue(hashCodeEmpty != hashCodeNonEmpty);
|
||||||
|
|
||||||
|
def identityHash = System.identityHashCode(m);
|
||||||
|
assertTrue(hashCodeNonEmpty != identityHash);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package io.jsonwebtoken.impl;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static junit.framework.Assert.assertTrue;
|
|
||||||
import static junit.framework.TestCase.assertEquals;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Java specific test to ensure we don't hit Groovy's DefaultGroovyMethods
|
|
||||||
*/
|
|
||||||
public class JavaJwtMapTest
|
|
||||||
{
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testEquals() throws Exception
|
|
||||||
{
|
|
||||||
JwtMap jwtMap1 = new JwtMap();
|
|
||||||
jwtMap1.put("a", "a");
|
|
||||||
|
|
||||||
JwtMap jwtMap2 = new JwtMap();
|
|
||||||
jwtMap2.put("a", "a");
|
|
||||||
|
|
||||||
assertEquals(jwtMap1, jwtMap2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testHashCode() throws Exception
|
|
||||||
{
|
|
||||||
JwtMap jwtMap = new JwtMap();
|
|
||||||
int hashCodeEmpty = jwtMap.hashCode();
|
|
||||||
|
|
||||||
jwtMap.put("a", "b");
|
|
||||||
int hashCodeNonEmpty = jwtMap.hashCode();
|
|
||||||
assertTrue(hashCodeEmpty != hashCodeNonEmpty);
|
|
||||||
|
|
||||||
int identityHash = System.identityHashCode(jwtMap);
|
|
||||||
assertTrue(hashCodeNonEmpty != identityHash);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user