Removed force URL in factory
This commit is contained in:
parent
888d666b79
commit
85ed707f44
|
@ -26,21 +26,8 @@ public class ResourceRegistryClientFactory {
|
||||||
return authorizationEntry.getContext();
|
return authorizationEntry.getContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String FORCED_URL = null;
|
|
||||||
|
|
||||||
protected static void forceToURL(String url){
|
|
||||||
FORCED_URL = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ResourceRegistryClient create() {
|
public static ResourceRegistryClient 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 ResourceRegistryClientImpl(address);
|
return new ResourceRegistryClientImpl(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){
|
|
||||||
ResourceRegistryClientFactory.forceToURL(RESOURCE_REGISTRY_URL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
||||||
|
|
|
@ -44,7 +44,11 @@ public class ResourceRegistryClientTest extends ContextTest {
|
||||||
protected ResourceRegistryClient resourceRegistryClient;
|
protected ResourceRegistryClient resourceRegistryClient;
|
||||||
|
|
||||||
public ResourceRegistryClientTest() {
|
public ResourceRegistryClientTest() {
|
||||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
if(ContextTest.RESOURCE_REGISTRY_URL !=null && !ContextTest.RESOURCE_REGISTRY_URL.isEmpty()) {
|
||||||
|
resourceRegistryClient = new ResourceRegistryClientImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||||
|
}else {
|
||||||
|
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -38,7 +38,11 @@ public class ResourceRegistryClientTestWikiExamples extends ContextTest {
|
||||||
protected ResourceRegistryClient resourceRegistryClient;
|
protected ResourceRegistryClient resourceRegistryClient;
|
||||||
|
|
||||||
public ResourceRegistryClientTestWikiExamples() {
|
public ResourceRegistryClientTestWikiExamples() {
|
||||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
if(ContextTest.RESOURCE_REGISTRY_URL !=null && !ContextTest.RESOURCE_REGISTRY_URL.isEmpty()) {
|
||||||
|
resourceRegistryClient = new ResourceRegistryClientImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||||
|
}else {
|
||||||
|
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
|
Loading…
Reference in New Issue