]> git.somenet.org - pub/jan/dst18.git/blob - ass1-doc/src/test/java/dst/ass1/doc/tests/Ass1_4_3_01Test.java
Add template for assignment 1
[pub/jan/dst18.git] / ass1-doc / src / test / java / dst / ass1 / doc / tests / Ass1_4_3_01Test.java
1 package dst.ass1.doc.tests;
2
3 import static org.junit.Assert.assertNotNull;
4 import static org.junit.Assert.assertTrue;
5
6 import java.util.List;
7
8 import org.bson.Document;
9 import org.junit.ClassRule;
10 import org.junit.Rule;
11 import org.junit.Test;
12
13 import dst.ass1.doc.EmbeddedMongo;
14 import dst.ass1.doc.MongoService;
15 import dst.ass1.jpa.util.Constants;
16
17 public class Ass1_4_3_01Test {
18
19     @ClassRule
20     public static EmbeddedMongo embeddedMongo = new EmbeddedMongo();
21
22     @Rule
23     public MongoService mongo = new MongoService(db -> {
24         db.createCollection(Constants.COLL_MATERIAL_DATA); // make sure the empty collection exists
25     });
26
27     @Test
28     public void getDocumentStatistics_withEmptyData_returnsEmptyStatistics() throws Exception {
29         List<Document> documentStatistics = mongo.getDocumentQuery().getDocumentStatistics();
30         assertNotNull(documentStatistics);
31         assertTrue(documentStatistics.isEmpty());
32     }
33
34 }