Fixed boolean return transformation
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-client@142348 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7e3ddf7c7b
commit
ff0462ccac
|
@ -171,12 +171,12 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ResourceRegistryCall<C> implements Call<EndpointReference, C> {
|
class ResourceRegistryClientCall<C> implements Call<EndpointReference, C> {
|
||||||
|
|
||||||
protected final Class<C> clazz;
|
protected final Class<C> clazz;
|
||||||
protected final HTTPInputs httpInputs;
|
protected final HTTPInputs httpInputs;
|
||||||
|
|
||||||
public ResourceRegistryCall(Class<C> clazz, HTTPInputs httpInputs) {
|
public ResourceRegistryClientCall(Class<C> clazz, HTTPInputs httpInputs) {
|
||||||
this.clazz = clazz;
|
this.clazz = clazz;
|
||||||
this.httpInputs = httpInputs;
|
this.httpInputs = httpInputs;
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
logger.trace("Server returned content : {}", res);
|
logger.trace("Server returned content : {}", res);
|
||||||
|
|
||||||
if(Boolean.class.isAssignableFrom(clazz)){
|
if(Boolean.class.isAssignableFrom(clazz)){
|
||||||
return (C) ((Boolean) Boolean.getBoolean(res)) ;
|
return (C) ((Boolean) Boolean.valueOf(res)) ;
|
||||||
}else if(ISManageable.class.isAssignableFrom(clazz)){
|
}else if(ISManageable.class.isAssignableFrom(clazz)){
|
||||||
return (C) ISMapper.unmarshal((Class<ISManageable>) clazz, res);
|
return (C) ISMapper.unmarshal((Class<ISManageable>) clazz, res);
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
||||||
HTTPMETHOD.GET, null);
|
HTTPMETHOD.GET, null);
|
||||||
|
|
||||||
ResourceRegistryCall<ERType> call = new ResourceRegistryCall<>(
|
ResourceRegistryClientCall<ERType> call = new ResourceRegistryClientCall<>(
|
||||||
clazz, httpInputs);
|
clazz, httpInputs);
|
||||||
|
|
||||||
ERType erType = delegate.make(call);
|
ERType erType = delegate.make(call);
|
||||||
|
@ -324,7 +324,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
||||||
HTTPMETHOD.GET, parameters);
|
HTTPMETHOD.GET, parameters);
|
||||||
|
|
||||||
ResourceRegistryCall<String> call = new ResourceRegistryCall<>(
|
ResourceRegistryClientCall<String> call = new ResourceRegistryClientCall<>(
|
||||||
String.class, httpInputs);
|
String.class, httpInputs);
|
||||||
|
|
||||||
String ret = delegate.make(call);
|
String ret = delegate.make(call);
|
||||||
|
@ -365,7 +365,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
||||||
HTTPMETHOD.GET, parameters);
|
HTTPMETHOD.GET, parameters);
|
||||||
|
|
||||||
ResourceRegistryCall<String> call = new ResourceRegistryCall<>(
|
ResourceRegistryClientCall<String> call = new ResourceRegistryClientCall<>(
|
||||||
String.class, httpInputs);
|
String.class, httpInputs);
|
||||||
|
|
||||||
String ret = delegate.make(call);
|
String ret = delegate.make(call);
|
||||||
|
@ -403,7 +403,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
|
||||||
HTTPMETHOD.GET, parameters);
|
HTTPMETHOD.GET, parameters);
|
||||||
|
|
||||||
ResourceRegistryCall<String> call = new ResourceRegistryCall<>(
|
ResourceRegistryClientCall<String> call = new ResourceRegistryClientCall<>(
|
||||||
String.class, httpInputs);
|
String.class, httpInputs);
|
||||||
String schema = delegate.make(call);
|
String schema = delegate.make(call);
|
||||||
logger.info("Got schema for {} is {}", type, schema);
|
logger.info("Got schema for {} is {}", type, schema);
|
||||||
|
|
|
@ -59,8 +59,8 @@ public class ScopedTest {
|
||||||
GCUBE_DEVSEC = properties.getProperty(GCUBE_DEVSEC_VARNAME);
|
GCUBE_DEVSEC = properties.getProperty(GCUBE_DEVSEC_VARNAME);
|
||||||
GCUBE_DEVSEC_DEVVRE = properties.getProperty(GCUBE_DEVSEC_DEVVRE_VARNAME);
|
GCUBE_DEVSEC_DEVVRE = properties.getProperty(GCUBE_DEVSEC_DEVVRE_VARNAME);
|
||||||
|
|
||||||
DEFAULT_TEST_SCOPE = GCUBE_DEVSEC;
|
DEFAULT_TEST_SCOPE = GCUBE_DEVNEXT;
|
||||||
ALTERNATIVE_TEST_SCOPE = GCUBE_DEVSEC_DEVVRE;
|
ALTERNATIVE_TEST_SCOPE = GCUBE_DEVNEXT_NEXTNEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCurrentScope(String token) throws ObjectNotFound, Exception{
|
public static String getCurrentScope(String token) throws ObjectNotFound, Exception{
|
||||||
|
|
Loading…
Reference in New Issue