Removed force URL in factory
This commit is contained in:
parent
4ed56600d6
commit
d7edafcd49
|
@ -26,21 +26,8 @@ public class ResourceRegistryQueryTemplateClientFactory {
|
||||||
return authorizationEntry.getContext();
|
return authorizationEntry.getContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String FORCED_URL = null;
|
|
||||||
|
|
||||||
protected static void forceToURL(String url){
|
|
||||||
FORCED_URL = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ResourceRegistryQueryTemplateClient create() {
|
public static ResourceRegistryQueryTemplateClient create() {
|
||||||
String address = null;
|
String address = String.format("%s/%s", ServiceInstance.getServiceURL(),Constants.SERVICE_NAME);
|
||||||
|
|
||||||
if(FORCED_URL!=null){
|
|
||||||
address = FORCED_URL;
|
|
||||||
}else {
|
|
||||||
address = String.format("%s/%s", ServiceInstance.getServiceURL(),Constants.SERVICE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address);
|
logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address);
|
||||||
return new ResourceRegistryQueryTemplateClientImpl(address);
|
return new ResourceRegistryQueryTemplateClientImpl(address);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,10 +80,7 @@ public class ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
RESOURCE_REGISTRY_URL = registryProperties.getProperty(RESOURCE_REGISTRY_URL_PROPERTY);
|
RESOURCE_REGISTRY_URL = registryProperties.getProperty(RESOURCE_REGISTRY_URL_PROPERTY);
|
||||||
|
|
||||||
if(RESOURCE_REGISTRY_URL!=null){
|
|
||||||
ResourceRegistryQueryTemplateClientFactory.forceToURL(RESOURCE_REGISTRY_URL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
||||||
|
|
|
@ -42,7 +42,11 @@ public class ResourceRegistryQueryTemplateClientTest extends ContextTest {
|
||||||
protected ResourceRegistryQueryTemplateClient resourceRegistryQueryTemplateClient;
|
protected ResourceRegistryQueryTemplateClient resourceRegistryQueryTemplateClient;
|
||||||
|
|
||||||
public ResourceRegistryQueryTemplateClientTest() {
|
public ResourceRegistryQueryTemplateClientTest() {
|
||||||
resourceRegistryQueryTemplateClient = ResourceRegistryQueryTemplateClientFactory.create();
|
if(ContextTest.RESOURCE_REGISTRY_URL !=null && !ContextTest.RESOURCE_REGISTRY_URL.isEmpty()) {
|
||||||
|
resourceRegistryQueryTemplateClient = new ResourceRegistryQueryTemplateClientImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||||
|
}else {
|
||||||
|
resourceRegistryQueryTemplateClient = ResourceRegistryQueryTemplateClientFactory.create();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUser() {
|
public static String getUser() {
|
||||||
|
|
Loading…
Reference in New Issue