Skip to content

Instantly share code, notes, and snippets.

@PiotrNowicki
Last active December 14, 2015 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PiotrNowicki/5124212 to your computer and use it in GitHub Desktop.
Save PiotrNowicki/5124212 to your computer and use it in GitHub Desktop.
@RunWith(Arquillian.class)
public class BusinessLogicTest {
// without .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") Arquillian is not injecting the EJB here (its null).
@EJB
BusinessLogic bl;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addPackages(true, "com.piotrnowicki.spikes").addAsManifestResource("META-INF/persistence.xml", "persistence.xml").addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
@Test
public void should_create_greeting() {
System.out.println("Inside: " + bl);
bl.test();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment