@Test
  @Transactional
  public void updateStudent() throws Exception {
    // Initialize the database
    studentRepository.saveAndFlush(student);

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

    // Update the student
    student.setSid(UPDATED_SID);
    student.setLastName(UPDATED_LAST_NAME);
    student.setFirstName(UPDATED_FIRST_NAME);
    student.setEmail(UPDATED_EMAIL);
    student.setPhone(UPDATED_PHONE);

    restStudentMockMvc
        .perform(
            put("/api/students")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(student)))
        .andExpect(status().isOk());

    // Validate the Student in the database
    List<Student> students = studentRepository.findAll();
    assertThat(students).hasSize(databaseSizeBeforeUpdate);
    Student testStudent = students.get(students.size() - 1);
    assertThat(testStudent.getSid()).isEqualTo(UPDATED_SID);
    assertThat(testStudent.getLastName()).isEqualTo(UPDATED_LAST_NAME);
    assertThat(testStudent.getFirstName()).isEqualTo(UPDATED_FIRST_NAME);
    assertThat(testStudent.getEmail()).isEqualTo(UPDATED_EMAIL);
    assertThat(testStudent.getPhone()).isEqualTo(UPDATED_PHONE);
  }
  @Test
  @Transactional
  public void createStudent() throws Exception {
    int databaseSizeBeforeCreate = studentRepository.findAll().size();

    // Create the Student

    restStudentMockMvc
        .perform(
            post("/api/students")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(student)))
        .andExpect(status().isCreated());

    // Validate the Student in the database
    List<Student> students = studentRepository.findAll();
    assertThat(students).hasSize(databaseSizeBeforeCreate + 1);
    Student testStudent = students.get(students.size() - 1);
    assertThat(testStudent.getSid()).isEqualTo(DEFAULT_SID);
    assertThat(testStudent.getLastName()).isEqualTo(DEFAULT_LAST_NAME);
    assertThat(testStudent.getFirstName()).isEqualTo(DEFAULT_FIRST_NAME);
    assertThat(testStudent.getEmail()).isEqualTo(DEFAULT_EMAIL);
    assertThat(testStudent.getPhone()).isEqualTo(DEFAULT_PHONE);
  }