Skip to content
Snippets Groups Projects
Commit b2f9b31d authored by Felix Reichenbach's avatar Felix Reichenbach
Browse files

Merge branch 'main' into OZG-7038-EvaluationDMSQuittung

parents 27204efe dbdaa10d
No related branches found
No related tags found
1 merge request!3Ozg 7038 evaluation dms quittung
...@@ -46,10 +46,10 @@ import de.ozgcloud.command.VorgangLockedEvent; ...@@ -46,10 +46,10 @@ import de.ozgcloud.command.VorgangLockedEvent;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
@Component() @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@Log4j2 @Log4j2
class ArchiveEventListener { public class ArchiveEventListener {
static final int MAXIMUM_CHECKS_FOR_PENDING_COMMANDS = 3; static final int MAXIMUM_CHECKS_FOR_PENDING_COMMANDS = 3;
static final int WAIT_INTERVAL = 30 * 1000; static final int WAIT_INTERVAL = 30 * 1000;
...@@ -57,10 +57,10 @@ class ArchiveEventListener { ...@@ -57,10 +57,10 @@ class ArchiveEventListener {
private static final String ERROR_MESSAGE_TEMPLATE = "Error on executing %s Command (id: %s)."; private static final String ERROR_MESSAGE_TEMPLATE = "Error on executing %s Command (id: %s).";
static final String ARCHIVE_VORGANG_ORDER = "ARCHIVE_VORGANG"; static final String ARCHIVE_VORGANG_ORDER = "ARCHIVE_VORGANG";
private static final String IS_ARCHIVE_VORGANG_EVENT = "{T(de.ozgcloud.archive.vorgang.ArchiveEventListener).IS_ARCHIVE_VORGANG_COMMAND.test(event.getSource())}"; private static final String IS_ARCHIVE_VORGANG_EVENT = "{T(de.ozgcloud.archive.archivierung.ArchiveEventListener).IS_ARCHIVE_VORGANG_COMMAND.test(event.getSource())}";
public static final Predicate<Command> IS_ARCHIVE_VORGANG_COMMAND = command -> ARCHIVE_VORGANG_ORDER.equals(command.getOrder()); public static final Predicate<Command> IS_ARCHIVE_VORGANG_COMMAND = command -> ARCHIVE_VORGANG_ORDER.equals(command.getOrder());
private static final String IS_LOCKED_BY_ARCHIVE_MANAGER_EVENT = "{T(de.ozgcloud.archive.vorgang.ArchiveEventListener)." private static final String IS_LOCKED_BY_ARCHIVE_MANAGER_EVENT = "{T(de.ozgcloud.archive.archivierung.ArchiveEventListener)."
+ "IS_LOCK_BY_ARCHIVE_MANAGER_COMMAND.test(event.getCommand())}"; + "IS_LOCK_BY_ARCHIVE_MANAGER_COMMAND.test(event.getCommand())}";
public static final Predicate<Command> IS_LOCK_BY_ARCHIVE_MANAGER_COMMAND = command -> CallContextUser.ARCHIVE_MANAGER_CLIENT_NAME public static final Predicate<Command> IS_LOCK_BY_ARCHIVE_MANAGER_COMMAND = command -> CallContextUser.ARCHIVE_MANAGER_CLIENT_NAME
.equals(command.getCreatedByClientName()); .equals(command.getCreatedByClientName());
......
/*
* 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.
*/
package de.ozgcloud.archive.archivierung; package de.ozgcloud.archive.archivierung;
import java.io.File; import java.io.File;
......
...@@ -40,7 +40,7 @@ class XtaConfiguration { ...@@ -40,7 +40,7 @@ class XtaConfiguration {
.msgBoxServiceUrl(xtaProperties.getMsgBoxServiceUrl()) .msgBoxServiceUrl(xtaProperties.getMsgBoxServiceUrl())
.clientCertKeystore(buildKeystore(xtaProperties.getKeyStore())) .clientCertKeystore(buildKeystore(xtaProperties.getKeyStore()))
.trustStore(buildKeystore(xtaProperties.getTrustStore())) .trustStore(buildKeystore(xtaProperties.getTrustStore()))
.maxListItems(xtaProperties.getMaxListItems()) .maxListItems(xtaProperties.getMaxLoadedMessages())
.clientIdentifiers(xtaProperties.getClientIdentifiers()) .clientIdentifiers(xtaProperties.getClientIdentifiers())
.build(); .build();
} }
......
...@@ -35,11 +35,11 @@ public class XtaProperties { ...@@ -35,11 +35,11 @@ public class XtaProperties {
*/ */
private String managementServiceUrl; private String managementServiceUrl;
/* /*
* Maximum number of Messages loaded from message box. * Maximum number of messages loaded from message box.
*/ */
private int maxListItems = 50; private int maxLoadedMessages = 50;
/* /*
* Reference to client certifiaction key store. * Reference to client certification key store.
*/ */
private XtaClientKeyStore keyStore; private XtaClientKeyStore keyStore;
/* /*
...@@ -47,7 +47,7 @@ public class XtaProperties { ...@@ -47,7 +47,7 @@ public class XtaProperties {
*/ */
private XtaClientKeyStore trustStore; private XtaClientKeyStore trustStore;
/* /*
* Client identifiers used to identify cleint at XTA adapter. * Client identifiers used to identify client at XTA adapter.
*/ */
private List<XtaIdentifier> clientIdentifiers; private List<XtaIdentifier> clientIdentifiers;
/* /*
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
package de.ozgcloud.archive.archivierung; package de.ozgcloud.archive.archivierung;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*; import static org.mockito.Mockito.*;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
...@@ -31,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -31,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.SpyBean; import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import de.ozgcloud.archive.common.callcontext.CallContextUser;
import de.ozgcloud.command.Command; import de.ozgcloud.command.Command;
import de.ozgcloud.command.CommandCreatedEventTestFactory; import de.ozgcloud.command.CommandCreatedEventTestFactory;
import de.ozgcloud.command.CommandTestFactory; import de.ozgcloud.command.CommandTestFactory;
...@@ -68,4 +70,30 @@ class ArchiveEventListenerITCase { ...@@ -68,4 +70,30 @@ class ArchiveEventListenerITCase {
verifyNoInteractions(eventListener); verifyNoInteractions(eventListener);
} }
} }
@Nested
class TestOnVorgangLockedEvent {
private static final Command COMMAND = CommandTestFactory.createBuilder()
.createdByClientName(CallContextUser.ARCHIVE_MANAGER_CLIENT_NAME)
.build();
@Test
void shouldReactOnOrder() {
var event = VorgangLockedEventTestFactory.withCommand(COMMAND);
doNothing().when(eventListener).onVorgangLockedEvent(any());
publisher.publishEvent(event);
verify(eventListener).onVorgangLockedEvent(event);
}
@Test
void shouldNotReactOnOtherOrder() {
publisher
.publishEvent(VorgangLockedEventTestFactory.withCommand(CommandTestFactory.createBuilder().createdByClientName("OTHER").build()));
verifyNoInteractions(eventListener);
}
}
} }
\ No newline at end of file
package de.ozgcloud.archive.archivierung;
import de.ozgcloud.command.Command;
import de.ozgcloud.command.VorgangLockedEvent;
public class VorgangLockedEventTestFactory {
public static VorgangLockedEvent withCommand(Command command) {
return new VorgangLockedEvent(command);
}
}
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vorgang-manager.version>2.18.0</vorgang-manager.version> <vorgang-manager.version>2.18.0</vorgang-manager.version>
<nachrichten-manager.version>2.15.0</nachrichten-manager.version> <nachrichten-manager.version>2.15.0</nachrichten-manager.version>
<api-lib.version>0.16.0-PR-38-SNAPSHOT</api-lib.version> <api-lib.version>0.16.0-SNAPSHOT</api-lib.version>
<find-and-replace-maven-plugin.version>1.2.0</find-and-replace-maven-plugin.version> <find-and-replace-maven-plugin.version>1.2.0</find-and-replace-maven-plugin.version>
<protoc-jar-plugin.version>3.11.4</protoc-jar-plugin.version> <protoc-jar-plugin.version>3.11.4</protoc-jar-plugin.version>
<ozgcloud-common.version>4.7.0</ozgcloud-common.version> <ozgcloud-common.version>4.7.0</ozgcloud-common.version>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment