2019-01-29 17:46:22 +01:00
|
|
|
package org.gcube.gcat.utils;
|
|
|
|
|
2021-12-01 17:12:04 +01:00
|
|
|
import org.gcube.common.authorization.utils.manager.SecretManager;
|
2021-12-20 13:46:50 +01:00
|
|
|
import org.gcube.common.encryption.encrypter.StringEncrypter;
|
2019-01-29 17:46:22 +01:00
|
|
|
import org.gcube.gcat.ContextTest;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
public class ConstantsTest extends ContextTest {
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ConstantsTest.class);
|
|
|
|
|
|
|
|
@Test
|
2021-12-16 12:33:49 +01:00
|
|
|
public void testGetApplicationToken() throws Exception {
|
2021-12-01 17:12:04 +01:00
|
|
|
logger.debug("Application token for Context {} is {}", SecretManager.instance.get().getContext(),
|
2021-12-16 12:33:49 +01:00
|
|
|
Constants.getCatalogueSecurityToken());
|
2019-01-29 17:46:22 +01:00
|
|
|
}
|
|
|
|
|
2021-12-20 13:46:50 +01:00
|
|
|
|
|
|
|
@Test
|
|
|
|
public void decrypt() throws Exception {
|
|
|
|
StringEncrypter stringEncrypter = StringEncrypter.getEncrypter();
|
|
|
|
String decrypted = stringEncrypter.decrypt("w0KVc+78b2yUQsndDh/cXyyRquuwyILTygmoF0Y5Dls=");
|
|
|
|
logger.debug("{}", decrypted);
|
|
|
|
|
|
|
|
}
|
2019-01-29 17:46:22 +01:00
|
|
|
}
|