BAEL-3715: Sync code and article (#9932)
This commit is contained in:
parent
fa09cd6854
commit
44d66d9a0f
|
@ -10,7 +10,7 @@ public class CustomSpringEventPublisher {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationEventPublisher applicationEventPublisher;
|
private ApplicationEventPublisher applicationEventPublisher;
|
||||||
|
|
||||||
public void publishEvent(final String message) {
|
public void publishCustomEvent(final String message) {
|
||||||
System.out.println("Publishing custom event. ");
|
System.out.println("Publishing custom event. ");
|
||||||
final CustomSpringEvent customSpringEvent = new CustomSpringEvent(this, message);
|
final CustomSpringEvent customSpringEvent = new CustomSpringEvent(this, message);
|
||||||
applicationEventPublisher.publishEvent(customSpringEvent);
|
applicationEventPublisher.publishEvent(customSpringEvent);
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class AsynchronousCustomSpringEventsIntegrationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCustomSpringEvents() throws InterruptedException {
|
public void testCustomSpringEvents() throws InterruptedException {
|
||||||
publisher.publishEvent("Hello world!!");
|
publisher.publishCustomEvent("Hello world!!");
|
||||||
System.out.println("Done publishing asynchronous custom event. ");
|
System.out.println("Done publishing asynchronous custom event. ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class SynchronousCustomSpringEventsIntegrationTest {
|
||||||
@Test
|
@Test
|
||||||
public void testCustomSpringEvents() {
|
public void testCustomSpringEvents() {
|
||||||
isTrue(!listener.isHitCustomEventHandler(), "The value should be false");
|
isTrue(!listener.isHitCustomEventHandler(), "The value should be false");
|
||||||
publisher.publishEvent("Hello world!!");
|
publisher.publishCustomEvent("Hello world!!");
|
||||||
System.out.println("Done publishing synchronous custom event. ");
|
System.out.println("Done publishing synchronous custom event. ");
|
||||||
isTrue(listener.isHitCustomEventHandler(), "Now the value should be changed to true");
|
isTrue(listener.isHitCustomEventHandler(), "Now the value should be changed to true");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue