### Question:
UsersService { public void add(@Valid User newUser) { em.persist(newUser); }  User isValid(String username, String password); Set<User> getAll(); void add(@Valid User newUser); boolean update(User updated); void remove(Long id); Optional<User> get(Long id); List<String> getNames();  }### Answer:
@Test public void testCreateUser(@ArquillianResource URL resource) throws Exception { URL apiUrl = new URL(resource, "resources/users"); JsonObject user = Json.createObjectBuilder() .add("name", "Marcus") .add("email", "marcus_1982@jee8ng.org") .add("credential", credential("marcus", "1234")) .build(); Response initiallyCreated = ClientBuilder.newClient().target(apiUrl.toURI()) .request(MediaType.APPLICATION_JSON) .post(Entity.json(user)); assertThat(initiallyCreated.getStatus(), is(201)); String location = initiallyCreated.getHeaderString("Location"); assertNotNull(location); }