This repository has been archived on 2021-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
geoportal-common/src/test/java/org/gcube/application/geoportal/common/model/SerializationTest.java

32 lines
927 B
Java

package org.gcube.application.geoportal.common.model;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javax.json.Json;
import javax.json.JsonObject;
import org.gcube.application.geoportal.common.faults.JsonParseException;
import org.gcube.application.geoportal.common.model.profile.Profile;
import org.gcube.application.geoportal.common.utils.Files;
import org.junit.Assert;
import org.junit.Test;
public class SerializationTest {
@Test
public void readProfile() throws FileNotFoundException, JsonParseException {
JsonObject object=Json.createReader(new FileInputStream(Files.getFileFromResources("ProfileConcessioni.json"))).readObject();
System.out.println("object is "+object);
Assert.assertNotNull(object);
Profile concessione=new Profile(object);
System.out.println("Profile is "+concessione.toJson());
Assert.assertTrue(concessione.getFields().size()>0);
}
}