Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Oct 13, 2024
1 parent 15373a5 commit 09eef77
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import access.AbstractTest;
import access.eduid.EduIDProvision;
import access.model.Authority;
import access.model.RemoteProvisionedUser;
import access.model.User;
import access.model.UserRole;
import access.model.*;
import access.provision.scim.OperationType;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.tomakehurst.wiremock.verification.LoggedRequest;
Expand All @@ -14,10 +11,12 @@

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;

import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

class ProvisioningServiceDefaultTest extends AbstractTest {

Expand Down Expand Up @@ -108,4 +107,19 @@ void updateGroupRequest() {
//We only provision GUEST users
provisioningService.updateGroupRequest(new UserRole(Authority.INVITER, null), OperationType.Add);
}

@Test
void deleteGroupRequest() throws JsonProcessingException {
Role role = roleRepository.findByName("Calendar").get(0);

RemoteProvisionedGroup remoteProvisionedGroup = new RemoteProvisionedGroup(role, UUID.randomUUID().toString(),"7");
remoteProvisionedGroupRepository.save(remoteProvisionedGroup);

this.stubForManageProvisioning(List.of("1"));
this.stubForDeleteScimRole();

provisioningService.deleteGroupRequest(role);
Optional<RemoteProvisionedGroup> remoteProvisionedGroupOptional = remoteProvisionedGroupRepository.findByManageProvisioningIdAndRole("7", role);
assertTrue(remoteProvisionedGroupOptional.isEmpty());
}
}

0 comments on commit 09eef77

Please sign in to comment.