@@ -0,0 +1,2403 @@
+package ch.sportchef.business.user.bundary;%0A%0Aimport com.airhacks.rulz.jaxrsclient.JAXRSClientProvider;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Aimport javax.json.Json;%0Aimport javax.json.JsonObject;%0Aimport javax.ws.rs.client.Entity;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.ws.rs.core.Response;%0A%0Aimport static com.airhacks.rulz.jaxrsclient.JAXRSClientProvider.buildWithURI;%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.CoreMatchers.notNullValue;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.junit.Assert.assertTrue;%0A%0Apublic class EventResourceIT %7B%0A%0A    @Rule%0A    public final JAXRSClientProvider provider = buildWithURI(%22http://localhost:8080/sportchef/api/events%22);%0A%0A    @Test%0A    public void crud() %7B%0A        // create%0A        final String location = createEventWithSuccess();%0A        createEventWithBadRequest();%0A    %7D%0A%0A    private long getEventId(final String location) %7B%0A        return Long.parseLong(location.substring(location.lastIndexOf(%22/%22) + 1));%0A    %7D%0A%0A    private String createEventWithSuccess() %7B%0A        // arrange%0A        final JsonObject eventToCreate = Json.createObjectBuilder()%0A                .add(%22title%22, %22Christmas Party%22)%0A                .add(%22location%22, %22Town Hall%22)%0A                .add(%22date%22, %222015-12-24%22)%0A                .add(%22time%22, %2218:00%22)%0A                .build();%0A%0A        // act%0A        final Response response = this.provider.target().request(MediaType.APPLICATION_JSON).post(Entity.json(eventToCreate));%0A%0A        //assert%0A        assertThat(response.getStatus(), is(Response.Status.CREATED.getStatusCode()));%0A        final String location = response.getHeaderString(%22Location%22);%0A        assertThat(location, notNullValue());%0A        final long eventId = getEventId(location);%0A        assertTrue(eventId %3E 0);%0A%0A        return location;%0A    %7D%0A%0A    private void createEventWithBadRequest() %7B%0A        // arrange%0A        final JsonObject eventToCreate = Json.createObjectBuilder()%0A                .add(%22title%22, %22%22)%0A                .add(%22location%22, %22%22)%0A                .add(%22date%22, %22%22)%0A                .add(%22time%22, %22%22)%0A                .build();%0A%0A        // act%0A        final Response response = this.provider.target().request(MediaType.APPLICATION_JSON).post(Entity.json(eventToCreate));%0A%0A        //assert%0A        assertThat(response.getStatus(), is(Response.Status.BAD_REQUEST.getStatusCode()));%0A    %7D%0A%0A%7D%0A

write a test first