### Question:
OAuthConsumerManager extends AbstractOAuthManager implements IOAuthConsumerManager { @Override public void deleteConsumer(String clientId) throws ApsSystemException { try { this.getConsumerDAO().deleteConsumer(clientId); } catch (Throwable t) { logger.error("Error deleting consumer record by key {}", clientId, t); throw new ApsSystemException("Error deleting consumer record by key " + clientId, t); } }  @Override void init(); @Override ClientDetails loadClientByClientId(String clientId); @Override ConsumerRecordVO getConsumerRecord(String consumerKey); @Override ConsumerRecordVO addConsumer(ConsumerRecordVO consumer); @Override ConsumerRecordVO updateConsumer(ConsumerRecordVO consumer); @Override void deleteConsumer(String clientId); @Override List<String> getConsumerKeys(FieldSearchFilter<?>[] filters); void setConsumerDAO(IOAuthConsumerDAO consumerDAO); @Override List<ConsumerRecordVO> getConsumers(FieldSearchFilter<?>[] filters);  }### Answer:
@Test public void deleteConsumer() throws Exception { this.consumerManager.deleteConsumer("key_test_1"); Mockito.verify(consumerDAO, Mockito.times(1)).deleteConsumer(Mockito.anyString()); }
@Test(expected = ApsSystemException.class) public void failDeleteConsumer() throws Exception { Mockito.doThrow(RuntimeException.class).when(this.consumerDAO).deleteConsumer(Mockito.anyString()); try { this.consumerManager.deleteConsumer("key_test_2"); } catch (ApsSystemException e) { throw e; } finally { Mockito.verify(consumerDAO, Mockito.times(1)).deleteConsumer(Mockito.anyString()); } }