Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust CustomStereotypeTest to also include annotated class which sho… #323

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

@SpecVersion(spec = "cdi", version = "4.0")
public class CustomStereotypeTest extends AbstractTest {
Expand All @@ -27,5 +28,7 @@ public static WebArchive createTestArchive() {
public void test() {
assertEquals(ApplicationScoped.class, getUniqueBean(MyService.class).getScope());
assertEquals("Hello!", getContextualReference(MyService.class).hello());

assertTrue(getBeans(NotDiscoveredBean.class).isEmpty());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.jboss.cdi.tck.tests.build.compatible.extensions.customStereotype;

import jakarta.enterprise.context.Dependent;

/**
* Deployment for this test contains only one archive with no beans.xml and an extension.
* For some EE containers this might trigger an optimization where they do not bootstrap CDI container.
* Presence of this CDI-annotated class can help prevent it.
*
* Due to the archive not being a bean archive, this class should not be discovered as a bean despite having bean
* defining annotation.
*/
@Dependent
public class NotDiscoveredBean {
}