-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathNoOpProviderTest.java
More file actions
51 lines (42 loc) · 1.44 KB
/
NoOpProviderTest.java
File metadata and controls
51 lines (42 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package dev.openfeature.sdk;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public class NoOpProviderTest {
@Test
void bool() {
NoOpProvider p = new NoOpProvider();
ProviderEvaluation<Boolean> eval = p.getBooleanEvaluation("key", true, null);
assertEquals(true, eval.getValue());
}
@Test
void str() {
NoOpProvider p = new NoOpProvider();
ProviderEvaluation<String> eval = p.getStringEvaluation("key", "works", null);
assertEquals("works", eval.getValue());
}
@Test
void integer() {
NoOpProvider p = new NoOpProvider();
ProviderEvaluation<Integer> eval = p.getIntegerEvaluation("key", 4, null);
assertEquals(4, eval.getValue());
}
@Test
void noOpdouble() {
NoOpProvider p = new NoOpProvider();
ProviderEvaluation<Double> eval = p.getDoubleEvaluation("key", 0.4, null);
assertEquals(0.4, eval.getValue());
}
@Test
void value() {
NoOpProvider p = new NoOpProvider();
Value s = new Value();
ProviderEvaluation<Value> eval = p.getObjectEvaluation("key", s, null);
assertEquals(s, eval.getValue());
}
@Test
void noOpNumber() {
NoOpProvider p = new NoOpProvider();
ProviderEvaluation<Number> eval = p.getNumberEvaluation("key", 123456789L, null);
assertEquals(123456789.0, eval.getValue());
}
}