BAEL-3715: Sync code and article (#9932)

This commit is contained in:
kwoyke 2020-08-29 10:49:40 +02:00 committed by GitHub
parent fa09cd6854
commit 44d66d9a0f
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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. ");
} }
} }

View File

@ -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");
} }