Skip to content
Snippets Groups Projects
Commit 39b86cf3 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7131 adjust collaboration tests

parent 766d6661
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
......@@ -54,6 +55,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.gridfs.GridFsTemplate;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.util.ReflectionTestUtils;
import com.google.protobuf.ByteString;
import com.thedeanda.lorem.LoremIpsum;
......@@ -64,6 +66,7 @@ import de.ozgcloud.apilib.user.OzgCloudUserProfile;
import de.ozgcloud.apilib.user.OzgCloudUserProfileService;
import de.ozgcloud.collaboration.CollaborationManagerConfiguration;
import de.ozgcloud.collaboration.CollaborationRequest;
import de.ozgcloud.collaboration.CollaborationService;
import de.ozgcloud.collaboration.CollaborationServiceGrpc.CollaborationServiceBlockingStub;
import de.ozgcloud.collaboration.GrpcGetFileContentRequest;
import de.ozgcloud.collaboration.request.CollaborationRequestId;
......@@ -107,7 +110,7 @@ import net.devh.boot.grpc.client.inject.GrpcClient;
})
@DataITCase
@WithMockCustomUser
@DirtiesContext
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
class CollaborationITCase {
private static final String FIELD_COLLABORATION_VORGANG_ID = "collaborationVorgangId";
......@@ -117,6 +120,8 @@ class CollaborationITCase {
@Autowired
private CommandService commandService;
@Autowired
private CollaborationService collaborationService;
@Autowired
private MongoOperations mongoOperations;
......@@ -286,6 +291,8 @@ class CollaborationITCase {
private static final int COLLABORATION_LEVEL = 4;
@Nested
class TestSuccessfully {
@Captor
private ArgumentCaptor<PostfachNachricht> postfachNachrichtCaptor;
......@@ -328,6 +335,18 @@ class CollaborationITCase {
}
}
@Test
void shouldFailOnMissingFachstelle() {
ReflectionTestUtils.setField(collaborationService, "urlProvider", Optional.empty());
var command = commandService.createCommand(buildCreateCollaborationVorgangCommand(vorgangId, COLLABORATION_LEVEL));
waitUntilCommandHasStatus(command.getId(), CommandStatus.ERROR);
command = mongoOperations.findById(command.getId(), Command.class);
assertThat(command.getErrorMessage()).contains("Fachstelle not configured.");
}
}
@DisplayName("Collaboration requests")
@Nested
class TestCollaborationRequests {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment