Asynchronous notification process in JavaEE 7 using CDI events.
You can read the article at:
- Java 7 or above
- Maven
In the directory where the code was installed, execute the CLI command:
- mvn test
In the console you should see the following messages:
Jun 01, 2017 10:57:20 AM org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener testStarted
INFO: [run] net.teksoft.demo.registration.RegistrationServiceTest#testWebOrderEvent
Busy registering student: Roxy in course: Science 101
Sleep for a while to clearly show the effect of asynchronous.
Sending notification now:
You have successfully been registered.
Fired notification event.
Jun 01, 2017 10:57:30 AM org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener testFinished
INFO: [finished] net.teksoft.demo.registration.RegistrationServiceTest#testWebOrderEvent