@Test
public void action_restart_ok() throws Exception {

    final URIBuilder uriBuilder = createGetUrl(ROOT_URI + "/42/action");
    JsonObject request = createJson()
            .add("type", "RESTART")
            .add("data", createJson()
                    .add("totalRestart", "false"))
            .build();
    // performs POST: /api/messages/42/action
    mockMvc.perform(post(toUrl(uriBuilder))
            .content(request.toString())
            .contentType(MediaType.APPLICATION_JSON)
            .accept(MediaType.APPLICATION_JSON)
            .with(SecurityMockMvcRequestPostProcessors.authentication(mockAuthentication("ADMIN"))))
            .andExpect(status().isOk())
            .andExpect(jsonPath("result", is("OK")))
    ;
    Mockito.verify(messageOperationService, times(1)).restartMessage(eq(42L), eq(false));
}