コード例 #1
0
 @Before
 @Transactional
 public void setUp() throws Exception {
   comment = repo.save(new Comment(ObjectId.get().toHexString(), 1L, "#foos"));
   this.parser = new JsonParser(mapper);
   mvc = MockMvcBuilders.webAppContextSetup(wac).alwaysDo(print()).build();
 }
コード例 #2
0
 @Test
 public void testDeleteOne() throws Exception {
   MvcResult deleteComment =
       mvc.perform(
               delete("/inns/{innId}/comments/{comment}", comment.getInn(), comment.getId())
                   .principal(MockUser.mock()))
           .andExpect(request().asyncStarted())
           .andReturn();
   mvc.perform(asyncDispatch(deleteComment)).andExpect(status().isNoContent());
   assertThat(
       "Object must not exist after deletion",
       repo.findOne(comment.getId()),
       is(nullValue(Comment.class)));
 }
コード例 #3
0
 @After
 public void tearDown() throws Exception {
   repo.delete(comment);
 }