@Test public void should_exception_when_calling_incr_n_with_consistency() throws Exception { Counter counter = CounterBuilder.incr(); exception.expect(UnsupportedOperationException.class); exception.expectMessage("This method is not meant to be called"); counter.incr(10L, EACH_QUORUM); }
@Test public void should_exception_when_calling_decr_n() throws Exception { Counter counter = CounterBuilder.incr(); exception.expect(UnsupportedOperationException.class); exception.expectMessage("This method is not meant to be called"); counter.decr(10L); }
@Test public void should_decr_n() throws Exception { Counter counter = CounterBuilder.decr(10L); assertThat(counter.get()).isEqualTo(-10L); }
@Test public void should_incr() throws Exception { Counter counter = CounterBuilder.incr(); assertThat(counter.get()).isEqualTo(1L); }