2017-12-18 15:37:22 +01:00
|
|
|
package org.gcube.informationsystem.resourceregistry.schema;
|
|
|
|
|
2017-12-19 11:27:29 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.gcube.informationsystem.model.entity.Facet;
|
|
|
|
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
|
|
|
import org.junit.Test;
|
2017-12-18 15:37:22 +01:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
public class ResourceRegistrySchemaClientTest extends ScopedTest {
|
|
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(ResourceRegistrySchemaClientTest.class);
|
|
|
|
|
2017-12-19 11:27:29 +01:00
|
|
|
interface Aux extends Facet {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testCreate() throws Exception {
|
|
|
|
ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();
|
|
|
|
TypeDefinition td = resourceRegistrySchemaClient.create(Aux.class);
|
|
|
|
logger.debug("{}", td);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testRead() throws Exception {
|
|
|
|
ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();
|
|
|
|
List<TypeDefinition> types = resourceRegistrySchemaClient.read(Facet.class, true);
|
|
|
|
for(TypeDefinition td : types) {
|
|
|
|
logger.debug("{}", td);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-18 15:37:22 +01:00
|
|
|
|
|
|
|
}
|