|
20 | 20 | import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INVOCATIONCONTEXT;
|
21 | 21 | import static org.testng.Assert.assertEquals;
|
22 | 22 | import static org.testng.Assert.assertFalse;
|
| 23 | +import static org.testng.Assert.assertNull; |
23 | 24 | import static org.testng.Assert.assertSame;
|
24 | 25 | import static org.testng.Assert.assertTrue;
|
25 | 26 |
|
|
31 | 32 | import org.jboss.test.audit.annotations.SpecVersion;
|
32 | 33 | import org.testng.annotations.Test;
|
33 | 34 |
|
| 35 | +import java.util.Set; |
| 36 | + |
34 | 37 | /**
|
35 | 38 | * Tests for the InvocationContext implementation
|
36 | 39 | *
|
@@ -122,4 +125,24 @@ public void testBusinessMethodNotCalledWithoutProceedInvocation() {
|
122 | 125 | assertEquals(getContextualReference(SimpleBean.class).echo("foo"), "foo");
|
123 | 126 | assertFalse(SimpleBean.isEchoCalled());
|
124 | 127 | }
|
| 128 | + |
| 129 | + @Test |
| 130 | + @SpecAssertion(section = INVOCATIONCONTEXT, id = "n") |
| 131 | + @SpecAssertion(section = INVOCATIONCONTEXT, id = "o") |
| 132 | + public void testGetInterceptorBindings() { |
| 133 | + assertTrue(getContextualReference(SimpleBean.class).bindings()); |
| 134 | + assertEquals(AroundConstructInterceptor1.getAllBindings(), Set.of(new SimplePCBinding.Literal(), |
| 135 | + new PseudoBinding.Literal(), new AroundConstructBinding1.Literal(), |
| 136 | + new AroundConstructBinding2.Literal())); |
| 137 | + assertEquals(AroundConstructInterceptor1.getAllBindings(), AroundConstructInterceptor2.getAllBindings()); |
| 138 | + assertEquals(PostConstructInterceptor.getAllBindings(), Set.of(new SimplePCBinding.Literal(), |
| 139 | + new PseudoBinding.Literal(), new AroundConstructBinding1.Literal())); |
| 140 | + assertEquals(Interceptor12.getAllBindings(), Set.of(new SimplePCBinding.Literal(), new PseudoBinding.Literal(), |
| 141 | + new AroundConstructBinding1.Literal(), new Binding11.Literal(), new Binding12.Literal(), |
| 142 | + new Binding13.Literal("ko"), new Binding14.Literal("foobar"))); |
| 143 | + assertEquals(Interceptor12.getBinding12s(), Set.of(new Binding12.Literal())); |
| 144 | + assertEquals(Interceptor12.getBinding12(), new Binding12.Literal()); |
| 145 | + assertEquals(Interceptor12.getBinding5s(), Set.of()); |
| 146 | + assertNull(Interceptor12.getBinding6()); |
| 147 | + } |
125 | 148 | }
|
0 commit comments