<commit_before>package org.stuartgunter.dropwizard.cassandra;

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ProtocolOptions;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.*;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest({CassandraConfiguration.class, Cluster.class})
public class CassandraConfigurationTest {

    private final Cluster.Builder builder = mock(Cluster.Builder.class);
    private final Cluster cluster = mock(Cluster.class);

    @Before
    public void setUp() throws Exception {
        mockStatic(Cluster.class);
        when(Cluster.builder()).thenReturn(builder);
        when(builder.build()).thenReturn(cluster);
    }

    @Test
    public void buildsACluster() throws Exception {
        final CassandraConfiguration configuration = new CassandraConfiguration();
        configuration.setClusterName("test-cluster");
        configuration.setCompression(ProtocolOptions.Compression.LZ4);
        configuration.setContactPoints(new String[] {"localhost"});
        configuration.setJmxEnabled(false);
        configuration.setMetricsEnabled(false);
        configuration.setPort(1234);
        configuration.setProtocolVersion(2);
        configuration.setShutdownWaitSeconds(10);

        final Cluster result = configuration.buildCluster();

        assertThat(result, sameInstance(cluster));
        verify(builder).addContactPoints("localhost");
        verify(builder).withPort(1234);
        verify(builder).withCompression(ProtocolOptions.Compression.LZ4);<commit_msg>Updated tests for CassandraConfiguration<commit_after>package org.stuartgunter.dropwizard.cassandra;

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ProtocolOptions;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.*;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest(Cluster.class)
public class CassandraConfigurationTest {

    private final Cluster.Builder builder = mock(Cluster.Builder.class);
    private final Cluster cluster = mock(Cluster.class);

    @Before
    public void setUp() throws Exception {
        mockStatic(Cluster.class);
        when(Cluster.builder()).thenReturn(builder);
        when(builder.build()).thenReturn(cluster);
    }

    @Test
    public void buildsACluster() throws Exception {
        final CassandraConfiguration configuration = new CassandraConfiguration();
        configuration.setClusterName("test-cluster");
        configuration.setCompression(ProtocolOptions.Compression.LZ4);
        configuration.setContactPoints(new String[] {"localhost"});
        configuration.setJmxEnabled(false);
        configuration.setMetricsEnabled(false);
        configuration.setPort(1234);
        configuration.setProtocolVersion(2);
        configuration.setShutdownWaitSeconds(10);

        final Cluster result = configuration.buildCluster();

        assertThat(result, sameInstance(cluster));
        verify(builder).addContactPoints("localhost");
        verify(builder).withPort(1234);
        verify(builder).withCompression(ProtocolOptions.Compression.LZ4);
{'fraction_non_alphanumeric': 0.10120729514513228, 'fraction_numerical': 0.007192396609298741, 'mean_word_length': 4.709677419354839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1698492', 'n_tokens_mistral': 1054, 'n_tokens_neox': 1023, 'n_words': 173}