@@ -4,7 +4,7 @@ import org.junit.Test
4
4
import org.junit.runner.RunWith
5
5
import org.mockito.Answers
6
6
import org.mockito.Mock
7
- import org.mockito.Mockito
7
+ import org.mockito.Mockito.*
8
8
import org.mockito.junit.MockitoJUnitRunner
9
9
10
10
/* *
@@ -13,122 +13,122 @@ import org.mockito.junit.MockitoJUnitRunner
13
13
* @author Sebastien Deleuze
14
14
*/
15
15
@RunWith(MockitoJUnitRunner ::class )
16
- class ListenableBeanFactoryExtensionsTests {
17
-
18
- @Mock(answer = Answers .RETURNS_MOCKS )
19
- lateinit var lbf: ListableBeanFactory
20
-
21
- @Test
22
- fun `getBeanNamesForType with KClass` () {
23
- lbf.getBeanNamesForType(Foo ::class )
24
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForType(Foo ::class .java, true , true )
25
- }
26
-
27
- @Test
28
- fun `getBeanNamesForType with KClass and Boolean` () {
29
- lbf.getBeanNamesForType(Foo ::class , false )
30
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForType(Foo ::class .java, false , true )
31
- }
32
-
33
- @Test
34
- fun `getBeanNamesForType with KClass, Boolean and Boolean` () {
35
- lbf.getBeanNamesForType(Foo ::class , false , false )
36
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForType(Foo ::class .java, false , false )
37
- }
38
-
39
- @Test
40
- fun `getBeanNamesForType with reified type parameters` () {
41
- lbf.getBeanNamesForType<Foo >()
42
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForType(Foo ::class .java, true , true )
43
- }
44
-
45
- @Test
46
- fun `getBeanNamesForType with reified type parameters and Boolean` () {
47
- lbf.getBeanNamesForType<Foo >(false )
48
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForType(Foo ::class .java, false , true )
49
- }
50
-
51
- @Test
52
- fun `getBeanNamesForType with reified type parameters, Boolean and Boolean` () {
53
- lbf.getBeanNamesForType<Foo >(false , false )
54
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForType(Foo ::class .java, false , false )
55
- }
56
-
57
- @Test
58
- fun `getBeansOfType with KClass` () {
59
- lbf.getBeansOfType(Foo ::class )
60
- Mockito . verify(lbf, Mockito . times(1 )).getBeansOfType(Foo ::class .java, true , true )
61
- }
62
-
63
- @Test
64
- fun `getBeansOfType with KClass and Boolean` () {
65
- lbf.getBeansOfType(Foo ::class , false )
66
- Mockito . verify(lbf, Mockito . times(1 )).getBeansOfType(Foo ::class .java, false , true )
67
- }
68
-
69
- @Test
70
- fun `getBeansOfType with KClass, Boolean and Boolean` () {
71
- lbf.getBeansOfType(Foo ::class , false , false )
72
- Mockito . verify(lbf, Mockito . times(1 )).getBeansOfType(Foo ::class .java, false , false )
73
- }
74
-
75
- @Test
76
- fun `getBeansOfType with reified type parameters` () {
77
- lbf.getBeansOfType<Foo >()
78
- Mockito . verify(lbf, Mockito . times(1 )).getBeansOfType(Foo ::class .java, true , true )
79
- }
80
-
81
- @Test
82
- fun `getBeansOfType with reified type parameters and Boolean` () {
83
- lbf.getBeansOfType<Foo >(false )
84
- Mockito . verify(lbf, Mockito . times(1 )).getBeansOfType(Foo ::class .java, false , true )
85
- }
86
-
87
- @Test
88
- fun `getBeansOfType with reified type parameters, Boolean and Boolean` () {
89
- lbf.getBeansOfType<Foo >(false , false )
90
- Mockito . verify(lbf, Mockito . times(1 )).getBeansOfType(Foo ::class .java, false , false )
91
- }
92
-
93
- @Test
94
- fun `getBeanNamesForAnnotation with KClass` () {
95
- lbf.getBeanNamesForAnnotation(Bar ::class )
96
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForAnnotation(Bar ::class .java)
97
- }
98
-
99
- @Test
100
- fun `getBeanNamesForAnnotation with reified type parameters` () {
101
- lbf.getBeanNamesForAnnotation<Bar >()
102
- Mockito . verify(lbf, Mockito . times(1 )).getBeanNamesForAnnotation(Bar ::class .java)
103
- }
104
-
105
- @Test
106
- fun `getBeansWithAnnotation with KClass` () {
107
- lbf.getBeansWithAnnotation(Bar ::class )
108
- Mockito . verify(lbf, Mockito . times(1 )).getBeansWithAnnotation(Bar ::class .java)
109
- }
110
-
111
- @Test
112
- fun `getBeansWithAnnotation with reified type parameters` () {
113
- lbf.getBeansWithAnnotation<Bar >()
114
- Mockito . verify(lbf, Mockito . times(1 )).getBeansWithAnnotation(Bar ::class .java)
115
- }
116
-
117
- @Test
118
- fun `findAnnotationOnBean with String and KClass` () {
119
- val name = " bar"
120
- lbf.findAnnotationOnBean(name, Bar ::class )
121
- Mockito . verify(lbf, Mockito . times(1 )).findAnnotationOnBean(name, Bar ::class .java)
122
- }
123
-
124
- @Test
125
- fun `findAnnotationOnBean with String and reified type parameters` () {
126
- val name = " bar"
127
- lbf.findAnnotationOnBean<Bar >(name)
128
- Mockito . verify(lbf, Mockito . times(1 )).findAnnotationOnBean(name, Bar ::class .java)
129
- }
130
-
131
- class Foo
132
-
133
- annotation class Bar
16
+ class ListableBeanFactoryExtensionsTests {
17
+
18
+ @Mock(answer = Answers .RETURNS_MOCKS )
19
+ lateinit var lbf: ListableBeanFactory
20
+
21
+ @Test
22
+ fun `getBeanNamesForType with KClass` () {
23
+ lbf.getBeanNamesForType(Foo ::class )
24
+ verify(lbf, times(1 )).getBeanNamesForType(Foo ::class .java, true , true )
25
+ }
26
+
27
+ @Test
28
+ fun `getBeanNamesForType with KClass and Boolean` () {
29
+ lbf.getBeanNamesForType(Foo ::class , false )
30
+ verify(lbf, times(1 )).getBeanNamesForType(Foo ::class .java, false , true )
31
+ }
32
+
33
+ @Test
34
+ fun `getBeanNamesForType with KClass, Boolean and Boolean` () {
35
+ lbf.getBeanNamesForType(Foo ::class , false , false )
36
+ verify(lbf, times(1 )).getBeanNamesForType(Foo ::class .java, false , false )
37
+ }
38
+
39
+ @Test
40
+ fun `getBeanNamesForType with reified type parameters` () {
41
+ lbf.getBeanNamesForType<Foo >()
42
+ verify(lbf, times(1 )).getBeanNamesForType(Foo ::class .java, true , true )
43
+ }
44
+
45
+ @Test
46
+ fun `getBeanNamesForType with reified type parameters and Boolean` () {
47
+ lbf.getBeanNamesForType<Foo >(false )
48
+ verify(lbf, times(1 )).getBeanNamesForType(Foo ::class .java, false , true )
49
+ }
50
+
51
+ @Test
52
+ fun `getBeanNamesForType with reified type parameters, Boolean and Boolean` () {
53
+ lbf.getBeanNamesForType<Foo >(false , false )
54
+ verify(lbf, times(1 )).getBeanNamesForType(Foo ::class .java, false , false )
55
+ }
56
+
57
+ @Test
58
+ fun `getBeansOfType with KClass` () {
59
+ lbf.getBeansOfType(Foo ::class )
60
+ verify(lbf, times(1 )).getBeansOfType(Foo ::class .java, true , true )
61
+ }
62
+
63
+ @Test
64
+ fun `getBeansOfType with KClass and Boolean` () {
65
+ lbf.getBeansOfType(Foo ::class , false )
66
+ verify(lbf, times(1 )).getBeansOfType(Foo ::class .java, false , true )
67
+ }
68
+
69
+ @Test
70
+ fun `getBeansOfType with KClass, Boolean and Boolean` () {
71
+ lbf.getBeansOfType(Foo ::class , false , false )
72
+ verify(lbf, times(1 )).getBeansOfType(Foo ::class .java, false , false )
73
+ }
74
+
75
+ @Test
76
+ fun `getBeansOfType with reified type parameters` () {
77
+ lbf.getBeansOfType<Foo >()
78
+ verify(lbf, times(1 )).getBeansOfType(Foo ::class .java, true , true )
79
+ }
80
+
81
+ @Test
82
+ fun `getBeansOfType with reified type parameters and Boolean` () {
83
+ lbf.getBeansOfType<Foo >(false )
84
+ verify(lbf, times(1 )).getBeansOfType(Foo ::class .java, false , true )
85
+ }
86
+
87
+ @Test
88
+ fun `getBeansOfType with reified type parameters, Boolean and Boolean` () {
89
+ lbf.getBeansOfType<Foo >(false , false )
90
+ verify(lbf, times(1 )).getBeansOfType(Foo ::class .java, false , false )
91
+ }
92
+
93
+ @Test
94
+ fun `getBeanNamesForAnnotation with KClass` () {
95
+ lbf.getBeanNamesForAnnotation(Bar ::class )
96
+ verify(lbf, times(1 )).getBeanNamesForAnnotation(Bar ::class .java)
97
+ }
98
+
99
+ @Test
100
+ fun `getBeanNamesForAnnotation with reified type parameters` () {
101
+ lbf.getBeanNamesForAnnotation<Bar >()
102
+ verify(lbf, times(1 )).getBeanNamesForAnnotation(Bar ::class .java)
103
+ }
104
+
105
+ @Test
106
+ fun `getBeansWithAnnotation with KClass` () {
107
+ lbf.getBeansWithAnnotation(Bar ::class )
108
+ verify(lbf, times(1 )).getBeansWithAnnotation(Bar ::class .java)
109
+ }
110
+
111
+ @Test
112
+ fun `getBeansWithAnnotation with reified type parameters` () {
113
+ lbf.getBeansWithAnnotation<Bar >()
114
+ verify(lbf, times(1 )).getBeansWithAnnotation(Bar ::class .java)
115
+ }
116
+
117
+ @Test
118
+ fun `findAnnotationOnBean with String and KClass` () {
119
+ val name = " bar"
120
+ lbf.findAnnotationOnBean(name, Bar ::class )
121
+ verify(lbf, times(1 )).findAnnotationOnBean(name, Bar ::class .java)
122
+ }
123
+
124
+ @Test
125
+ fun `findAnnotationOnBean with String and reified type parameters` () {
126
+ val name = " bar"
127
+ lbf.findAnnotationOnBean<Bar >(name)
128
+ verify(lbf, times(1 )).findAnnotationOnBean(name, Bar ::class .java)
129
+ }
130
+
131
+ class Foo
132
+
133
+ annotation class Bar
134
134
}
0 commit comments