-
Notifications
You must be signed in to change notification settings - Fork 15
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
AYS-660 | Change Error Code and Message for Already Passive Users #436
base: main
Are you sure you want to change the base?
AYS-660 | Change Error Code and Message for Already Passive Users #436
Conversation
…Has Been Changed
…-user-not-active-error-code
src/main/java/org/ays/auth/exception/AysUserAlreadyPassiveException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ays/auth/exception/AysUserNotActiveAuthException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ays/auth/exception/AysUserNotActiveAuthException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ays/auth/exception/AysUserNotActiveException.java
Outdated
Show resolved
Hide resolved
Assertions.assertEquals(AysUserStatus.PASSIVE, userFromDatabase.get().getStatus()); | ||
Assertions.assertNull(userFromDatabase.get().getUpdatedUser()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diğer senaryo için de end-to-end test ekleyebilir miyiz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ayrıca bu senaryoda da en sondaki assertnull satırının doğru çalıştığından emin miyiz? findbyid metodu updated alanı null ise created ile aynı alanı dönüyor gözlemlediğim kadarıyla, bu sebeple bende şu an assertnull hata veriyor. @agitrubard @egehanasal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egehanasal buraya updatedAt
alanını da ekleyebiliriz ✅
src/test/java/org/ays/auth/service/impl/AysUserUpdateServiceImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/ays/auth/service/impl/AysUserUpdateServiceImplTest.java
Outdated
Show resolved
Hide resolved
Assertions.assertEquals(AysUserStatus.PASSIVE, userFromDatabase.get().getStatus()); | ||
Assertions.assertNull(userFromDatabase.get().getUpdatedUser()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egehanasal buraya updatedAt
alanını da ekleyebiliriz ✅
@ValueSource(strings = { | ||
"NOT_VERIFIED", | ||
"DELETED" | ||
}) | ||
void givenInactiveUserId_whenTryToPassivate_thenReturnUserNotActiveError(String inactiveStatus) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ValueSource(strings = { | |
"NOT_VERIFIED", | |
"DELETED" | |
}) | |
void givenInactiveUserId_whenTryToPassivate_thenReturnUserNotActiveError(String inactiveStatus) throws Exception { | |
@EnumSource(value = AysUserStatus.class, names = { | |
"NOT_VERIFIED", | |
"DELETED" | |
}) | |
void givenInactiveUserId_whenTryToPassivate_thenReturnUserNotActiveError(AysUserStatus status) throws Exception { |
@ValueSource(strings = { | ||
"NOT_VERIFIED", | ||
"DELETED" | ||
}) | ||
void givenValidId_whenUserIsNotActive_thenThrowUserNotActiveException(String inactiveStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EnumSource(value = AysUserStatus.class, names = {
"NOT_VERIFIED",
"DELETED"
})
void givenValidId_whenUserIsNotActive_thenThrowUserNotActiveException(AysUserStatus mockStatus) {
Assertions.assertTrue(userFromDatabase.isPresent()); | ||
Assertions.assertEquals(userFromDatabase.get().getId(), user.getId()); | ||
Assertions.assertEquals(AysUserStatus.valueOf(inactiveStatus), userFromDatabase.get().getStatus()); | ||
Assertions.assertNull(userFromDatabase.get().getUpdatedUser()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Buraya updatedAt
alanını da ekleyebiliriz
Checklist
Before submitting your pull request, ensure the following:
Title and Branch Naming Conventions:
standard: Pull Request Naming Conventions.
the Branch Naming Conventions.
Local Testing:
Code Quality:
Documentation:
Testing:
Reviewers and Assignees:
Labels and Associations: