= Apache Meecrowave Apache Meecrowave is a small Microprofile server (JAX-RS + CDI + JSON) fully based on Apache products. == How to start If you want to start with your first *Hello World* you have to add the following dependencies to your `pom.xml`. ```xml 1.2.1 9.0.5 org.apache.geronimo.specs geronimo-atinject_1.0_spec 1.0 provided org.apache.geronimo.specs geronimo-jcdi_2.0_spec 1.0 provided org.apache.geronimo.specs geronimo-jaxrs_2.0_spec 1.0-alpha-1 provided org.apache.geronimo.specs geronimo-json_1.1_spec 1.0 provided org.apache.logging.log4j log4j-api 2.9.1 provided org.apache.tomcat tomcat-servlet-api ${tomcat-servlet-api.version} ``` This is not very convenient, means that an aggregating jar will be created soon to minimize thee amount of dependencies you have to declare. The project itself should be used with Java8 as the minimum JDK-version. To work with the latest SNAPSHOT, you can clone the repo and make a ```mvn clean install```. == Hello World - REST - trivial Let´s start with an minimal REST Endpoint. The only result you can get is a *Hello World*. Additionally there is a class called ```HelloApplication``` to make sure your path will start with **/api/** ```java @Dependent @ApplicationPath("api") public class HelloApplication extends Application { } @Path("hello") @ApplicationScoped public class HelloEndpoint { @GET @Produces(MediaType.APPLICATION_JSON) public String sayHi() { return "Hello World"; } } ``` You can start writing your first test , now. Using junit4, the test class should annotated with ```@RunWith(MonoMeecrowave.Runner.class)``` The Container start and stop will be managed for you. To have access to the dynamic data, like the random used port, use the the injected ```Meecrowave.Builder````. The test-request itself is written like a normal request. This example is using the class ```javax.ws.rs.client.ClientBuilder```. ```java @RunWith(MonoMeecrowave.Runner.class) public class HelloEndpointTest { @ConfigurationInject private Meecrowave.Builder configuration; @Test public void hello() { final Client client = ClientBuilder.newClient(); try { assertEquals("Hello World", client.target("http://localhost:" + configuration.getHttpPort()) .path("api/hello") .request(APPLICATION_JSON_TYPE) .get(String.class)); } finally { client.close(); } } } ```