Skip to content

Commit

Permalink
GRAD2-2465 - Delete a student and related data
Browse files Browse the repository at this point in the history
  • Loading branch information
kamal-mohammed committed Mar 4, 2024
1 parent 0f5c00f commit bedd3bf
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,23 @@ public void testSaveTraxStudentNo() {
assertThat(traxStudentNo.getStatus()).isEqualTo(result.getStatus());
}

@Test
public void updateSaveTraxStudentNo() {
TraxStudentNo traxStudentNo = new TraxStudentNo();
traxStudentNo.setStudNo("123456789");
traxStudentNo.setStatus("Y");

TraxStudentNoEntity traxStudentNoEntity = traxStudentNoTransformer.transformToEntity(traxStudentNo);

when(traxStudentNoRepository.findById(traxStudentNo.getStudNo())).thenReturn(Optional.of(traxStudentNoEntity));
when(traxStudentNoRepository.save(traxStudentNoEntity)).thenReturn(traxStudentNoEntity);

var result = traxCommonService.updateTraxStudentNo(traxStudentNo.getStudNo());
assertThat(result).isNotNull();
assertThat(traxStudentNo.getStudNo()).isEqualTo(result.getStudNo());
assertThat(traxStudentNo.getStatus()).isEqualTo(result.getStatus());
}

// @Test
// public void testStudentIsNotGraduated() {
// // Student is graduated or not
Expand Down

0 comments on commit bedd3bf

Please sign in to comment.