blob: d2e4258558a52e7b17a9149dd2c477a5fe18641d [file] [log] [blame]
package org.apache.tomee.chatterbox.nats.adapter;
import io.nats.streaming.Options;
import io.nats.streaming.StreamingConnection;
import io.nats.streaming.StreamingConnectionFactory;
import org.junit.Assert;
import org.junit.Test;
public class NATSTest {
@Test
public void testShouldConnect() throws Exception {
StreamingConnectionFactory cf = new
StreamingConnectionFactory(new Options.Builder().natsUrl("nats://localhost:4222")
.clusterId("cluster-id").clientId("yourclientid").build());
final StreamingConnection connection = cf.createConnection();
Assert.assertNotNull(connection);
connection.close();
}
}