diff --git a/bescheid-manager/pom.xml b/bescheid-manager/pom.xml index 27254d431cb477d38e6e0d6661e352e1b803ecd3..3825db70b7d1602d14ca01c2c18dabf9a2aabc66 100644 --- a/bescheid-manager/pom.xml +++ b/bescheid-manager/pom.xml @@ -5,17 +5,18 @@ <parent> <groupId>de.ozgcloud.common</groupId> <artifactId>ozgcloud-common-parent</artifactId> - <version>4.7.0-SNAPSHOT</version> + <version>4.7.0</version> <relativePath /> </parent> <groupId>de.ozgcloud.bescheid</groupId> <artifactId>bescheid-manager</artifactId> <name>OZG-Cloud Bescheid Manager</name> - <version>1.22.0-SNAPSHOT</version> + <version>1.23.0-SNAPSHOT</version> + <inceptionYear>2020</inceptionYear> <properties> - <vorgang-manager.version>2.19.0-SNAPSHOT</vorgang-manager.version> + <vorgang-manager.version>2.20.0-SNAPSHOT</vorgang-manager.version> <nachrichten-manager.version>2.14.0</nachrichten-manager.version> <document-manager.version>1.2.0-SNAPSHOT</document-manager.version> <api-lib.version>0.14.0</api-lib.version> diff --git a/pom.xml b/pom.xml index 494b935a4f31039cfce14ab9cbacf431bcb5b818..444acee5cd819a3c077eff5505da2f8592dec6bc 100644 --- a/pom.xml +++ b/pom.xml @@ -29,14 +29,11 @@ <modelVersion>4.0.0</modelVersion> <groupId>de.ozgcloud.vorgang</groupId> <artifactId>vorgang-manager</artifactId> - <version>2.19.0-SNAPSHOT</version> + <version>2.20.0-SNAPSHOT</version> <name>OZG-Cloud Vorgang Manager</name> <packaging>pom</packaging> - - <properties> - <ozgcloud.license.version>1.6.0</ozgcloud.license.version> - </properties> + <inceptionYear>2020</inceptionYear> <modules> <module>vorgang-manager-interface</module> @@ -53,29 +50,6 @@ <plugin> <groupId>com.mycila</groupId> <artifactId>license-maven-plugin</artifactId> - <version>4.1</version> - <configuration> - <mapping> - <config>SCRIPT_STYLE</config> - </mapping> - <licenseSets> - <licenseSet> - <header>license/eupl_v1_2_de/header.txt</header> - <excludes> - <exclude>**/README</exclude> - <exclude>src/test/resources/**</exclude> - <exclude>src/main/resources/**</exclude> - </excludes> - </licenseSet> - </licenseSets> - </configuration> - <dependencies> - <dependency> - <groupId>de.ozgcloud.common</groupId> - <artifactId>ozgcloud-common-license</artifactId> - <version>${ozgcloud.license.version}</version> - </dependency> - </dependencies> </plugin> </plugins> </pluginManagement> diff --git a/src/main/helm/templates/_helpers.tpl b/src/main/helm/templates/_helpers.tpl index 435ffac96d724c9343abceb3c43d4b5c01ee5c5b..b751300901210a527e983c3866a633f31ac9adf1 100644 --- a/src/main/helm/templates/_helpers.tpl +++ b/src/main/helm/templates/_helpers.tpl @@ -125,7 +125,7 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- define "app.bayernidAbsenderName" -}} -{{- quote (required "ozgcloud.bayernid.absender.name must be set if ozgcloud.bayernid is enabled" (((.Values.ozgcloud).bayernid).absender).name) -}} +{{- quote (required "ozgcloud.bayernid.absender.name must be set if ozgcloud.bayernid is enabled" (((.Values.ozgcloud).bayernid).absender).name) -}} {{- end -}} {{- define "app.bayernidAbsenderMandant" -}} @@ -164,6 +164,12 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- end -}} {{- end -}} +{{- define "app.fachstelleHost" -}} +{{- if (.Values.fachstelle).enabled -}} +{{- required "fachstelle.host must be set" .Values.fachstelle.host | quote }} +{{- end -}} +{{- end -}} + {{- define "app.getZufiManagerAddress" -}} {{- required "zufiManager.address must be set" (.Values.zufiManager).address -}} {{- end -}} \ No newline at end of file diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index ff958feeac3f41ec32aed322ad8fa46f4788a9c8..113dce5b90c33074e90747c68bd347c11b073907 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -242,7 +242,18 @@ spec: - name: ozgcloud_notification_eingangsbestaetigung_replyAllowed value: {{ quote (((.Values.ozgcloud).notification).eingangsbestaetigung).replyAllowed }} {{- end }} - + {{- if ((.Values.ozgcloud).xdomea).behoerdenschluessel }} + - name: ozgcloud_xdomea_behoerdenschluessel + value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluessel | quote }} + {{- end }} + {{- if ((.Values.ozgcloud).xdomea).behoerdenschluesselUri }} + - name: ozgcloud_xdomea_behoerdenschluesselUri + value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluesselUri}} + {{- end }} + {{- if ((.Values.ozgcloud).xdomea).behoerdenschluesselVersion }} + - name: ozgcloud_xdomea_behoerdenschluesselVersion + value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluesselVersion | quote }} + {{- end }} {{- if (.Values.ozgcloud).processors}} {{- range $processor_index, $processor := (.Values.ozgcloud).processors }} - name: ozgcloud_processors_{{ $processor_index }}_address @@ -267,6 +278,8 @@ spec: - name: ozgcloud_alfa_host value: {{ include "app.alfaHost" . }} + - name: ozgcloud_fachstelle_host + value: {{ include "app.fachstelleHost" . }} - name: ozgcloud_vorgangManager_serviceAddress value: {{ include "app.ozgcloud_vorgangmanager_address" . }} diff --git a/src/test/helm/deployment_fachstelle_host_test.yaml b/src/test/helm/deployment_fachstelle_host_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1e7335c3b04425ec5b5582725bd7feb41b932a6f --- /dev/null +++ b/src/test/helm/deployment_fachstelle_host_test.yaml @@ -0,0 +1,61 @@ +# +# Copyright (C) 2024 Das Land Schleswig-Holstein vertreten durch den +# Ministerpräsidenten des Landes Schleswig-Holstein +# Staatskanzlei +# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung +# +# Lizenziert unter der EUPL, Version 1.2 oder - sobald +# diese von der Europäischen Kommission genehmigt wurden - +# Folgeversionen der EUPL ("Lizenz"); +# Sie dürfen dieses Werk ausschließlich gemäß +# dieser Lizenz nutzen. +# Eine Kopie der Lizenz finden Sie hier: +# +# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 +# +# Sofern nicht durch anwendbare Rechtsvorschriften +# gefordert oder in schriftlicher Form vereinbart, wird +# die unter der Lizenz verbreitete Software "so wie sie +# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN - +# ausdrücklich oder stillschweigend - verbreitet. +# Die sprachspezifischen Genehmigungen und Beschränkungen +# unter der Lizenz sind dem Lizenztext zu entnehmen. +# + +suite: test fachstelle host +release: + name: vorgang-manager + namespace: sh-helm-test +templates: + - templates/deployment.yaml +set: + baseUrl: test.sh.ozg-cloud.de + ozgcloud: + environment: dev + bezeichner: helm + imagePullSecret: test-image-pull-secret +tests: + - it: should set fachstelle host + set: + fachstelle: + enabled: true + host: https://hamburg.mein-kreis.de + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_fachstelle_host + value: https://hamburg.mein-kreis.de + - it: should fail if host url is not set + set: + fachstelle: + enabled: true + asserts: + - failedTemplate: + errorMessage: "fachstelle.host must be set" + - it: should not fail if fachstelle is not enabled and host is not set + asserts: + - notContains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_fachstelle_host diff --git a/src/test/helm/deployment_xdomea_test.yaml b/src/test/helm/deployment_xdomea_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..60688146e6b4eda3ce1e1c004558fe7936e92df6 --- /dev/null +++ b/src/test/helm/deployment_xdomea_test.yaml @@ -0,0 +1,79 @@ +# +# Copyright (C) 2024 Das Land Schleswig-Holstein vertreten durch den +# Ministerpräsidenten des Landes Schleswig-Holstein +# Staatskanzlei +# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung +# +# Lizenziert unter der EUPL, Version 1.2 oder - sobald +# diese von der Europäischen Kommission genehmigt wurden - +# Folgeversionen der EUPL ("Lizenz"); +# Sie dürfen dieses Werk ausschließlich gemäß +# dieser Lizenz nutzen. +# Eine Kopie der Lizenz finden Sie hier: +# +# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 +# +# Sofern nicht durch anwendbare Rechtsvorschriften +# gefordert oder in schriftlicher Form vereinbart, wird +# die unter der Lizenz verbreitete Software "so wie sie +# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN - +# ausdrücklich oder stillschweigend - verbreitet. +# Die sprachspezifischen Genehmigungen und Beschränkungen +# unter der Lizenz sind dem Lizenztext zu entnehmen. +# + +suite: test xdomea properties +release: + name: vorgang-manager + namespace: sh-helm-test +templates: + - templates/deployment.yaml +set: + baseUrl: test.sh.ozg-cloud.de + ozgcloud: + environment: dev + bezeichner: helm + imagePullSecret: test-image-pull-secret +tests: + - it: should not contain behoerdenschlüssel properties if values are missing + set: + # note: explicitly non-set behoerdenschlüssel properties + asserts: + - notContains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_xdomea_behoerdenschluessel + any: true + - notContains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_xdomea_behoerdenschluesselUri + any: true + - notContains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_xdomea_behoerdenschluesselVersion + any: true + - it: should set (optional) behoerdenschlüssel properties + set: + ozgcloud: + xdomea: + behoerdenschluessel: "123456" + behoerdenschluesselUri: "uri.uri:uri" + behoerdenschluesselVersion: "version 1" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_xdomea_behoerdenschluessel + value: "123456" + - contains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_xdomea_behoerdenschluesselUri + value: "uri.uri:uri" + - contains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_xdomea_behoerdenschluesselVersion + value: "version 1" \ No newline at end of file diff --git a/vorgang-manager-base/pom.xml b/vorgang-manager-base/pom.xml index 3c18be7812b331359d872643097d230dd660df49..88dd6639d9d180b80f4e808439ac6dae000c9a03 100644 --- a/vorgang-manager-base/pom.xml +++ b/vorgang-manager-base/pom.xml @@ -6,15 +6,16 @@ <parent> <groupId>de.ozgcloud.common</groupId> <artifactId>ozgcloud-common-parent</artifactId> - <version>4.7.0-SNAPSHOT</version> + <version>4.7.0</version> <relativePath /> </parent> <groupId>de.ozgcloud.vorgang</groupId> <artifactId>vorgang-manager-base</artifactId> - <version>2.19.0-SNAPSHOT</version> + <version>2.20.0-SNAPSHOT</version> <name>OZG-Cloud Vorgang Manager Base</name> + <inceptionYear>2020</inceptionYear> <dependencies> <dependency> diff --git a/vorgang-manager-command/pom.xml b/vorgang-manager-command/pom.xml index 86154b3e5a230ebb4c9fcd7320c76edf227257e8..ca4bed39aae1b0c0590517df9b6213bbe0ccf6d8 100644 --- a/vorgang-manager-command/pom.xml +++ b/vorgang-manager-command/pom.xml @@ -4,14 +4,15 @@ <parent> <groupId>de.ozgcloud.common</groupId> <artifactId>ozgcloud-common-dependencies</artifactId> - <version>4.7.0-SNAPSHOT</version> + <version>4.7.0</version> <relativePath/> </parent> <groupId>de.ozgcloud.command</groupId> <artifactId>command-manager</artifactId> - <version>2.19.0-SNAPSHOT</version> + <version>2.20.0-SNAPSHOT</version> <name>OZG-Cloud Command Manager</name> + <inceptionYear>2020</inceptionYear> <properties> <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version> diff --git a/vorgang-manager-interface/pom.xml b/vorgang-manager-interface/pom.xml index 31e4a2d78e6c5e7b298e7d313698d4e9b7dd82af..a069035591c25ebaf0469f3c8fbc694dd9a4f1d9 100644 --- a/vorgang-manager-interface/pom.xml +++ b/vorgang-manager-interface/pom.xml @@ -30,16 +30,17 @@ <parent> <groupId>de.ozgcloud.common</groupId> <artifactId>ozgcloud-common-dependencies</artifactId> - <version>4.7.0-SNAPSHOT</version> + <version>4.7.0</version> <relativePath/> </parent> <groupId>de.ozgcloud.vorgang</groupId> <artifactId>vorgang-manager-interface</artifactId> - <version>2.19.0-SNAPSHOT</version> + <version>2.20.0-SNAPSHOT</version> <name>OZG-Cloud Vorgang Manager gRPC Interface</name> <description>Interface (gRPC) for Vorgang Manager Server</description> + <inceptionYear>2020</inceptionYear> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> @@ -50,7 +51,6 @@ <maven.compiler.target>${java.version}</maven.compiler.target> <find-and-replace-maven-plugin.version>1.1.0</find-and-replace-maven-plugin.version> - <ozgcloud.license.version>1.6.0</ozgcloud.license.version> </properties> <dependencyManagement> @@ -139,34 +139,6 @@ </execution> </executions> </plugin> - <!-- TODO move to common --> - <plugin> - <groupId>com.mycila</groupId> - <artifactId>license-maven-plugin</artifactId> - <configuration> - <mapping> - <proto>SLASHSTAR_STYLE</proto> - <config>SCRIPT_STYLE</config> - </mapping> - <licenseSets> - <licenseSet> - <header>license/eupl_v1_2_de/header.txt</header> - <excludes> - <exclude>**/*.yaml</exclude> - <exclude>**/*.yml</exclude> - <exclude>README.md</exclude> - </excludes> - </licenseSet> - </licenseSets> - </configuration> - <dependencies> - <dependency> - <groupId>de.ozgcloud.common</groupId> - <artifactId>ozgcloud-common-license</artifactId> - <version>${ozgcloud.license.version}</version> - </dependency> - </dependencies> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/vorgang-manager-server/pom.xml b/vorgang-manager-server/pom.xml index 24ca13d2feeb70efeeebed18898175d7e1ed5e79..531812c916825757741b1a92567de0ed3a43e2d4 100644 --- a/vorgang-manager-server/pom.xml +++ b/vorgang-manager-server/pom.xml @@ -32,16 +32,17 @@ <parent> <groupId>de.ozgcloud.common</groupId> <artifactId>ozgcloud-common-parent</artifactId> - <version>4.7.0-SNAPSHOT</version> + <version>4.7.0</version> <relativePath /> </parent> <groupId>de.ozgcloud.vorgang</groupId> <artifactId>vorgang-manager-server</artifactId> - <version>2.19.0-SNAPSHOT</version> + <version>2.20.0-SNAPSHOT</version> <name>OZG-Cloud Vorgang Manager Server</name> <description>Server Implementierung des VorgangManagers</description> + <inceptionYear>2020</inceptionYear> <properties> <java.version>21</java.version> @@ -49,18 +50,17 @@ <spring-boot.build-image.imageName>docker.ozg-sh.de/vorgang-manager:build-latest</spring-boot.build-image.imageName> - <ozgcloud.license.version>1.3.0</ozgcloud.license.version> - <zufi-manager-interface.version>1.4.0</zufi-manager-interface.version> + <zufi-manager-interface.version>1.6.0</zufi-manager-interface.version> - <user-manager-interface.version>2.9.0</user-manager-interface.version> - <bescheid-manager.version>1.22.0-SNAPSHOT</bescheid-manager.version> + <user-manager-interface.version>2.12.0</user-manager-interface.version> + <bescheid-manager.version>1.23.0-SNAPSHOT</bescheid-manager.version> <processor-manager.version>0.5.0</processor-manager.version> <nachrichten-manager.version>2.14.1</nachrichten-manager.version> - <api-lib.version>0.15.0-SNAPSHOT</api-lib.version> - <notification-manager.version>2.12.0</notification-manager.version> - <collaboration-manager.version>0.6.0-SNAPSHOT</collaboration-manager.version> - <archive-manager.version>0.1.0-SNAPSHOT</archive-manager.version> - <document-manager.version>1.2.0-SNAPSHOT</document-manager.version> + <api-lib.version>0.16.0-SNAPSHOT</api-lib.version> + <notification-manager.version>2.13.0</notification-manager.version> + <collaboration-manager.version>0.6.0</collaboration-manager.version> + <archive-manager.version>0.1.0</archive-manager.version> + <document-manager.version>1.1.0</document-manager.version> <zip.version>2.11.5</zip.version> <jsoup.version>1.15.3</jsoup.version> @@ -440,35 +440,6 @@ <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> </plugin> - - <plugin> - <groupId>com.mycila</groupId> - <artifactId>license-maven-plugin</artifactId> - <configuration> - <mapping> - <config>SCRIPT_STYLE</config> - <ftlh>FTL</ftlh> - </mapping> - <licenseSets> - <licenseSet> - <header>license/eupl_v1_2_de/header.txt</header> - <excludes> - <exclude>**/README</exclude> - <exclude>src/test/resources/**</exclude> - <exclude>src/main/resources/*.yml</exclude> - <exclude>src/main/resources/*.txt</exclude> - </excludes> - </licenseSet> - </licenseSets> - </configuration> - <dependencies> - <dependency> - <groupId>de.ozgcloud.common</groupId> - <artifactId>ozgcloud-common-license</artifactId> - <version>${ozgcloud.license.version}</version> - </dependency> - </dependencies> - </plugin> </plugins> </build> diff --git a/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java b/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java index 94e6ce8ce1d9e0a075524c27ede2a03d8f10d095..707f5de1f11ae3780601f875d75dec69ed478c0c 100644 --- a/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java +++ b/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java @@ -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; @@ -53,15 +54,18 @@ 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; +import de.ozgcloud.apilib.client_attribute.grpc.OzgCloudClientAttributeMapper; import de.ozgcloud.apilib.user.OzgCloudUserId; 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; @@ -102,21 +106,23 @@ import net.devh.boot.grpc.client.inject.GrpcClient; "grpc.client.vorgang-manager.address=in-process:test", "grpc.client.ozgcloud-command-manager.address=in-process:test", "grpc.client.file-manager.address=in-process:test", - "grpc.client.vorgang-attached-item.address=in-process:test", "grpc.client.inProcess.address=in-process:test", "grpc.client.pluto.address=in-process:test" }) @DataITCase @WithMockCustomUser -@DirtiesContext +@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) class CollaborationITCase { private static final String FIELD_COLLABORATION_VORGANG_ID = "collaborationVorgangId"; private static final String TITEL = "Collaboration Vorgang"; private static final String BESCHREIBUNG = "Beschreibung der Anfrage"; + private static final String MUK_POSTFACH_ID = UUID.randomUUID().toString(); @Autowired private CommandService commandService; + @Autowired + private CollaborationService collaborationService; @Autowired private MongoOperations mongoOperations; @@ -131,12 +137,14 @@ class CollaborationITCase { @Mock private OzgCloudUserProfile ozgCloudUserProfile; + @MockBean + private OzgCloudClientAttributeMapper clientAttributeMapper; private String vorgangId; @BeforeEach void init() { - when(postfachRemoteService.getPostfachType()).thenReturn(ServiceKontoTestFactory.TYPE); + when(postfachRemoteService.getPostfachType()).thenReturn("MUK"); mongoOperations.dropCollection(Command.class); mongoOperations.dropCollection(Vorgang.class); mongoOperations.dropCollection(VorgangAttachedItem.class); @@ -215,7 +223,7 @@ class CollaborationITCase { "titel", TITEL, "beschreibung", BESCHREIBUNG, "collaborationLevel", collaborationLevel, - "zustaendigeStelle", ZustaendigeStelleTestFactory.ORGANISATIONSEINHEIT_ID)) + "zustaendigeStelle", MUK_POSTFACH_ID)) .build(); } @@ -227,7 +235,7 @@ class CollaborationITCase { } private void waitUntilCommandHasStatus(String commandId, CommandStatus status) { - await().atMost(600, TimeUnit.SECONDS).until( + await().atMost(70, TimeUnit.SECONDS).until( () -> mongoOperations.findById(commandId, Command.class), command -> command.getStatus() == status); } @@ -264,7 +272,7 @@ class CollaborationITCase { assertThat(collaborationVorgang.getHeader()).extracting(VorgangHead::getCollaborationLevel) .isEqualTo(CreateCollaborationVorgangRequestTestFactory.COLLABORATION_LEVEL); assertThat(collaborationVorgang.getHeader()).extracting(VorgangHead::getOrganisationsEinheitId) - .isEqualTo(ZustaendigeStelleTestFactory.ORGANISATIONSEINHEIT_ID); + .isEqualTo(MUK_POSTFACH_ID); assertThat(collaborationVorgang.getClientAttributes()).isEmpty(); } @@ -280,45 +288,59 @@ class CollaborationITCase { private static final int COLLABORATION_LEVEL = 4; - @Captor - private ArgumentCaptor<PostfachNachricht> postfachNachrichtCaptor; + @Nested + class TestSuccessfully { + @Captor + private ArgumentCaptor<PostfachNachricht> postfachNachrichtCaptor; + + @BeforeEach + void init() { + when(ozgCloudUserProfile.getId()).thenReturn(OzgCloudUserId.from(CommandTestFactory.CREATED_BY)); + when(collaborationOzgCloudUserProfileService.getById(any())).thenReturn(ozgCloudUserProfile); + } - @BeforeEach - void init() { - when(ozgCloudUserProfile.getId()).thenReturn(OzgCloudUserId.from(CommandTestFactory.CREATED_BY)); - when(collaborationOzgCloudUserProfileService.getById(any())).thenReturn(ozgCloudUserProfile); - } + @Test + void shouldCreateCollaborationRequest() { + var command = commandService.createCommand(buildCreateCollaborationVorgangCommand(vorgangId, COLLABORATION_LEVEL)); - @Test - void shouldCreateCollaborationRequest() { - var command = commandService.createCommand(buildCreateCollaborationVorgangCommand(vorgangId, COLLABORATION_LEVEL)); + waitUntilCommandHasStatus(command.getId(), CommandStatus.FINISHED); - waitUntilCommandHasStatus(command.getId(), CommandStatus.FINISHED); + var collaborationRequests = loadCollaborationRequest(vorgangId); + assertThat(collaborationRequests).hasSize(1).first().extracting(VorgangAttachedItem::getItem, MAP) + .containsEntry(FIELD_COLLABORATION_VORGANG_ID, vorgangId); + } - var collaborationRequests = loadCollaborationRequest(vorgangId); - assertThat(collaborationRequests).hasSize(1).first().extracting(VorgangAttachedItem::getItem, MAP) - .containsEntry(FIELD_COLLABORATION_VORGANG_ID, vorgangId); - } + @Test + void shouldSendPostfachNachricht() { + var command = commandService.createCommand(buildCreateCollaborationVorgangCommand(vorgangId, COLLABORATION_LEVEL)); - @Test - void shouldSendPostfachNachricht() { - var command = commandService.createCommand(buildCreateCollaborationVorgangCommand(vorgangId, COLLABORATION_LEVEL)); + waitUntilCommandHasStatus(command.getId(), CommandStatus.FINISHED); - waitUntilCommandHasStatus(command.getId(), CommandStatus.FINISHED); + verify(postfachRemoteService).sendMessage(postfachNachrichtCaptor.capture()); + assertThat(postfachNachrichtCaptor.getValue().getPostfachAddress()).extracting(PostfachAddress::getIdentifier) + .hasToString(MUK_POSTFACH_ID); + } + + @Test + void shouldDeleteCollaborationRequest() { + doThrow(TechnicalException.class).when(postfachRemoteService).sendMessage(any()); + var command = commandService.createCommand(buildCreateCollaborationVorgangCommand(vorgangId, COLLABORATION_LEVEL)); + + waitUntilCommandHasStatus(command.getId(), CommandStatus.ERROR); - verify(postfachRemoteService).sendMessage(postfachNachrichtCaptor.capture()); - assertThat(postfachNachrichtCaptor.getValue().getPostfachAddress()).extracting(PostfachAddress::getIdentifier) - .hasToString(PostfachAddressTestFactory.STRING_BASED_IDENTIFIER_POSTFACH_ID_VALUE); + await().atMost(70, TimeUnit.SECONDS).untilAsserted(() -> assertThat(loadCollaborationRequest(vorgangId)).isEmpty()); + } } @Test - void shouldDeleteCollaborationRequest() { - doThrow(TechnicalException.class).when(postfachRemoteService).sendMessage(any()); + void shouldFailOnMissingFachstelle() { + ReflectionTestUtils.setField(collaborationService, "urlProvider", Optional.empty()); var command = commandService.createCommand(buildCreateCollaborationVorgangCommand(vorgangId, COLLABORATION_LEVEL)); waitUntilCommandHasStatus(command.getId(), CommandStatus.ERROR); - assertThat(loadCollaborationRequest(vorgangId)).isEmpty(); + command = mongoOperations.findById(command.getId(), Command.class); + assertThat(command.getErrorMessage()).contains("Fachstelle not configured."); } } diff --git a/vorgang-manager-server/src/test/resources/application-itcase.yml b/vorgang-manager-server/src/test/resources/application-itcase.yml index 2ab5f3470287edaf719a5db27b0cba4480042d0b..13b6b74eaddf93313f798e602ee85be256562816 100644 --- a/vorgang-manager-server/src/test/resources/application-itcase.yml +++ b/vorgang-manager-server/src/test/resources/application-itcase.yml @@ -20,6 +20,10 @@ ozgcloud: notification: scheduling: enabled: false + fachstelle: + host: fachstelle.test.de + vorgang-manager: + serviceAddress: vorgang-manager.by-test-test mongock: enabled: false diff --git a/vorgang-manager-utils/pom.xml b/vorgang-manager-utils/pom.xml index 8c23fe43fa5a0183052fad5e62bfb07bc1be594a..2feab00758744865950f8f49fee71a8816e87f41 100644 --- a/vorgang-manager-utils/pom.xml +++ b/vorgang-manager-utils/pom.xml @@ -30,14 +30,15 @@ <parent> <groupId>de.ozgcloud.common</groupId> <artifactId>ozgcloud-common-dependencies</artifactId> - <version>4.7.0-SNAPSHOT</version> + <version>4.7.0</version> <relativePath/> </parent> <groupId>de.ozgcloud.vorgang</groupId> <artifactId>vorgang-manager-utils</artifactId> <name>OZG-Cloud Vorgang Manager Utils</name> - <version>2.19.0-SNAPSHOT</version> + <version>2.20.0-SNAPSHOT</version> + <inceptionYear>2020</inceptionYear> <properties> <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version> @@ -211,32 +212,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>com.mycila</groupId> - <artifactId>license-maven-plugin</artifactId> - <configuration> - <mapping> - <config>SCRIPT_STYLE</config> - </mapping> - <licenseSets> - <licenseSet> - <header>license/eupl_v1_2_de/header.txt</header> - <excludes> - <exclude>**/README</exclude> - <exclude>src/test/resources/**</exclude> - <exclude>src/main/resources/**</exclude> - </excludes> - </licenseSet> - </licenseSets> - </configuration> - <dependencies> - <dependency> - <groupId>de.ozgcloud.common</groupId> - <artifactId>ozgcloud-common-license</artifactId> - <version>${ozgcloud.license.version}</version> - </dependency> - </dependencies> - </plugin> </plugins> </build> </project>