|
@@ -32,6 +32,9 @@ import org.mockito.Mock;
|
32
|
32
|
import org.mockito.runners.MockitoJUnitRunner;
|
33
|
33
|
|
34
|
34
|
import static org.junit.Assert.assertEquals;
|
|
35
|
+import static org.mockito.Matchers.any;
|
|
36
|
+import static org.mockito.Matchers.anyBoolean;
|
|
37
|
+import static org.mockito.Matchers.eq;
|
35
|
38
|
import static org.mockito.Mockito.when;
|
36
|
39
|
|
37
|
40
|
@RunWith(MockitoJUnitRunner.class)
|
|
@@ -61,8 +64,10 @@ public class ConfigBinderTest {
|
61
|
64
|
}
|
62
|
65
|
|
63
|
66
|
final StringTest test = new StringTest();
|
64
|
|
- when(configProvider.getOptionString("test", "foo")).thenReturn("test123");
|
65
|
|
- when(configProvider.getOptionString("test", "bar")).thenReturn("test456");
|
|
67
|
+ when(configProvider.getOptionString(eq("test"), eq("foo"), anyBoolean(), any()))
|
|
68
|
+ .thenReturn("test123");
|
|
69
|
+ when(configProvider.getOptionString(eq("test"), eq("bar"), anyBoolean(), any()))
|
|
70
|
+ .thenReturn("test456");
|
66
|
71
|
binder.bind(test, StringTest.class);
|
67
|
72
|
|
68
|
73
|
assertEquals("test123", test.field);
|
|
@@ -84,8 +89,10 @@ public class ConfigBinderTest {
|
84
|
89
|
}
|
85
|
90
|
|
86
|
91
|
final StringTest test = new StringTest();
|
87
|
|
- when(configProvider.getOptionString("test", "foo")).thenReturn("test123");
|
88
|
|
- when(configProvider.getOptionString("test", "bar")).thenReturn("test456");
|
|
92
|
+ when(configProvider.getOptionString(eq("test"), eq("foo"), anyBoolean(), any()))
|
|
93
|
+ .thenReturn("test123");
|
|
94
|
+ when(configProvider.getOptionString(eq("test"), eq("bar"), anyBoolean(), any()))
|
|
95
|
+ .thenReturn("test456");
|
89
|
96
|
binder.withDefaultDomain("test").bind(test, StringTest.class);
|
90
|
97
|
|
91
|
98
|
assertEquals("test123", test.field);
|