1. Project Clover database Wed Nov 12 2025 05:07:35 UTC
  2. Package guru.mikelue.foxglove.functional

File SuppliersTest.java

 

Code metrics

0
4
4
1
42
30
4
1
1
4
1

Classes

Class Line # Actions
SuppliersTest 15 4 0% 4 0
1.0100%
 

Contributing tests

This file is covered by 1 test. .

Source view

1    package guru.mikelue.foxglove.functional;
2   
3    import java.util.function.Supplier;
4   
5    import org.junit.jupiter.api.AfterEach;
6    import org.junit.jupiter.api.BeforeEach;
7    import org.junit.jupiter.api.Test;
8   
9    import guru.mikelue.misc.testlib.AbstractTestBase;
10   
11    import static java.util.concurrent.TimeUnit.SECONDS;
12    import static org.assertj.core.api.Assertions.assertThat;
13    import static org.awaitility.Awaitility.await;
14   
 
15    public class SuppliersTest extends AbstractTestBase {
 
16  1 toggle public SuppliersTest() {}
17   
 
18  1 toggle @BeforeEach
19    void setup() {}
20   
 
21  1 toggle @AfterEach
22    void tearDown() {}
23   
24    /**
25    * Tests {@link Suppliers#rollingSupplier(Supplier, int, Object)}.
26    */
 
27  1 toggle @Test
28    void buildRollingSupplier()
29    {
30  1 var testedSupplier = Suppliers.rollingSupplier(
31    () -> 1, 2, 0
32    );
33   
34  1 await()
35    .atMost(5, SECONDS)
36    .untilAsserted(() -> {
37  1 var suppliedValue = testedSupplier.get();
38  1 assertThat(suppliedValue)
39    .isEqualTo(0);
40    });
41    }
42    }