Last Updated: July 19, 2016
· adamyin

Create first unit test with Arquillian

Required environment:

Step 1 – Create a new Maven project in Netbeans

Name: ArquillianDemo1
Add Maven Compiler Plugin
Add the Arquillian APIs in the pom.xml file.


The Arquillian JUnit integration artifact also adds the Arquillian Core and ShrinkWrap APIs to the test classpath.
Optional (but recommanded): Upgrade the Maven Surefire Plugin from the default version.

Step2 – Create a new Java class named “Greeter” in the com.adam.arquilliandemo1.example package, with below code:

package com.adam.arquilliandemo1.example;


public class Greeter {

public void greet(PrintStream to, String name) {


private String createGreeing(String name) {
    return "Hello, " + name + "!";