@Test
  @Transactional
  public void createJugador() throws Exception {
    int databaseSizeBeforeCreate = jugadorRepository.findAll().size();

    // Create the Jugador

    restJugadorMockMvc
        .perform(
            post("/api/jugadors")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(jugador)))
        .andExpect(status().isCreated());

    // Validate the Jugador in the database
    List<Jugador> jugadors = jugadorRepository.findAll();
    assertThat(jugadors).hasSize(databaseSizeBeforeCreate + 1);
    Jugador testJugador = jugadors.get(jugadors.size() - 1);
    assertThat(testJugador.getName()).isEqualTo(DEFAULT_NAME);
    assertThat(testJugador.getBirthDate()).isEqualTo(DEFAULT_BIRTH_DATE);
    assertThat(testJugador.getCanastas()).isEqualTo(DEFAULT_CANASTAS);
    assertThat(testJugador.getAsistencias()).isEqualTo(DEFAULT_ASISTENCIAS);
    assertThat(testJugador.getRebotes()).isEqualTo(DEFAULT_REBOTES);
    assertThat(testJugador.getPosicion()).isEqualTo(DEFAULT_POSICION);
  }
  @Test
  @Transactional
  public void getJugador() throws Exception {
    // Initialize the database
    jugadorRepository.saveAndFlush(jugador);

    // Get the jugador
    restJugadorMockMvc
        .perform(get("/api/jugadors/{id}", jugador.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.id").value(jugador.getId().intValue()))
        .andExpect(jsonPath("$.name").value(DEFAULT_NAME.toString()))
        .andExpect(jsonPath("$.birthDate").value(DEFAULT_BIRTH_DATE.toString()))
        .andExpect(jsonPath("$.canastas").value(DEFAULT_CANASTAS))
        .andExpect(jsonPath("$.asistencias").value(DEFAULT_ASISTENCIAS))
        .andExpect(jsonPath("$.rebotes").value(DEFAULT_REBOTES))
        .andExpect(jsonPath("$.posicion").value(DEFAULT_POSICION.toString()));
  }
 @Before
 public void initTest() {
   jugador = new Jugador();
   jugador.setName(DEFAULT_NAME);
   jugador.setBirthDate(DEFAULT_BIRTH_DATE);
   jugador.setCanastas(DEFAULT_CANASTAS);
   jugador.setAsistencias(DEFAULT_ASISTENCIAS);
   jugador.setRebotes(DEFAULT_REBOTES);
   jugador.setPosicion(DEFAULT_POSICION);
 }
  @Test
  @Transactional
  public void deleteJugador() throws Exception {
    // Initialize the database
    jugadorRepository.saveAndFlush(jugador);

    int databaseSizeBeforeDelete = jugadorRepository.findAll().size();

    // Get the jugador
    restJugadorMockMvc
        .perform(
            delete("/api/jugadors/{id}", jugador.getId()).accept(TestUtil.APPLICATION_JSON_UTF8))
        .andExpect(status().isOk());

    // Validate the database is empty
    List<Jugador> jugadors = jugadorRepository.findAll();
    assertThat(jugadors).hasSize(databaseSizeBeforeDelete - 1);
  }
  @Test
  @Transactional
  public void updateJugador() throws Exception {
    // Initialize the database
    jugadorRepository.saveAndFlush(jugador);

    int databaseSizeBeforeUpdate = jugadorRepository.findAll().size();

    // Update the jugador
    jugador.setName(UPDATED_NAME);
    jugador.setBirthDate(UPDATED_BIRTH_DATE);
    jugador.setCanastas(UPDATED_CANASTAS);
    jugador.setAsistencias(UPDATED_ASISTENCIAS);
    jugador.setRebotes(UPDATED_REBOTES);
    jugador.setPosicion(UPDATED_POSICION);

    restJugadorMockMvc
        .perform(
            put("/api/jugadors")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(jugador)))
        .andExpect(status().isOk());

    // Validate the Jugador in the database
    List<Jugador> jugadors = jugadorRepository.findAll();
    assertThat(jugadors).hasSize(databaseSizeBeforeUpdate);
    Jugador testJugador = jugadors.get(jugadors.size() - 1);
    assertThat(testJugador.getName()).isEqualTo(UPDATED_NAME);
    assertThat(testJugador.getBirthDate()).isEqualTo(UPDATED_BIRTH_DATE);
    assertThat(testJugador.getCanastas()).isEqualTo(UPDATED_CANASTAS);
    assertThat(testJugador.getAsistencias()).isEqualTo(UPDATED_ASISTENCIAS);
    assertThat(testJugador.getRebotes()).isEqualTo(UPDATED_REBOTES);
    assertThat(testJugador.getPosicion()).isEqualTo(UPDATED_POSICION);
  }