-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: BaseEntity의 equals&hashCode 제거 (#325)
- Loading branch information
Showing
3 changed files
with
1 addition
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,13 @@ | |
|
||
import com.listywave.image.application.domain.DefaultBackgroundImages; | ||
import com.listywave.image.application.domain.DefaultProfileImages; | ||
import java.lang.reflect.Field; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.IntStream; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Nested; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.util.ReflectionUtils; | ||
|
||
@DisplayName("회원은 ") | ||
class UserTest { | ||
|
@@ -324,19 +322,4 @@ class 팔로우_팔로워_수 { | |
void 카카오_액세스_토큰이_존재하는지_검증한다() { | ||
assertThatNoException().isThrownBy(() -> user.validateHasKakaoAccessToken()); | ||
} | ||
|
||
@Test | ||
void ID가_같으면_동등한_객체다() { | ||
// given | ||
User other = User.init(312414L, "[email protected]", "sflkhadsfsad.asdjhfahsjdf.asdkjhfasdhjf"); | ||
|
||
Field idField = ReflectionUtils.findField(User.class, "id"); | ||
idField.setAccessible(true); | ||
ReflectionUtils.setField(idField, user, 11L); | ||
ReflectionUtils.setField(idField, other, 11L); | ||
|
||
// expect | ||
assertThat(user).isEqualTo(other); | ||
assertThat(user).hasSameHashCodeAs(other); | ||
} | ||
} |