You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1014 B
37 lines
1014 B
/* |
|
* Copyright (c) 2014 HIS eG All Rights Reserved. |
|
* |
|
* Created on 02.09.2014 by brummer |
|
*/ |
|
package de.superx.servlet; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
import org.apache.commons.codec.digest.DigestUtils; |
|
import org.junit.Test; |
|
|
|
import de.memtext.db.NichtAngemeldetException; |
|
|
|
/** |
|
* Company: HIS |
|
* @author brummer |
|
*/ |
|
public class TokenCheckerTest { |
|
|
|
private final String token = "1.0/" + (System.currentTimeMillis() / 1000) + "/superx/admin/bi_admin/1/RIGHT_CS_BIA_STANDARDREPORTS_ADMIN/1/3/"; |
|
private final String sharedSecret = "rdfS3Y4Cx5Pb9gVxTOoZUT2TvnaOEKRNu"; |
|
|
|
@Test |
|
public void testInitialization() throws NichtAngemeldetException, NoSuchAlgorithmException { |
|
SuperXManager.sharedSecret = this.sharedSecret; |
|
String digest = DigestUtils.md5Hex((this.token + this.sharedSecret).getBytes()); |
|
TokenChecker tc = null; |
|
System.out.println(token + digest); |
|
tc = new TokenChecker(this.token + digest); |
|
assertNotNull(tc); |
|
} |
|
|
|
|
|
}
|
|
|