BakeoutController-Basic  0.1
A Controller for the Omicron vacuum chamber
GetLengthOfHistory.java
1 package unit.kernel.models.variables.pressure_provider;
2 
3 import org.jetbrains.annotations.Contract;
4 import org.junit.Before;
5 import org.junit.Test;
6 
7 import java.time.Duration;
8 
9 import static org.junit.Assert.assertEquals;
10 
14 public final class GetLengthOfHistory extends PressureProviderTestCase {
15  private final Integer numberOfPoints = 10;
16  private final Duration pollingInterval = Duration.ofMillis(1000);
17 
18  @Contract(" -> !null")
19  @Override
20  protected ExpectationsForPressureProvider getExpectations() throws
21  Exception {
23  }
24 
25  @Before
26  public void configureProvider() throws Exception {
27  provider.setNumberOfDataPoints(numberOfPoints);
28  provider.setPollingInterval(pollingInterval);
29  }
30 
31  @Test
32  public void getLengthOfHistory(){
33  assertEquals(
34  pollingInterval.multipliedBy(numberOfPoints).toMillis(),
35  provider.getLengthOfHistory().toMillis(),
36  1e-6
37  );
38  }
39 
40 }
void setPollingInterval(Duration pollingInterval)
void setNumberOfDataPoints(Integer numberOfDataPoints)
Git Repo