Skip to content

Commit 4c23759

Browse files
committed
Replace NONE event with INDEXING/DEINDEXING
Refactor DumAemEvent enums to replace the previous NONE/UNPUBLISHING mapping with explicit INDEXING and DEINDEXING values (keeping UNPUBLISHING and PUBLISHING), and update all callers and defaults to use INDEXING. Adjusted constructors, session builders, plugin/service calls, and event handlers to use the new default. Updated and reorganized many unit tests to reflect the enum changes (including DumAemAttrProcessTest restructuring and additional assertions) and fixed a mapper instantiation in DumAemSourceApiTest. No other functional behavior changes intended beyond the event enum rename/expansion and related test updates.
1 parent fea8596 commit 4c23759

File tree

20 files changed

+304
-281
lines changed

20 files changed

+304
-281
lines changed

aem-commons/src/main/java/com/viglet/dumont/connector/aem/commons/DumAemObjectGeneric.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class DumAemObjectGeneric {
7979
public final SimpleDateFormat aemJsonDateFormat = new SimpleDateFormat(DATE_JSON_FORMAT, Locale.ENGLISH);
8080

8181
public DumAemObjectGeneric(String nodePath, JSONObject jcrNode) {
82-
this(nodePath, jcrNode, DumAemEvent.NONE);
82+
this(nodePath, jcrNode, DumAemEvent.INDEXING);
8383
}
8484

8585
public DumAemObjectGeneric(String nodePath, JSONObject jcrNode, DumAemEvent event) {
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
package com.viglet.dumont.connector.aem.commons.bean;
22

33
public enum DumAemEvent {
4-
UNPUBLISHING {
4+
INDEXING {
55
@Override
66
public String toString() {
7-
return "UNPUBLISHING";
7+
return "INDEXING";
8+
}
9+
},
10+
DEINDEXING {
11+
@Override
12+
public String toString() {
13+
return "DEINDEXING";
814
}
915
},
1016
PUBLISHING {
@@ -13,10 +19,10 @@ public String toString() {
1319
return "PUBLISHING";
1420
}
1521
},
16-
NONE {
22+
UNPUBLISHING {
1723
@Override
1824
public String toString() {
19-
return "NONE";
25+
return "UNPUBLISHING";
2026
}
2127
}
2228
}

aem-commons/src/test/java/com/viglet/dumont/connector/aem/commons/DumAemObjectGenericTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717

1818
package com.viglet.dumont.connector.aem.commons;
1919

20-
import static org.junit.jupiter.api.Assertions.*;
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
21+
import static org.junit.jupiter.api.Assertions.assertFalse;
22+
import static org.junit.jupiter.api.Assertions.assertNotNull;
23+
import static org.junit.jupiter.api.Assertions.assertTrue;
2124

2225
import org.json.JSONObject;
2326
import org.junit.jupiter.api.DisplayName;
@@ -98,7 +101,7 @@ void shouldHandleEventUnpublishing() {
98101
void shouldHandleEventNone() {
99102
JSONObject jcrNode = createJcrNodeWithContent();
100103

101-
DumAemObjectGeneric object = new DumAemObjectGeneric(TEST_PATH, jcrNode, DumAemEvent.NONE);
104+
DumAemObjectGeneric object = new DumAemObjectGeneric(TEST_PATH, jcrNode, DumAemEvent.INDEXING);
102105

103106
assertNotNull(object);
104107
}

aem-commons/src/test/java/com/viglet/dumont/connector/aem/commons/bean/DumAemEnvTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package com.viglet.dumont.connector.aem.commons.bean;
1919

20-
import static org.junit.jupiter.api.Assertions.*;
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
2121

2222
import org.junit.jupiter.api.DisplayName;
2323
import org.junit.jupiter.api.Test;

aem-commons/src/test/java/com/viglet/dumont/connector/aem/commons/bean/DumAemEventTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package com.viglet.dumont.connector.aem.commons.bean;
1919

20-
import static org.junit.jupiter.api.Assertions.*;
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
2121

2222
import org.junit.jupiter.api.DisplayName;
2323
import org.junit.jupiter.api.Test;
@@ -40,20 +40,21 @@ void shouldHavePublishingEnumValue() {
4040
@Test
4141
@DisplayName("Should have NONE enum value")
4242
void shouldHaveNoneEnumValue() {
43-
assertEquals("NONE", DumAemEvent.NONE.toString());
43+
assertEquals("INDEXING", DumAemEvent.INDEXING.toString());
4444
}
4545

4646
@Test
4747
@DisplayName("Should have correct number of enum values")
4848
void shouldHaveCorrectNumberOfEnumValues() {
49-
assertEquals(3, DumAemEvent.values().length);
49+
assertEquals(4, DumAemEvent.values().length);
5050
}
5151

5252
@Test
5353
@DisplayName("Should get enum by name")
5454
void shouldGetEnumByName() {
5555
assertEquals(DumAemEvent.UNPUBLISHING, DumAemEvent.valueOf("UNPUBLISHING"));
5656
assertEquals(DumAemEvent.PUBLISHING, DumAemEvent.valueOf("PUBLISHING"));
57-
assertEquals(DumAemEvent.NONE, DumAemEvent.valueOf("NONE"));
57+
assertEquals(DumAemEvent.INDEXING, DumAemEvent.valueOf("INDEXING"));
58+
assertEquals(DumAemEvent.DEINDEXING, DumAemEvent.valueOf("DEINDEXING"));
5859
}
5960
}

aem/aem-plugin/src/main/java/com/viglet/dumont/connector/plugin/aem/impl/DumAemPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void indexAll(String source) {
5959
public void indexById(String source, List<String> contentId) {
6060
DumAemPathList dumAemPathList = DumAemPathList.builder()
6161
.paths(contentId)
62-
.event(DumAemEvent.NONE)
62+
.event(DumAemEvent.INDEXING)
6363
.recursive(false)
6464
.build();
6565
dumAemPluginProcess.sentToIndexStandalone(source, dumAemPathList);

aem/aem-plugin/src/main/java/com/viglet/dumont/connector/plugin/aem/service/DumAemSessionService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public DumAemSession getDumAemSession(DumAemSource dumAemSource,
5050
// Extract event and recursion settings with null-safe operations
5151
DumAemEvent event = Optional.ofNullable(dumAemPathList)
5252
.map(DumAemPathList::getEvent)
53-
.orElse(DumAemEvent.NONE);
53+
.orElse(DumAemEvent.INDEXING);
5454

5555
boolean recursive = Optional.ofNullable(dumAemPathList)
5656
.map(DumAemPathList::getRecursive)

0 commit comments

Comments
 (0)