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