|
|
|
|
@@ -1,17 +1,24 @@
|
|
|
|
|
package sonia.scm.api.v2.resources;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.github.sdorra.shiro.ShiroRule;
|
|
|
|
|
import com.github.sdorra.shiro.SubjectAware;
|
|
|
|
|
import com.google.common.collect.ImmutableList;
|
|
|
|
|
import de.otto.edison.hal.HalRepresentation;
|
|
|
|
|
import lombok.ToString;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.shiro.authz.AuthorizationException;
|
|
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
|
|
import org.apache.shiro.subject.support.SubjectThreadState;
|
|
|
|
|
import org.apache.shiro.util.ThreadContext;
|
|
|
|
|
import org.apache.shiro.util.ThreadState;
|
|
|
|
|
import org.assertj.core.util.Lists;
|
|
|
|
|
import org.jboss.resteasy.core.Dispatcher;
|
|
|
|
|
import org.jboss.resteasy.mock.MockHttpRequest;
|
|
|
|
|
import org.jboss.resteasy.mock.MockHttpResponse;
|
|
|
|
|
import org.jboss.resteasy.spi.HttpRequest;
|
|
|
|
|
import org.junit.Before;
|
|
|
|
|
import org.junit.Rule;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
|
import org.junit.jupiter.api.DisplayName;
|
|
|
|
|
@@ -32,6 +39,7 @@ import java.net.URISyntaxException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
import static de.otto.edison.hal.Link.link;
|
|
|
|
|
@@ -41,15 +49,25 @@ import static org.junit.Assert.fail;
|
|
|
|
|
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
|
|
|
|
|
import static org.mockito.Matchers.any;
|
|
|
|
|
import static org.mockito.Mockito.doThrow;
|
|
|
|
|
import static org.mockito.Mockito.eq;
|
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
import static org.mockito.Mockito.when;
|
|
|
|
|
import static org.mockito.MockitoAnnotations.initMocks;
|
|
|
|
|
import static sonia.scm.api.v2.resources.DispatcherMock.createDispatcher;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@SubjectAware(
|
|
|
|
|
username = "trillian",
|
|
|
|
|
password = "secret",
|
|
|
|
|
configuration = "classpath:sonia/scm/repository/shiro.ini"
|
|
|
|
|
)
|
|
|
|
|
public class PermissionRootResourceTest {
|
|
|
|
|
private static final String REPOSITORY_NAMESPACE = "repo_namespace";
|
|
|
|
|
private static final String REPOSITORY_NAME = "repo";
|
|
|
|
|
private static final String PERMISSION_WRITE = "repository:permissionWrite:" + REPOSITORY_NAME;
|
|
|
|
|
private static final String PERMISSION_READ = "repository:permissionRead:" + REPOSITORY_NAME;
|
|
|
|
|
private static final String PERMISSION_OWNER = "repository:modify:" + REPOSITORY_NAME;
|
|
|
|
|
|
|
|
|
|
private static final String PERMISSION_NAME = "perm";
|
|
|
|
|
private static final String PATH_OF_ALL_PERMISSIONS = REPOSITORY_NAMESPACE + "/" + REPOSITORY_NAME + "/permissions/";
|
|
|
|
|
private static final String PATH_OF_ONE_PERMISSION = PATH_OF_ALL_PERMISSIONS + PERMISSION_NAME;
|
|
|
|
|
@@ -88,6 +106,9 @@ public class PermissionRootResourceTest {
|
|
|
|
|
|
|
|
|
|
private Dispatcher dispatcher;
|
|
|
|
|
|
|
|
|
|
@Rule
|
|
|
|
|
public ShiroRule shiro = new ShiroRule();
|
|
|
|
|
|
|
|
|
|
@Mock
|
|
|
|
|
private RepositoryManager repositoryManager;
|
|
|
|
|
|
|
|
|
|
@@ -100,20 +121,28 @@ public class PermissionRootResourceTest {
|
|
|
|
|
@InjectMocks
|
|
|
|
|
private PermissionDtoToPermissionMapperImpl permissionDtoToPermissionMapper;
|
|
|
|
|
|
|
|
|
|
private PermissionCollectionToDtoMapper permissionCollectionToDtoMapper;
|
|
|
|
|
|
|
|
|
|
private PermissionRootResource permissionRootResource;
|
|
|
|
|
|
|
|
|
|
private final Subject subject = mock(Subject.class);
|
|
|
|
|
private final ThreadState subjectThreadState = new SubjectThreadState(subject);
|
|
|
|
|
|
|
|
|
|
@BeforeEach
|
|
|
|
|
@Before
|
|
|
|
|
public void prepareEnvironment() {
|
|
|
|
|
initMocks(this);
|
|
|
|
|
permissionRootResource = new PermissionRootResource(permissionDtoToPermissionMapper, permissionToPermissionDtoMapper, resourceLinks, repositoryManager);
|
|
|
|
|
permissionCollectionToDtoMapper = new PermissionCollectionToDtoMapper(permissionToPermissionDtoMapper, resourceLinks);
|
|
|
|
|
permissionRootResource = new PermissionRootResource(permissionDtoToPermissionMapper, permissionToPermissionDtoMapper, permissionCollectionToDtoMapper, resourceLinks, repositoryManager);
|
|
|
|
|
RepositoryRootResource repositoryRootResource = new RepositoryRootResource(MockProvider
|
|
|
|
|
.of(new RepositoryResource(null, null, null, null, null, null, null,null, MockProvider.of(permissionRootResource))), null);
|
|
|
|
|
.of(new RepositoryResource(null, null, null, null, null, null, null, null, MockProvider.of(permissionRootResource))), null);
|
|
|
|
|
dispatcher = createDispatcher(repositoryRootResource);
|
|
|
|
|
subjectThreadState.bind();
|
|
|
|
|
ThreadContext.bind(subject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@TestFactory
|
|
|
|
|
@DisplayName("test endpoints on missing repository and user is Admin")
|
|
|
|
|
@DisplayName("test endpoints on missing repository")
|
|
|
|
|
Stream<DynamicTest> missedRepositoryTestFactory() {
|
|
|
|
|
return createDynamicTestsToAssertResponses(
|
|
|
|
|
requestGETAllPermissions.expectedResponseStatus(404),
|
|
|
|
|
@@ -124,9 +153,13 @@ public class PermissionRootResourceTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@TestFactory
|
|
|
|
|
@DisplayName("test endpoints on missing permission and user is Admin")
|
|
|
|
|
@DisplayName("test endpoints on missing permissions and user is Admin")
|
|
|
|
|
Stream<DynamicTest> missedPermissionTestFactory() {
|
|
|
|
|
authorizedUserHasARepository();
|
|
|
|
|
Repository mockRepository = mock(Repository.class);
|
|
|
|
|
when(mockRepository.getId()).thenReturn(REPOSITORY_NAME);
|
|
|
|
|
when(mockRepository.getNamespace()).thenReturn(REPOSITORY_NAMESPACE);
|
|
|
|
|
when(mockRepository.getName()).thenReturn(REPOSITORY_NAME);
|
|
|
|
|
when(repositoryManager.get(any(NamespaceAndName.class))).thenReturn(mockRepository);
|
|
|
|
|
return createDynamicTestsToAssertResponses(
|
|
|
|
|
requestGETPermission.expectedResponseStatus(404),
|
|
|
|
|
requestPOSTPermission.expectedResponseStatus(201),
|
|
|
|
|
@@ -136,10 +169,12 @@ public class PermissionRootResourceTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@TestFactory
|
|
|
|
|
@DisplayName("test endpoints on missing permission and user is not Admin")
|
|
|
|
|
@DisplayName("test endpoints on missing permissions and user is not Admin")
|
|
|
|
|
Stream<DynamicTest> missedPermissionUserForbiddenTestFactory() {
|
|
|
|
|
Repository mockRepository = mock(Repository.class);
|
|
|
|
|
when(mockRepository.getId()).thenReturn(REPOSITORY_NAME);
|
|
|
|
|
when(mockRepository.getNamespace()).thenReturn(REPOSITORY_NAMESPACE);
|
|
|
|
|
when(mockRepository.getName()).thenReturn(REPOSITORY_NAME);
|
|
|
|
|
doThrow(AuthorizationException.class).when(repositoryManager).get(any(NamespaceAndName.class));
|
|
|
|
|
return createDynamicTestsToAssertResponses(
|
|
|
|
|
requestGETPermission.expectedResponseStatus(403),
|
|
|
|
|
@@ -149,15 +184,27 @@ public class PermissionRootResourceTest {
|
|
|
|
|
requestPUTPermission.expectedResponseStatus(403));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void userWithPermissionWritePermissionShouldGetAllPermissionsWithCreateAndUpdateLinks() throws URISyntaxException {
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_WRITE);
|
|
|
|
|
assertGettingExpectedPermissions(ImmutableList.copyOf(TEST_PERMISSIONS), PERMISSION_WRITE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void userWithPermissionReadPermissionShouldGetAllPermissionsWithoutCreateAndUpdateLinks() throws URISyntaxException {
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_READ);
|
|
|
|
|
assertGettingExpectedPermissions(ImmutableList.copyOf(TEST_PERMISSIONS), PERMISSION_READ);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGetAllPermissions() throws URISyntaxException {
|
|
|
|
|
authorizedUserHasARepositoryWithPermissions(TEST_PERMISSIONS);
|
|
|
|
|
assertGettingExpectedPermissions(ImmutableList.copyOf(TEST_PERMISSIONS));
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_READ);
|
|
|
|
|
assertGettingExpectedPermissions(ImmutableList.copyOf(TEST_PERMISSIONS), PERMISSION_READ);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGetPermissionByName() throws URISyntaxException {
|
|
|
|
|
authorizedUserHasARepositoryWithPermissions(TEST_PERMISSIONS);
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_READ);
|
|
|
|
|
Permission expectedPermission = TEST_PERMISSIONS.get(0);
|
|
|
|
|
assertExpectedRequest(requestGETPermission
|
|
|
|
|
.expectedResponseStatus(200)
|
|
|
|
|
@@ -169,7 +216,7 @@ public class PermissionRootResourceTest {
|
|
|
|
|
PermissionDto actualPermissionDto = mapper.readValue(body, PermissionDto.class);
|
|
|
|
|
assertThat(actualPermissionDto)
|
|
|
|
|
.as("response payload match permission object model")
|
|
|
|
|
.isEqualToComparingFieldByFieldRecursively(getExpectedPermissionDto(expectedPermission))
|
|
|
|
|
.isEqualToComparingFieldByFieldRecursively(getExpectedPermissionDto(expectedPermission, PERMISSION_READ))
|
|
|
|
|
;
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
fail();
|
|
|
|
|
@@ -180,7 +227,7 @@ public class PermissionRootResourceTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGetCreatedPermissions() throws URISyntaxException {
|
|
|
|
|
authorizedUserHasARepositoryWithPermissions(TEST_PERMISSIONS);
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_WRITE);
|
|
|
|
|
Permission newPermission = new Permission("new_group_perm", PermissionType.WRITE, true);
|
|
|
|
|
ArrayList<Permission> permissions = Lists.newArrayList(TEST_PERMISSIONS);
|
|
|
|
|
permissions.add(newPermission);
|
|
|
|
|
@@ -192,12 +239,12 @@ public class PermissionRootResourceTest {
|
|
|
|
|
.as("POST response has no body")
|
|
|
|
|
.isBlank())
|
|
|
|
|
);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions, PERMISSION_WRITE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldNotAddExistingPermission() throws URISyntaxException {
|
|
|
|
|
authorizedUserHasARepositoryWithPermissions(TEST_PERMISSIONS);
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_WRITE);
|
|
|
|
|
Permission newPermission = TEST_PERMISSIONS.get(0);
|
|
|
|
|
assertExpectedRequest(requestPOSTPermission
|
|
|
|
|
.content("{\"name\" : \"" + newPermission.getName() + "\" , \"type\" : \"WRITE\" , \"groupPermission\" : true}")
|
|
|
|
|
@@ -207,7 +254,7 @@ public class PermissionRootResourceTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGetUpdatedPermissions() throws URISyntaxException {
|
|
|
|
|
authorizedUserHasARepositoryWithPermissions(TEST_PERMISSIONS);
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_WRITE);
|
|
|
|
|
Permission modifiedPermission = TEST_PERMISSIONS.get(0);
|
|
|
|
|
// modify the type to owner
|
|
|
|
|
modifiedPermission.setType(PermissionType.OWNER);
|
|
|
|
|
@@ -220,13 +267,13 @@ public class PermissionRootResourceTest {
|
|
|
|
|
.as("PUT response has no body")
|
|
|
|
|
.isBlank())
|
|
|
|
|
);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions, PERMISSION_WRITE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldDeletePermissions() throws URISyntaxException {
|
|
|
|
|
authorizedUserHasARepositoryWithPermissions(TEST_PERMISSIONS);
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_OWNER);
|
|
|
|
|
Permission deletedPermission = TEST_PERMISSIONS.get(0);
|
|
|
|
|
ImmutableList<Permission> expectedPermissions = ImmutableList.copyOf(TEST_PERMISSIONS.subList(1, TEST_PERMISSIONS.size()));
|
|
|
|
|
assertExpectedRequest(requestDELETEPermission
|
|
|
|
|
@@ -236,12 +283,12 @@ public class PermissionRootResourceTest {
|
|
|
|
|
.as("DELETE response has no body")
|
|
|
|
|
.isBlank())
|
|
|
|
|
);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions, PERMISSION_READ);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void deletingNotExistingPermissionShouldProcess() throws URISyntaxException {
|
|
|
|
|
authorizedUserHasARepositoryWithPermissions(TEST_PERMISSIONS);
|
|
|
|
|
createUserWithRepositoryAndPermissions(TEST_PERMISSIONS, PERMISSION_OWNER);
|
|
|
|
|
Permission deletedPermission = TEST_PERMISSIONS.get(0);
|
|
|
|
|
ImmutableList<Permission> expectedPermissions = ImmutableList.copyOf(TEST_PERMISSIONS.subList(1, TEST_PERMISSIONS.size()));
|
|
|
|
|
assertExpectedRequest(requestDELETEPermission
|
|
|
|
|
@@ -251,7 +298,7 @@ public class PermissionRootResourceTest {
|
|
|
|
|
.as("DELETE response has no body")
|
|
|
|
|
.isBlank())
|
|
|
|
|
);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions, PERMISSION_READ);
|
|
|
|
|
assertExpectedRequest(requestDELETEPermission
|
|
|
|
|
.path(PATH_OF_ALL_PERMISSIONS + deletedPermission.getName())
|
|
|
|
|
.expectedResponseStatus(204)
|
|
|
|
|
@@ -259,23 +306,32 @@ public class PermissionRootResourceTest {
|
|
|
|
|
.as("DELETE response has no body")
|
|
|
|
|
.isBlank())
|
|
|
|
|
);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions);
|
|
|
|
|
assertGettingExpectedPermissions(expectedPermissions, PERMISSION_READ);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void assertGettingExpectedPermissions(ImmutableList<Permission> expectedPermissions) throws URISyntaxException {
|
|
|
|
|
private void assertGettingExpectedPermissions(ImmutableList<Permission> expectedPermissions, String userPermission) throws URISyntaxException {
|
|
|
|
|
assertExpectedRequest(requestGETAllPermissions
|
|
|
|
|
.expectedResponseStatus(200)
|
|
|
|
|
.responseValidator((response) -> {
|
|
|
|
|
String body = response.getContentAsString();
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
try {
|
|
|
|
|
List<PermissionDto> actualPermissionDtos = mapper.readValue(body, new TypeReference<List<PermissionDto>>() {
|
|
|
|
|
});
|
|
|
|
|
assertThat(actualPermissionDtos)
|
|
|
|
|
HalRepresentation halRepresentation = mapper.readValue(body, HalRepresentation.class);
|
|
|
|
|
List<HalRepresentation> actualPermissionDtos = halRepresentation.getEmbedded().getItemsBy("permissions", HalRepresentation.class);
|
|
|
|
|
List<PermissionDto> permissionDtoStream = actualPermissionDtos.stream()
|
|
|
|
|
.map(hal -> {
|
|
|
|
|
PermissionDto result = new PermissionDto();
|
|
|
|
|
result.setName(hal.getAttribute("name").asText());
|
|
|
|
|
result.setType(hal.getAttribute("type").asText());
|
|
|
|
|
result.setGroupPermission(hal.getAttribute("groupPermission").asBoolean());
|
|
|
|
|
result.add(hal.getLinks());
|
|
|
|
|
return result;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
assertThat(permissionDtoStream)
|
|
|
|
|
.as("response payload match permission object models")
|
|
|
|
|
.hasSize(expectedPermissions.size())
|
|
|
|
|
.usingRecursiveFieldByFieldElementComparator()
|
|
|
|
|
.containsExactlyInAnyOrder(getExpectedPermissionDtos(Lists.newArrayList(expectedPermissions)))
|
|
|
|
|
.containsExactlyInAnyOrder(getExpectedPermissionDtos(Lists.newArrayList(expectedPermissions), userPermission))
|
|
|
|
|
;
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
fail();
|
|
|
|
|
@@ -284,38 +340,45 @@ public class PermissionRootResourceTest {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private PermissionDto[] getExpectedPermissionDtos(ArrayList<Permission> permissions) {
|
|
|
|
|
private PermissionDto[] getExpectedPermissionDtos(ArrayList<Permission> permissions, String userPermission) {
|
|
|
|
|
return permissions
|
|
|
|
|
.stream()
|
|
|
|
|
.map(this::getExpectedPermissionDto)
|
|
|
|
|
.map(p -> getExpectedPermissionDto(p, userPermission))
|
|
|
|
|
.toArray(PermissionDto[]::new);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private PermissionDto getExpectedPermissionDto(Permission permission) {
|
|
|
|
|
private PermissionDto getExpectedPermissionDto(Permission permission, String userPermission) {
|
|
|
|
|
PermissionDto result = new PermissionDto();
|
|
|
|
|
result.setName(permission.getName());
|
|
|
|
|
result.setGroupPermission(permission.isGroupPermission());
|
|
|
|
|
result.setType(permission.getType().name());
|
|
|
|
|
String permissionHref = "/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + PATH_OF_ALL_PERMISSIONS + permission.getName();
|
|
|
|
|
result.add(linkingTo()
|
|
|
|
|
.self(permissionHref)
|
|
|
|
|
.single(link("update", permissionHref))
|
|
|
|
|
.single(link("delete", permissionHref))
|
|
|
|
|
.build());
|
|
|
|
|
if (PERMISSION_READ.equals(userPermission)) {
|
|
|
|
|
result.add(linkingTo()
|
|
|
|
|
.self(permissionHref)
|
|
|
|
|
.build());
|
|
|
|
|
} else {
|
|
|
|
|
result.add(linkingTo()
|
|
|
|
|
.self(permissionHref)
|
|
|
|
|
.single(link("update", permissionHref))
|
|
|
|
|
.single(link("delete", permissionHref))
|
|
|
|
|
.build());
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Repository authorizedUserHasARepository() {
|
|
|
|
|
private Repository createUserWithRepository(String userPermission) {
|
|
|
|
|
Repository mockRepository = mock(Repository.class);
|
|
|
|
|
when(mockRepository.getId()).thenReturn(REPOSITORY_NAME);
|
|
|
|
|
when(mockRepository.getNamespace()).thenReturn(REPOSITORY_NAMESPACE);
|
|
|
|
|
when(mockRepository.getName()).thenReturn(REPOSITORY_NAME);
|
|
|
|
|
when(repositoryManager.get(any(NamespaceAndName.class))).thenReturn(mockRepository);
|
|
|
|
|
when(subject.isPermitted(userPermission != null ? eq(userPermission) : any(String.class))).thenReturn(true);
|
|
|
|
|
return mockRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void authorizedUserHasARepositoryWithPermissions(ArrayList<Permission> permissions) {
|
|
|
|
|
when(authorizedUserHasARepository().getPermissions()).thenReturn(permissions);
|
|
|
|
|
private void createUserWithRepositoryAndPermissions(ArrayList<Permission> permissions, String userPermission) {
|
|
|
|
|
when(createUserWithRepository(userPermission).getPermissions()).thenReturn(permissions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Stream<DynamicTest> createDynamicTestsToAssertResponses(ExpectedRequest... expectedRequests) {
|
|
|
|
|
|