[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/release] Simplify a test case.



commit c9dae3850634017ecf06aaddb2638a70b866b6bc
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Tue Aug 21 12:20:23 2018 +0200

    Simplify a test case.
---
 .../java/org/torproject/descriptor/log/LogDescriptorTest.java    | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java b/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java
index 2e13a52..609f6e5 100644
--- a/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java
+++ b/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java
@@ -32,7 +32,6 @@ import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 
 @RunWith(Parameterized.class)
@@ -104,11 +103,9 @@ public class LogDescriptorTest {
   @Before
   public void readAll() throws IOException {
     createTemporaryFolderAndContents();
-    Iterator<Descriptor> descs = this.reader
-        .readDescriptors(this.indir).iterator();
-    while (descs.hasNext()) {
-      descs.next();
-    }
+    this.reader.readDescriptors(this.indir).forEach(descriptor -> {
+      /* Nothing to do with read descriptors. */
+    });
   }
 
   protected List<Descriptor> retrieve() throws Exception {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits