This is an automated email from the ASF dual-hosted git repository.
tmaret pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git
The following commit(s) were added to refs/heads/master by this push:
new 0e4519f SLING-12652 - Add component name in processor properties
(#161)
0e4519f is described below
commit 0e4519fb09753e02a3c3c60d44e59a9bec5ba04f
Author: Timothee Maret <[email protected]>
AuthorDate: Mon Feb 17 09:45:40 2025 +0100
SLING-12652 - Add component name in processor properties (#161)
---
.../apache/sling/distribution/journal/bookkeeper/BookKeeper.java | 5 ++---
.../sling/distribution/journal/impl/subscriber/SubscriberTest.java | 7 +++----
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git
a/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java
b/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java
index 9a4ae46..04f9bdf 100644
---
a/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java
+++
b/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java
@@ -22,9 +22,7 @@ import static java.lang.String.format;
import static java.lang.System.currentTimeMillis;
import static java.util.Collections.singletonMap;
import static org.apache.sling.api.resource.ResourceResolverFactory.SUBSERVICE;
-import static
org.apache.sling.distribution.event.DistributionEventProperties.DISTRIBUTION_PACKAGE_ID;
-import static
org.apache.sling.distribution.event.DistributionEventProperties.DISTRIBUTION_PATHS;
-import static
org.apache.sling.distribution.event.DistributionEventProperties.DISTRIBUTION_TYPE;
+import static
org.apache.sling.distribution.event.DistributionEventProperties.*;
import java.io.IOException;
import java.io.PrintWriter;
@@ -468,6 +466,7 @@ public class BookKeeper {
processorProperties.put(DISTRIBUTION_TYPE,
packageMessage.getReqType().name());
processorProperties.put(DISTRIBUTION_PATHS, packageMessage.getPaths());
processorProperties.put(DISTRIBUTION_PACKAGE_ID,
packageMessage.getPkgId());
+ processorProperties.put(DISTRIBUTION_COMPONENT_NAME,
packageMessage.getPubAgentName());
return processorProperties;
}
diff --git
a/src/test/java/org/apache/sling/distribution/journal/impl/subscriber/SubscriberTest.java
b/src/test/java/org/apache/sling/distribution/journal/impl/subscriber/SubscriberTest.java
index 9976308..888a3ef 100644
---
a/src/test/java/org/apache/sling/distribution/journal/impl/subscriber/SubscriberTest.java
+++
b/src/test/java/org/apache/sling/distribution/journal/impl/subscriber/SubscriberTest.java
@@ -21,9 +21,7 @@ package org.apache.sling.distribution.journal.impl.subscriber;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.apache.sling.distribution.agent.DistributionAgentState.IDLE;
import static
org.apache.sling.distribution.agent.DistributionAgentState.RUNNING;
-import static
org.apache.sling.distribution.event.DistributionEventProperties.DISTRIBUTION_PACKAGE_ID;
-import static
org.apache.sling.distribution.event.DistributionEventProperties.DISTRIBUTION_PATHS;
-import static
org.apache.sling.distribution.event.DistributionEventProperties.DISTRIBUTION_TYPE;
+import static
org.apache.sling.distribution.event.DistributionEventProperties.*;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -319,7 +317,8 @@ public class SubscriberTest {
props.put(DISTRIBUTION_TYPE, message.getReqType().name());
props.put(DISTRIBUTION_PATHS, message.getPaths());
props.put(DISTRIBUTION_PACKAGE_ID, message.getPkgId());
-
+ props.put(DISTRIBUTION_COMPONENT_NAME, message.getPubAgentName());
+
verify(importPreProcessor, times(1)).process(props);
verify(importPostProcessor, times(1)).process(props);
}