Search in sources :

Example 1 with Client

use of com.rabbitmq.stream.impl.Client in project rabbitmq-stream-java-client by rabbitmq.

the class DefaultEnvironmentTest method defaultEnvironmentCanBeInstantiatedAndCanConnect.

@Test
void defaultEnvironmentCanBeInstantiatedAndCanConnect() {
    String stream = UUID.randomUUID().toString();
    try (Client client = new Client(new Client.ClientParameters().eventLoopGroup(eventLoopGroup))) {
        Client.Response response = client.create(stream);
        assertThat(response.isOk()).isTrue();
        try (Environment environment = Environment.builder().eventLoopGroup(eventLoopGroup).build()) {
            environment.producerBuilder().stream(stream);
        } finally {
            response = client.delete(stream);
            assertThat(response.isOk()).isTrue();
        }
    }
}
Also used : Client(com.rabbitmq.stream.impl.Client) Test(org.junit.jupiter.api.Test)

Aggregations

Client (com.rabbitmq.stream.impl.Client)1 Test (org.junit.jupiter.api.Test)1