@BeforeClass
public static void mockJndi() throws IllegalStateException, NamingException {
SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
builder.bind("java.naming.factory.initial", new org.jnp.interfaces.NamingContextFactory());
builder.bind("ConnectionFactory", new QueueConnectionFactoryBean());
builder.bind("queue/someFileQueue", new ActiveMQQueue());
builder.activate();
}.
Thanks to http://formatmysourcecode.blogspot.com/ :)