ConsumerAuthUtil { public void storeConsumerId(HttpServletRequest request, Long consumerId) { request.setAttribute(CONSUMER_ID, consumerId); } ConsumerAuthUtil(final ConsumerService consumerService); Long getConsumerId(String token); void storeConsumerId(HttpServletRequest request, Long consumerId); long retrieveConsumerId(HttpServletRequest request);  }
@Test public void testStoreConsumerId() throws Exception { long someConsumerId = 1L; consumerAuthUtil.storeConsumerId(request, someConsumerId); verify(request, times(1)).setAttribute(ConsumerAuthUtil.CONSUMER_ID, someConsumerId); }