Fixed Empty query result
This commit is contained in:
parent
70289ec603
commit
5d1d46e0c5
|
@ -225,7 +225,8 @@ public class ConcessioniOverMongo {
|
|||
StringBuilder builder=new StringBuilder("[");
|
||||
manager.query(Serialization.parseQuery(queryString))
|
||||
.forEach(d->{builder.append(d.toJson()+",");});
|
||||
builder.deleteCharAt(builder.length()-1);
|
||||
if(builder.length()>1)
|
||||
builder.deleteCharAt(builder.length()-1);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
|
@ -144,10 +144,12 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
|
|||
public void query() throws Exception {
|
||||
WebTarget target=target(PATH);
|
||||
|
||||
Iterator<Concessione> it = queryFile("lastRegistered.json", target);
|
||||
assertEquals(1, count(it));
|
||||
Iterator<Concessione> it;
|
||||
|
||||
|
||||
assertEquals(1, count( queryFile("lastRegistered.json", target)));
|
||||
assertEquals(0, count( queryFile("emptyresult.json",target)));
|
||||
|
||||
it=queryFile("firstRegistered.json", target);
|
||||
assertEquals(1, count(it));
|
||||
|
||||
|
|
Loading…
Reference in New Issue