Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-merlin committed Nov 23, 2024
1 parent 8f1e924 commit a25217d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/sitblueprint/admin/model/users/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ public class Role {

@ManyToMany(mappedBy = "roles")
private Set<Member> members;

public static Role of(String name) {
return Role.builder().name(name).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
import com.sitblueprint.admin.dtos.member.MemberDTO;
import com.sitblueprint.admin.dtos.member.RegistrationRequestDTO;
import com.sitblueprint.admin.model.users.Member;
import com.sitblueprint.admin.model.users.Role;
import com.sitblueprint.admin.model.users.Token;
import com.sitblueprint.admin.repository.users.MemberRepository;
import java.util.Collections;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.Set;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -41,7 +43,7 @@ public class MemberServiceTest {
void setUp() {
memberService = new MemberServiceImpl(memberRepository, tokenService);
testMember = Member.builder().id(1L).username("testUsername").name("Test Name").password("Test Password")
.isActive(true).build();
.isActive(true).roles(Set.of(Role.of("E-BOARD"))).build();

testMemberDTO = testMember.toDTO();
}
Expand Down

This file was deleted.

0 comments on commit a25217d

Please sign in to comment.