@Test @Transactional public void getJugadores() throws Exception { // Initialize the database jugadoresRepository.saveAndFlush(jugadores); // Get the jugadores restJugadoresMockMvc .perform(get("/api/jugadoress/{id}", jugadores.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.id").value(jugadores.getId().intValue())) .andExpect(jsonPath("$.nombreJugador").value(DEFAULT_NOMBRE_JUGADOR.toString())) .andExpect(jsonPath("$.fechaNacimiento").value(DEFAULT_FECHA_NACIMIENTO.toString())) .andExpect(jsonPath("$.numCanastas").value(DEFAULT_NUM_CANASTAS)) .andExpect(jsonPath("$.numAsistencias").value(DEFAULT_NUM_ASISTENCIAS)) .andExpect(jsonPath("$.numRebotes").value(DEFAULT_NUM_REBOTES)) .andExpect(jsonPath("$.posicion").value(DEFAULT_POSICION.toString())); }
@Test @Transactional public void deleteJugadores() throws Exception { // Initialize the database jugadoresRepository.saveAndFlush(jugadores); int databaseSizeBeforeDelete = jugadoresRepository.findAll().size(); // Get the jugadores restJugadoresMockMvc .perform( delete("/api/jugadoress/{id}", jugadores.getId()) .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); // Validate the database is empty List<Jugadores> jugadoress = jugadoresRepository.findAll(); assertThat(jugadoress).hasSize(databaseSizeBeforeDelete - 1); }