Skip to content

Commit

Permalink
Lint & coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fdaugan committed Feb 27, 2024
1 parent 6fffd29 commit 27ae8cc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import jakarta.transaction.Transactional;
import jakarta.ws.rs.core.UriInfo;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -139,6 +140,7 @@ void findAll() {
Mockito.when(companyRepository.findByIdExpected(DEFAULT_USER, "ing")).thenReturn(company);
groupFindById(DEFAULT_USER, "dig", groupOrg1);
Mockito.when(groupRepository.findAll()).thenReturn(groupsMap);
Mockito.when(userRepository.getCustomAttributes()).thenReturn(ArrayUtils.EMPTY_STRING_ARRAY);
Mockito.when(userRepository.findAll(ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.any())).thenReturn(new PageImpl<>(new ArrayList<>(users.values())));
Mockito.when(resource.groupResource.getContainers()).thenReturn(new HashSet<>(groupsMap.values()));
Expand Down Expand Up @@ -181,6 +183,7 @@ void findAllFilteredNonVisibleGroup() {
Mockito.when(groupRepository.findAll()).thenReturn(groupsMap);
Mockito.when(userRepository.findAll(ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.any())).thenReturn(new PageImpl<>(new ArrayList<>(users.values())));
Mockito.when(userRepository.getCustomAttributes()).thenReturn(ArrayUtils.EMPTY_STRING_ARRAY);
Mockito.when(resource.groupResource.getContainers()).thenReturn(new HashSet<>(groupsMap.values()));
Mockito.when(resource.groupResource.getContainersForWrite()).thenReturn(new HashSet<>(groupsMap.values()));
Mockito.when(resource.companyResource.getContainers()).thenReturn(Collections.singleton(company));
Expand Down Expand Up @@ -226,6 +229,7 @@ void findAllReadOnly() {
Mockito.when(companyRepository.findByIdExpected(DEFAULT_USER, "ligoj")).thenReturn(company2);
groupFindById(DEFAULT_USER, "dig", groupOrg1);
Mockito.when(groupRepository.findAll()).thenReturn(groupsMap);
Mockito.when(userRepository.getCustomAttributes()).thenReturn(ArrayUtils.EMPTY_STRING_ARRAY);
Mockito.when(userRepository.findAll(ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.any())).thenReturn(new PageImpl<>(new ArrayList<>(users.values())));
Mockito.when(resource.groupResource.getContainers()).thenReturn(new HashSet<>(groupsMap.values()));
Expand Down Expand Up @@ -260,6 +264,7 @@ void findAllNotVisibleCompany() {
final var company = new CompanyOrg("ou=ing,ou=france,ou=people,dc=sample,dc=com", "ing");
Mockito.when(companyRepository.findByIdExpected(DEFAULT_USER, "ing")).thenReturn(company);
groupFindById(DEFAULT_USER, "dig", groupOrg1);
Mockito.when(userRepository.getCustomAttributes()).thenReturn(ArrayUtils.EMPTY_STRING_ARRAY);
Mockito.when(userRepository.findAll(ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any(),
ArgumentMatchers.any())).thenReturn(new PageImpl<>(new ArrayList<>(users.values())));
Mockito.when(resource.groupResource.getContainers()).thenReturn(new HashSet<>(groupsMap.values()));
Expand Down

0 comments on commit 27ae8cc

Please sign in to comment.