Пример #1
0
 @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);
 }
Пример #2
0
 @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);
 }
Пример #3
0
 @Test
 public void should_decr_n() throws Exception {
   Counter counter = CounterBuilder.decr(10L);
   assertThat(counter.get()).isEqualTo(-10L);
 }
Пример #4
0
 @Test
 public void should_incr() throws Exception {
   Counter counter = CounterBuilder.incr();
   assertThat(counter.get()).isEqualTo(1L);
 }