|
@@ -36,6 +36,7 @@ public class AuthTest {
|
|
|
|
|
|
@Test
|
|
|
public void testAuthSecret() {
|
|
|
+ properties.setDebugMode(false);
|
|
|
long time = System.currentTimeMillis();
|
|
|
String accessKey = "123456";
|
|
|
String accessSecret = "secret";
|
|
@@ -75,6 +76,7 @@ public class AuthTest {
|
|
|
|
|
|
@Test
|
|
|
public void testAuthToken() {
|
|
|
+ properties.setDebugMode(false);
|
|
|
long time = System.currentTimeMillis();
|
|
|
String sessionId = "123456";
|
|
|
String token = "token";
|
|
@@ -138,4 +140,18 @@ public class AuthTest {
|
|
|
Assert.assertEquals(entity.getSecret(), token);
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testDebug() {
|
|
|
+ properties.setDebugMode(true);
|
|
|
+ long time = System.currentTimeMillis();
|
|
|
+ String sessionId = "123456";
|
|
|
+ String token = "token";
|
|
|
+ authorization.secret = token + token;
|
|
|
+ String signature = SignatureEntity.build(SignatureType.TOKEN, method, tokenPath, time, sessionId, token);
|
|
|
+
|
|
|
+ AccessEntity entity = support.validateSignature(signature, method, tokenPath, String.valueOf(time));
|
|
|
+ Assert.assertNotNull(entity);
|
|
|
+ Assert.assertEquals(entity.getIdentity(), sessionId);
|
|
|
+ }
|
|
|
+
|
|
|
}
|