Search in sources :

Example 11 with Startup

use of com.datastax.oss.protocol.internal.request.Startup in project java-driver by datastax.

the class DseStartupOptionsBuilderTest method should_build_startup_options_with_client_id.

@Test
public void should_build_startup_options_with_client_id() {
    when(defaultProfile.getString(DefaultDriverOption.PROTOCOL_COMPRESSION, "none")).thenReturn("none");
    UUID customClientId = Uuids.random();
    buildContext(customClientId, null, null);
    Startup startup = new Startup(driverContext.getStartupOptions());
    // assert the client id is present
    assertThat(startup.options).containsEntry(StartupOptionsBuilder.CLIENT_ID_KEY, customClientId.toString());
    assertThat(startup.options).doesNotContainKey(Startup.COMPRESSION_KEY);
    assertThat(startup.options).doesNotContainKey(StartupOptionsBuilder.APPLICATION_NAME_KEY);
    assertThat(startup.options).doesNotContainKey(StartupOptionsBuilder.APPLICATION_VERSION_KEY);
    assertDefaultStartupOptions(startup);
}
Also used : UUID(java.util.UUID) Startup(com.datastax.oss.protocol.internal.request.Startup) Test(org.junit.Test)

Aggregations

Startup (com.datastax.oss.protocol.internal.request.Startup)11 Test (org.junit.Test)11 DataProvider (com.tngtech.java.junit.dataprovider.DataProvider)2 UUID (java.util.UUID)2