### Question:
MongoDbOauthConsumerStoreRepository implements OAuthConsumerStoreRepository { @Override public void delete(OAuthConsumerStore item) { template.remove(get(item.getId())); }  @Override OAuthConsumerStore findByUriAndServiceName(String gadgetUri, String serviceName); @Override Class<? extends OAuthConsumerStore> getType(); @Override OAuthConsumerStore get(String id); @Override OAuthConsumerStore save(OAuthConsumerStore item); @Override void delete(OAuthConsumerStore item); @Override List<OAuthConsumerStore> getAll(); @Override List<OAuthConsumerStore> getLimitedList(int offset, int limit); @Override int getCountAll(); void setTemplate(MongoOperations template); static final Class<OAuthConsumerStoreImpl> CLASS; }### Answer:
@Test public void delete_Valid() { OAuthConsumerStore item = new OAuthConsumerStoreImpl(); item.setId("123"); expect(template.findById(item.getId(), oauthConsumerStoreRepository.CLASS, CollectionNames.OAUTH_CONSUMER_COLLECTION)).andReturn((OAuthConsumerStoreImpl)item); template.remove(item); expectLastCall(); replay(template); oauthConsumerStoreRepository.delete(item); verify(template); }