IncrementCounterAction extends SymbolAction { @Override public ExecuteResult execute(ConnectorManager connector) { CounterStoreConnector counterConnector = connector.getConnector(CounterStoreConnector.class); counterConnector.incrementBy(symbol.getProjectId(), name, incrementBy); LOGGER.info(LoggerMarkers.LEARNER, "Incremented counter '{}' by '{}'.", name, incrementBy); return getSuccessOutput(); }  @Override ExecuteResult execute(ConnectorManager connector); String getName(); void setName(String name); int getIncrementBy(); void setIncrementBy(int incrementBy);  }
@Test public void shouldSuccessfullyIncrementCounter() { CounterStoreConnector counters = mock(CounterStoreConnector.class); ConnectorManager connector = mock(ConnectorManager.class); given(connector.getConnector(CounterStoreConnector.class)).willReturn(counters); ExecuteResult result = incrementAction.execute(connector); assertTrue(result.isSuccess()); verify(counters).incrementBy(PROJECT_ID, TEST_NAME, 1); }