@Test
public void deleteAppTest() throws Exception {

	// forbidden
	this.mockMvc
			.perform(MockMvcRequestBuilders.delete(ACCOUNT_APP_URL + "/mouaiccool")
					.header("Content-Type", "application/json").with(user))
			.andExpect(MockMvcResultMatchers.status().is(HttpStatus.FORBIDDEN_403));
	// delete unknown app account
	this.mockMvc
			.perform(MockMvcRequestBuilders.delete(ACCOUNT_APP_URL + "/mouaiccool")
					.header("Content-Type", "application/json").with(admin))
			.andExpect(MockMvcResultMatchers.status().is(HttpStatus.NOT_FOUND_404));
	// create login auth app no certificate gen
	OadrAppCreateDto dto = new OadrAppCreateDto();
	dto.setCommonName("myapp");
	dto.setUsername("myapp");
	dto.setAuthenticationType("login");
	dto.setPassword("pass");
	byte[] content = mapper.writeValueAsBytes(dto);
	MvcResult andReturn = this.mockMvc
			.perform(MockMvcRequestBuilders.post(ACCOUNT_APP_URL).content(content)
					.header("Content-Type", "application/json").with(admin))
			.andExpect(MockMvcResultMatchers.status().is(HttpStatus.CREATED_201)).andReturn();
	assertEquals(0, andReturn.getResponse().getContentLength());
	// verify app has been created
	OadrApp findByUsername = oadrAppService.findByUsername("myapp");
	assertNotNull(findByUsername);
	// delete app account
	this.mockMvc
			.perform(MockMvcRequestBuilders.delete(ACCOUNT_APP_URL + "/myapp")
					.header("Content-Type", "application/json").with(admin))
			.andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200));
	// verify app has been deleted
	findByUsername = oadrAppService.findByUsername("myapp");
	assertNull(findByUsername);
}