### Question:
CassandraConfigurationFileImpl implements CassandraConfiguration { @Override public int readTimeoutMs() { int value = iniFile.getIntValue(CASSANDRA_READ_TIMEOUT_MS, SocketOptions.DEFAULT_READ_TIMEOUT_MILLIS); Preconditions.checkState(value >= 0, "Negative read timeout value in " + CONFIG_FILE_PATH + " configuration file"); return value; } @VisibleForTesting  CassandraConfigurationFileImpl(IniFile iniFile); @Override Collection<String> seeds(); @Override String keyspace(); @Override String user(); @Override String password(); @Override int readTimeoutMs(); @Override CassandraRetryPolicy retryPolicy(); @Override int maxRetries();  }### Answer:
@Test public void testReadTimeoutNotDefined() { int _12seconds = Ints.checkedCast(TimeUnit.SECONDS.toMillis(12)); expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_READ_TIMEOUT_MS, _12seconds)) .andReturn(_12seconds); control.replay(); int readTimeoutMs = new CassandraConfigurationFileImpl(iniFile).readTimeoutMs(); control.verify(); assertThat(readTimeoutMs).isEqualTo(_12seconds); }
@Test public void testReadTimeoutZero() { int _12seconds = Ints.checkedCast(TimeUnit.SECONDS.toMillis(12)); int _0seconds = 0; expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_READ_TIMEOUT_MS, _12seconds)) .andReturn(_0seconds); control.replay(); int readTimeoutMs = new CassandraConfigurationFileImpl(iniFile).readTimeoutMs(); control.verify(); assertThat(readTimeoutMs).isEqualTo(_0seconds); }
@Test(expected=IllegalStateException.class) public void testReadTimeoutNegative() { int _12seconds = Ints.checkedCast(TimeUnit.SECONDS.toMillis(12)); int lessThanZeroSeconds = -1; expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_READ_TIMEOUT_MS, _12seconds)) .andReturn(lessThanZeroSeconds); control.replay(); try { new CassandraConfigurationFileImpl(iniFile).readTimeoutMs(); } catch (NullPointerException e) { control.verify(); throw e; } }
@Test public void testReadTimeout() { int _12seconds = Ints.checkedCast(TimeUnit.SECONDS.toMillis(12)); int _20seconds = Ints.checkedCast(TimeUnit.SECONDS.toMillis(20)); expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_READ_TIMEOUT_MS, _12seconds)) .andReturn(_20seconds); control.replay(); int readTimeoutMs = new CassandraConfigurationFileImpl(iniFile).readTimeoutMs(); control.verify(); assertThat(readTimeoutMs).isEqualTo(_20seconds); }