Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] dev와 dev-be를 합친다. #682

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ List<Checklist> findByUserAndIdIn(@Param("user") User user,
@Query("SELECT COUNT(c) > 0 FROM Checklist c "
+ "WHERE c.id = :id "
+ "AND c.deleted = false")
boolean existsById(@Param("id") long id);
boolean existsById(@Param("id") Long id);

@Transactional
@Modifying(flushAutomatically = true, clearAutomatically = true)
@Query("UPDATE Checklist c "
+ "SET c.deleted = true "
+ "WHERE c.id = :id")
void deleteById(@Param("id") long id);
void deleteById(@Param("id") Long id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void existsById_true() {
@Test
void existsById_false() {
//given & when & then
assertThat(checklistRepository.existsById(1)).isFalse();
assertThat(checklistRepository.existsById(1L)).isFalse();
}

@DisplayName("체크리스트 삭제 성공")
Expand All @@ -189,12 +189,9 @@ void deleteById() {
Checklist savedChecklist = checklistRepository.save(ChecklistFixture.CHECKLIST1_USER1(room, user));

//when
checklistRepository.deleteById(savedChecklist.getId().longValue());
checklistRepository.deleteById(savedChecklist.getId());

//then
assertAll(
() -> assertThat(checklistRepository.existsById(savedChecklist.getId())).isTrue(),
() -> assertThat(checklistRepository.existsById(savedChecklist.getId().longValue())).isFalse()
);
assertThat(checklistRepository.existsById(savedChecklist.getId())).isFalse();
}
}
Loading