Skip to content

Commit

Permalink
AYS-569 | Fixed code review discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
sarpkan00 committed Dec 22, 2024
1 parent 0a54684 commit 524441c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/test/java/org/ays/auth/controller/AysAuthEndToEndTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,16 @@ void givenValidForgotPasswordRequest_whenUserHasNotPasswordAndPasswordCreatedWit

// Initialize
Institution institution = new InstitutionBuilder()
.withId(AysValidTestData.SuperAdmin.INSTITUTION_ID)
.withId(AysValidTestData.Admin.INSTITUTION_ID)
.build();

AysRole role = roleReadPort.findAllActivesByInstitutionId(institution.getId())
.stream()
.findFirst()
.orElseThrow();
List<AysRole> roles = roleReadPort.findAllActivesByInstitutionId(institution.getId());

AysUser user = userSavePort.save(
new AysUserBuilder()
.withValidValues()
.withoutId()
.withRoles(List.of(role))
.withRoles(roles)
.withInstitution(institution)
.build()
);
Expand Down Expand Up @@ -193,13 +190,10 @@ void givenValidForgotPasswordRequest_whenUserHasPasswordAndPasswordCreatedWithLa

// Initialize
Institution institution = new InstitutionBuilder()
.withId(AysValidTestData.SuperAdmin.INSTITUTION_ID)
.withId(AysValidTestData.Admin.INSTITUTION_ID)
.build();

AysRole role = roleReadPort.findAllActivesByInstitutionId(institution.getId())
.stream()
.findFirst()
.orElseThrow();
List<AysRole> roles = roleReadPort.findAllActivesByInstitutionId(institution.getId());

AysUser.Password password = new AysUserBuilder.PasswordBuilder()
.withValidValues()
Expand All @@ -210,7 +204,7 @@ void givenValidForgotPasswordRequest_whenUserHasPasswordAndPasswordCreatedWithLa
new AysUserBuilder()
.withValidValues()
.withoutId()
.withRoles(List.of(role))
.withRoles(roles)
.withInstitution(institution)
.withPassword(password)
.build()
Expand Down

0 comments on commit 524441c

Please sign in to comment.