November 2018
Intermediate to advanced
388 pages
9h 5m
English
Let's write a test case to see this code in action.
We are actually going to write two test cases: one for the Producer class, which sends a message to the queue, and another one for the Consumer class, which retrieves the message from the queue.
First, let's write a test case for the Producer to simulate the sendMessage() function:
class ProducerTest { @Test fun sendMessageTest() { val seContainerInitializer = SeContainerInitializer.newInstance() val producer = seContainerInitializer.initialize() .select(Producer::class.java) .get() Assert.assertNotNull(producer) val message = producer.sendMessage("TEST MESSAGE") Assert.assertEquals("Message sent", message) }}
When this test is ...
Read now
Unlock full access