@@ -21,7 +21,6 @@ class ConditionalTests {
21
21
22
22
@ BeforeEach
23
23
void clearConfig () {
24
-
25
24
Config .eventBuilder ("" )
26
25
.remove ("secondary" )
27
26
.remove ("factory" )
@@ -32,15 +31,14 @@ void clearConfig() {
32
31
}
33
32
34
33
@ Test
35
- void basic () throws IOException {
34
+ void basic () {
36
35
// just wire everything with no test scope, mocks etc
37
36
final BeanScope beanScope = BeanScope .builder ().build ();
38
37
assertTrue (beanScope .getOptional (Bird .class ).isEmpty ());
39
38
}
40
39
41
40
@ Test
42
- void jay () throws IOException {
43
-
41
+ void jay () {
44
42
Config .setProperty ("factory" , "bird" );
45
43
46
44
final BeanScope beanScope = BeanScope .builder ().build ();
@@ -51,8 +49,7 @@ void jay() throws IOException {
51
49
}
52
50
53
51
@ Test
54
- void birdWatch () throws IOException {
55
-
52
+ void birdWatch () {
56
53
Config .setProperty ("factory" , "bird" );
57
54
Config .setProperty ("watcher" , "bird" );
58
55
@@ -62,8 +59,7 @@ void birdWatch() throws IOException {
62
59
}
63
60
64
61
@ Test
65
- void missingBeans () throws IOException {
66
-
62
+ void missingBeans () {
67
63
Config .setProperty ("watcher" , "bird" );
68
64
69
65
final BeanScope beanScope = BeanScope .builder ().build ();
@@ -72,34 +68,33 @@ void missingBeans() throws IOException {
72
68
}
73
69
74
70
@ Test
75
- void noFactory () throws IOException {
76
-
71
+ void noFactory () {
77
72
Config .setProperty ("kiwi" , "somethin" );
78
73
Config .setProperty ("watcher" , "bird" );
79
74
80
75
final BeanScope beanScope = BeanScope .builder ().build ();
81
76
77
+ assertTrue (beanScope .getOptional (WithAspectConditional .class ).isEmpty ());
82
78
assertTrue (beanScope .getOptional (BirdFactory .class ).isEmpty ());
83
79
assertTrue (beanScope .getOptional (BlueJay .class ).isEmpty ());
84
80
assertTrue (beanScope .getOptional (BirdWatcher .class ).isPresent ());
85
81
assertEquals ("Kiwi" , beanScope .get (Bird .class ).toString ());
86
82
}
87
83
88
84
@ Test
89
- void factoryKiwiOverride () throws IOException {
90
-
85
+ void factoryKiwiOverride () {
91
86
Config .setProperty ("kiwi" , "somethin" );
92
87
Config .setProperty ("factory" , "bird" );
93
88
Config .setProperty ("watcher" , "bird" );
94
89
95
90
final BeanScope beanScope = BeanScope .builder ().build ();
96
91
assertTrue (beanScope .getOptional (BirdWatcher .class ).isPresent ());
92
+ assertTrue (beanScope .getOptional (WithAspectConditional .class ).isPresent ());
97
93
assertEquals ("Kiwi" , beanScope .get (Bird .class ).toString ());
98
94
}
99
95
100
96
@ Test
101
- void factorySecondaryOverride () throws IOException {
102
-
97
+ void factorySecondaryOverride () {
103
98
Config .setProperty ("secondary" , "somethin" );
104
99
Config .setProperty ("factory" , "bird" );
105
100
Config .setProperty ("watcher" , "bird" );
@@ -110,16 +105,14 @@ void factorySecondaryOverride() throws IOException {
110
105
}
111
106
112
107
@ Test
113
- void qualifierTest () throws IOException {
114
-
108
+ void qualifierTest () {
115
109
final BeanScope beanScope =
116
110
BeanScope .builder ().bean ("finch" , Bird .class , new StrawberryFinch ()).build ();
117
111
assertTrue (beanScope .getOptional (QualifiedBirdWatcher .class ).isPresent ());
118
112
}
119
113
120
114
@ Test
121
- void metaMetaAnnotationTest () throws IOException {
122
-
115
+ void metaMetaAnnotationTest () {
123
116
Config .setProperty ("finch-time" , "somethin" );
124
117
Config .setProperty ("factory" , "bird" );
125
118
Config .setProperty ("watcher" , "bird" );
0 commit comments