-
Notifications
You must be signed in to change notification settings - Fork 45
/
ProducerMethodDefinitionTest.java
35 lines (29 loc) · 1.55 KB
/
ProducerMethodDefinitionTest.java
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
package org.jboss.cdi.tck.tests.full.implementation.producer.method.definition;
import static org.jboss.cdi.tck.TestGroups.CDI_FULL;
import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE;
import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZATION;
import static org.testng.Assert.assertEquals;
import jakarta.enterprise.inject.UnsatisfiedResolutionException;
import jakarta.enterprise.util.AnnotationLiteral;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.cdi.tck.AbstractTest;
import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.testng.annotations.Test;
@SpecVersion(spec = "cdi", version = "2.0")
@Test(groups = CDI_FULL)
public class ProducerMethodDefinitionTest extends AbstractTest {
@Deployment
public static WebArchive createTestArchive() {
return new WebArchiveBuilder().withTestClassPackage(ProducerMethodDefinitionTest.class).build();
}
@Test(expectedExceptions = UnsatisfiedResolutionException.class)
@SpecAssertions({ @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE, id = "da"), @SpecAssertion(section = SPECIALIZATION, id = "cb") })
public void testNonStaticProducerMethodNotInheritedBySpecializingSubclass() {
assertEquals(getBeans(Egg.class, new Yummy.Literal()).size(), 0);
getContextualReference(Egg.class, new Yummy.Literal());
}
}