Class EmbeddedActiveMQExtension

java.lang.Object
org.apache.activemq.artemis.junit.EmbeddedActiveMQExtension
All Implemented Interfaces:
EmbeddedActiveMQOperations, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension

public class EmbeddedActiveMQExtension extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback, EmbeddedActiveMQOperations
A JUnit Extension that embeds an Apache Artemis server into a test.

This JUnit Extension is designed to simplify using embedded servers in unit tests. Adding the extension to a test will startup an embedded server, which can then be used by client applications.

public class SimpleTest {
    @RegisterExtension
    private EmbeddedActiveMQExtension server = new EmbeddedActiveMQExtension();

    @Test
    public void testSomething() throws Exception {
        // Use the embedded server here
    }
}