Fabio Sinibaldi 2 months ago
parent
commit
0f9a7329c0
  1. 1
      geoportal-service/CHANGELOG.md
  2. 2
      geoportal-service/src/main/java/org/gcube/application/geoportal/service/engine/mongo/ConcessioniMongoManager.java
  3. 4
      geoportal-service/src/test/java/org/gcube/application/geoportal/service/BasicServiceTestUnit.java
  4. 18
      geoportal-service/src/test/java/org/gcube/application/geoportal/service/ConcessioniOverMongoTest.java

1
geoportal-service/CHANGELOG.md

@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [v1.0.8-SNAPSHOT] 2021-09-20
Logging
Fixes [#22193](https://support.d4science.org/issues/22193)
## [v1.0.6] 2021-09-20
Refactored repositories

2
geoportal-service/src/main/java/org/gcube/application/geoportal/service/engine/mongo/ConcessioniMongoManager.java

@ -405,6 +405,8 @@ public class ConcessioniMongoManager extends MongoManager{
((LayerConcessione) c).setBbox(null);
((LayerConcessione) c).setWmsLink(null);
((LayerConcessione) c).setWorkspace(null);
((LayerConcessione) c).setLayerName(null);
//Remove reference to removed content
c.getActualContent().removeAll(toRemove);

4
geoportal-service/src/test/java/org/gcube/application/geoportal/service/BasicServiceTestUnit.java

@ -19,9 +19,9 @@ public class BasicServiceTestUnit extends JerseyTest {
return new GeoPortalService();
}
// protected static String scope="/gcube/devsec/devVRE";
protected static String scope="/gcube/devsec/devVRE";
// protected static String scope="/pred4s/preprod/preVRE";
protected static String scope="/d4science.research-infrastructures.eu/D4OS/GeoNA-Prototype";
// protected static String scope="/d4science.research-infrastructures.eu/D4OS/GeoNA-Prototype";
@BeforeClass
public static void init() {

18
geoportal-service/src/test/java/org/gcube/application/geoportal/service/ConcessioniOverMongoTest.java

@ -88,6 +88,7 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
return check(resp,Concessione.class);
}
private static Concessione register(WebTarget target, Concessione c) throws Exception {
Response resp=target.request(MediaType.APPLICATION_JSON).post(Entity.entity(Serialization.write(c), MediaType.APPLICATION_JSON));
return check(resp,Concessione.class);
@ -143,13 +144,12 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
public void query() throws Exception {
WebTarget target=target(PATH);
Iterator<Concessione> it=null;
it=queryFile("lastRegistered.json", target);
assertTrue(count(it)==1);
Iterator<Concessione> it = queryFile("lastRegistered.json", target);
assertEquals(1, count(it));
it=queryFile("firstRegistered.json", target);
assertTrue(count(it)==1);
assertEquals(1, count(it));
System.out.println("Last Names by Fabio : ");
queryFile("lastNameRegisteredByFabio.json", target, JSONObject.class).forEachRemaining(c -> {System.out.println(c);});
@ -191,8 +191,8 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
@Test
public void republish() throws Exception{
WebTarget target=target(PATH);
// Concessione published=getFullPublished(target);
Concessione published=getById(target,"6155ba6002ad3d2c23b72b5a");
Concessione published=getFullPublished(target);
//Concessione published=getById(target,"6155ba6002ad3d2c23b72b5a");
published = unpublish(target,published.getMongo_id());
System.out.println("Republishing..");
published=publish(target,published.getMongo_id());
@ -271,10 +271,8 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
System.out.println("Error for deletion is "+resp.readEntity(String.class));
//unpublish
resp=
target.path(InterfaceConstants.Methods.PUBLISH_PATH).path(published.getMongo_id()).
request(MediaType.APPLICATION_JSON).delete();
check(resp,null);
unpublish(target,published.getMongo_id());
//Actually cleaning posizionamento
published=check(

Loading…
Cancel
Save