38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
package org.gcube.gcat.utils;
|
|
|
|
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
|
import org.gcube.common.authorization.utils.secret.Secret;
|
|
import org.gcube.common.encryption.encrypter.StringEncrypter;
|
|
import org.gcube.gcat.ContextTest;
|
|
import org.junit.Test;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*/
|
|
public class ConstantsTest extends ContextTest {
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ConstantsTest.class);
|
|
|
|
@Test
|
|
public void testGetApplicationToken() throws Exception {
|
|
logger.debug("Application token for Context {} is {}", SecretManagerProvider.instance.get().getContext(),
|
|
Constants.getCatalogueSecret().getToken());
|
|
}
|
|
|
|
@Test
|
|
public void decrypt() throws Exception {
|
|
StringEncrypter stringEncrypter = StringEncrypter.getEncrypter();
|
|
String decrypted = stringEncrypter.decrypt("w0KVc+78b2yUQsndDh/cXyyRquuwyILTygmoF0Y5Dls=");
|
|
logger.debug("{}", decrypted);
|
|
}
|
|
|
|
@Test
|
|
public void getToken() throws Exception {
|
|
Secret secret = Constants.getCatalogueSecret();
|
|
logger.debug(secret.getToken());
|
|
}
|
|
|
|
}
|