|
|
|
@ -15,7 +15,7 @@ import org.gcube.application.cms.tests.model.TestFilters;
|
|
|
|
|
import org.gcube.application.cms.tests.model.TestModel;
|
|
|
|
|
import org.gcube.application.cms.tests.model.TestQueries;
|
|
|
|
|
import org.gcube.application.geoportal.client.utils.Queries;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.legacy.*;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus;
|
|
|
|
|
import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest;
|
|
|
|
@ -142,12 +142,23 @@ public class StatelessClientTests extends BasicVreTests{
|
|
|
|
|
public void testCleanFileSet() throws Exception {
|
|
|
|
|
|
|
|
|
|
Concessione testObject=prepare();
|
|
|
|
|
System.out.println("Object is "+testObject.getPosizionamentoScavo());
|
|
|
|
|
//Precheck to be sure
|
|
|
|
|
assertFalse(testObject.getPosizionamentoScavo().getActualContent().isEmpty());
|
|
|
|
|
assertFalse(testObject.getPianteFineScavo().get(0).getActualContent().isEmpty());
|
|
|
|
|
|
|
|
|
|
client.unPublish(testObject.getMongo_id());
|
|
|
|
|
|
|
|
|
|
// check unpublish
|
|
|
|
|
testObject= client.getById(testObject.getMongo_id());
|
|
|
|
|
for(LayerConcessione l:testObject.getPianteFineScavo())
|
|
|
|
|
for(PersistedContent pc: l.getActualContent())
|
|
|
|
|
if(pc instanceof GeoServerContent) throw new Exception ("Concessione not properly unpublished");
|
|
|
|
|
|
|
|
|
|
for(PersistedContent pc: testObject.getPosizionamentoScavo().getActualContent())
|
|
|
|
|
if(pc instanceof GeoServerContent) throw new Exception ("Concessione not properly unpublished");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Clear pos
|
|
|
|
|
testObject=client.cleanFileSet(testObject.getMongo_id(),Paths.POSIZIONAMENTO);
|
|
|
|
|
assertTrue(testObject.getPosizionamentoScavo().getActualContent().isEmpty());
|
|
|
|
@ -159,7 +170,7 @@ public class StatelessClientTests extends BasicVreTests{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Concessione prepare() throws Exception {
|
|
|
|
|
int numImgs=5;
|
|
|
|
|
int numImgs=1;
|
|
|
|
|
Concessione c= client.createNew(TestModel.prepareConcessione(1,numImgs));
|
|
|
|
|
StorageUtils storage = new StorageUtils();
|
|
|
|
|
|
|
|
|
@ -171,10 +182,12 @@ public class StatelessClientTests extends BasicVreTests{
|
|
|
|
|
client.registerFileSet(mongoId,
|
|
|
|
|
FileSets.prepareRequest(storage,Paths.RELAZIONE,new File(TestModel.getBaseFolder(),"relazione.pdf")));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<numImgs;i++)
|
|
|
|
|
client.registerFileSet(mongoId,
|
|
|
|
|
FileSets.build(Paths.imgByIndex(i)).
|
|
|
|
|
add(storage.putOntoStorage(new File(TestModel.getBaseFolder(),"immagine.png"),
|
|
|
|
|
add(storage.putOntoStorage(new File(TestModel.getBaseFolder(),"immagine"+(i+1)+".png"),
|
|
|
|
|
i+"San Mauro_drone totale.JPG")).getTheRequest());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|