コード例 #1
0
  @Test
  public void should_init_default_read_consistency_level() throws Exception {
    configMap.put(CONSISTENCY_LEVEL_READ_DEFAULT_PARAM, "ONE");

    doCallRealMethod().when(extractor).initDefaultReadConsistencyLevel(configMap);
    assertThat(extractor.initDefaultReadConsistencyLevel(configMap)).isEqualTo(ONE);
  }
コード例 #2
0
  @Test
  public void should_exception_when_invalid_consistency_level() throws Exception {
    configMap.put(CONSISTENCY_LEVEL_READ_DEFAULT_PARAM, "wrong_value");

    exception.expect(IllegalArgumentException.class);
    exception.expectMessage("'wrong_value' is not a valid Consistency Level");

    doCallRealMethod().when(extractor).initDefaultReadConsistencyLevel(configMap);
    extractor.initDefaultReadConsistencyLevel(configMap);
  }
コード例 #3
0
 @Test
 public void should_return_default_one_level_when_no_parameter() throws Exception {
   doCallRealMethod().when(extractor).initDefaultReadConsistencyLevel(configMap);
   assertThat(extractor.initDefaultReadConsistencyLevel(configMap)).isEqualTo(ONE);
 }