I've a very simple test:
@RunWith(Arquillian.class)
public class SimpleTest
{
@Inject private SingleEntity singleEntity;
@Deployment
public static JavaArchive createDeployment()
{
return ShrinkWrap.create(JavaArchive.class)
.addClass(SingleEntity.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
@Test
public void categorize()
{
assertNotNull(this.singleEntity);
}
}
I only want to inject a object of type SingleEntity. SingleEntity is a single POJO:
public class SingleEntity
{
private String id;
private String description;
public SingleEntity(String id, String description) {
super();
this.id = id;
this.description = description;
}
//getters & setters
}
After, that I perform gradle test. I've configured tests in order for Arquillian to perform them in a Wildfly embedded instance:
<arquillian xmlns="http://ift.tt/Rj5rcy"
xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/Rj5rcy http://ift.tt/U5TLp1">
<container qualifier="jboss" default="true">
<configuration>
<!-- Supported property names: [managementPort, username, managementAddress, bundlePath, managementProtocol,
cleanServerBaseDir, jbossHome, password, modulePath] -->
<property name="jbossHome">C:\servers\wildfly-Test-8.2.0.Final</property>
<property name="modulePath">C:\servers\wildfly-Test-8.2.0.Final\modules\</property>
<!-- <property name="managementPort">8888</property> -->
</configuration>
</container>
</arquillian>
It's very straightforward, however, I receive a exception telling me SingleEntity cann't be resolved:
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type SingleEntity with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private com.jeusdi.arquillian.SimpleTest.singleEntity at com.jeusdi.arquillian.SimpleTest.singleEntity(SimpleTest.java:0)
Any ideas? Thanks for all
Aucun commentaire:
Enregistrer un commentaire