### Question:
NoteResource { @GET @Transactional public Note get() { try { return manager.createQuery("select n from Note n", Note.class).getSingleResult(); } catch (NoResultException e) { Note note = new Note(); note.setContent("Default message"); manager.persist(note); return note; } }  @GET @Transactional Note get(); @POST @Transactional void put(Note newNote);  }### Answer:
@Test public void shouldStoreNote() throws Exception { Note note = new Note(); note.setContent("Hello World!"); RestAssured.given().port(address.getPort()) .when().contentType(ContentType.JSON).body(note).post("/note") .then().statusCode(204); RestAssured.given().port(address.getPort()) .when().get("/note") .then().content(equalTo("{\"content\":\"Hello World!\"}")); }