File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
spring-modulith-events/spring-modulith-events-tests/src/test/java/example/events Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,9 @@ void exposesEventPublicationForFailedListener() throws Exception {
87
87
}
88
88
89
89
// Resubmit failed publications
90
- context .getBean (IncompleteEventPublications .class ).resubmitIncompletePublications (__ -> true );
90
+ var incompletePublications = context .getBean (IncompleteEventPublications .class );
91
+
92
+ incompletePublications .resubmitIncompletePublications (__ -> true );
91
93
92
94
Thread .sleep (200 );
93
95
@@ -100,6 +102,18 @@ void exposesEventPublicationForFailedListener() throws Exception {
100
102
// Still 2 uncompleted publications
101
103
assertThat (registry .findIncompletePublications ()).hasSize (2 );
102
104
105
+ incompletePublications .resubmitIncompletePublications (it -> {
106
+ return TargetEventPublication .class .cast (it )
107
+ .getTargetIdentifier ()
108
+ .getValue ().contains (SecondTxEventListener .class .getName ());
109
+ });
110
+
111
+ assertThat (context .getBean (NonTxEventListener .class ).getInvoked ()).isEqualTo (1 );
112
+ assertThat (context .getBean (FirstTxEventListener .class ).getInvoked ()).isEqualTo (1 );
113
+ assertThat (context .getBean (SecondTxEventListener .class ).getInvoked ()).isEqualTo (3 );
114
+ assertThat (context .getBean (ThirdTxEventListener .class ).getInvoked ()).isEqualTo (1 );
115
+ assertThat (context .getBean (FourthTxEventListener .class ).getInvoked ()).isEqualTo (2 );
116
+
103
117
context .close ();
104
118
}
105
119
You can’t perform that action at this time.
0 commit comments