Browse Source

Fix broken tests

Juanjo Aguililla 9 years ago
parent
commit
1ed95e1d42

+ 3 - 3
frameworks/Java/sabina/src/main/java/sabina/benchmark/MongoDbRepository.java

@@ -49,7 +49,7 @@ final class MongoDbRepository implements Repository {
         fortuneCollection.find ().forEach ((Block<Document>)doc ->
             fortunes.add (
                 new Fortune (
-                    doc.get ("_id", Double.class).intValue (),
+                    doc.get ("_id", Number.class).intValue (),
                     (String)doc.get ("message")
                 )
             )
@@ -76,8 +76,8 @@ final class MongoDbRepository implements Repository {
 
     private World createWorld (Document world) {
         return new World (
-            world.get ("_id", Double.class).intValue (),
-            world.get ("randomNumber", Double.class).intValue ()
+            world.get ("_id", Number.class).intValue (),
+            world.get ("randomNumber", Number.class).intValue ()
         );
     }
 

+ 4 - 0
frameworks/Java/sabina/src/test/java/sabina/benchmark/ApplicationTest.java

@@ -104,6 +104,10 @@ import org.testng.annotations.Test;
         checkDbRequest ("/query?queries=500", 500);
     }
 
+    public void five_hundred_and_one_queries () throws IOException {
+        checkDbRequest ("/query?queries=501", 500);
+    }
+
     public void fortunes () throws IOException {
         HttpResponse response = get (ENDPOINT + "/fortune");
         String content = getContent (response);