src/test/java/org/springframework/samples/petclinic/web/AnuncioControllerTests.java
@WithMockUser(value = "testuser")
	@Test
	public void testDeleteAnuncio() throws Exception {
		Solicitud sol = new Solicitud();
		Collection<Solicitud> col = new ArrayList();
		col.add(sol);
		this.anuncio.setSolicitud(col);

		this.mockMvc.perform(MockMvcRequestBuilders.get("/beavers/{beaverId}/anuncios/{anuncioId}/delete", AnuncioControllerTests.TEST_BEAVER_ID, AnuncioControllerTests.TEST_ANUNCIO_ID).with(SecurityMockMvcRequestPostProcessors.csrf()))
			.andExpect(MockMvcResultMatchers.status().is3xxRedirection()).andExpect(MockMvcResultMatchers.view().name("redirect:/beavers/" + AnuncioControllerTests.TEST_BEAVER_ID + "/misPublicaciones"));
	}
// TESTS PARA EL DELETE DE ANUNCIOS
TESTS PARA EL DELETE DE ANUNCIOS
TESTS PARA EL DELETE DE ANUNCIOS
@WithMockUser(value = "testuser")
	@Test
	public void testDeleteAnuncio() throws Exception {
		Solicitud sol = new Solicitud();
		Collection<Solicitud> col = new ArrayList();
		col.add(sol);
		this.anuncio.setSolicitud(col);
		this.mockMvc.perform(MockMvcRequestBuilders.get("/beavers/{beaverId}/anuncios/{anuncioId}/delete", AnuncioControllerTests.TEST_BEAVER_ID, AnuncioControllerTests.TEST_ANUNCIO_ID).with(SecurityMockMvcRequestPostProcessors.csrf()))
			.andExpect(MockMvcResultMatchers.status().is3xxRedirection()).andExpect(MockMvcResultMatchers.view().name("redirect:/beavers/" + AnuncioControllerTests.TEST_BEAVER_ID + "/misPublicaciones"));
	}
@ WithMockUser ( value = "testuser" ) @ Test public void testDeleteAnuncio ( ) throws Exception { Solicitud sol = new Solicitud ( ) ; Collection < Solicitud > col = new ArrayList ( ) ; col . add ( sol ) ; this . anuncio . setSolicitud ( col ) ; this . mockMvc . perform ( MockMvcRequestBuilders . get ( "/beavers/{beaverId}/anuncios/{anuncioId}/delete" , AnuncioControllerTests . TEST_BEAVER_ID , AnuncioControllerTests . TEST_ANUNCIO_ID ) . with ( SecurityMockMvcRequestPostProcessors . csrf ( ) ) ) . andExpect ( MockMvcResultMatchers . status ( ) . is3xxRedirection ( ) ) . andExpect ( MockMvcResultMatchers . view ( ) . name ( "redirect:/beavers/" + AnuncioControllerTests . TEST_BEAVER_ID + "/misPublicaciones" ) ) ; }
TESTS PARA EL DELETE DE ANUNCIOS
TESTS PARA EL DELETE DE ANUNCIOS