### Question:
MongoDbOAuthTokenInfoRepository implements OAuthTokenInfoRepository { @Override public OAuthTokenInfo findOAuthTokenInfo(String userId, String appUrl, String moduleId, String tokenName, String serviceName) { return template.findOne( query(where("userId").is(userId) .andOperator(where("appUrl").is(appUrl)) .andOperator(where("moduleId").is(moduleId)) .andOperator(where("tokenName").is(tokenName)) .andOperator(where("serviceName").is(serviceName)) ), CLASS, OAUTH_TOKEN_COLLECTION); }  @Override OAuthTokenInfo findOAuthTokenInfo(String userId, String appUrl, String moduleId, String tokenName, String serviceName); @Override Class<? extends OAuthTokenInfo> getType(); @Override OAuthTokenInfo get(String id); @Override OAuthTokenInfo save(OAuthTokenInfo item); @Override void delete(OAuthTokenInfo item); @Override List<OAuthTokenInfo> getAll(); @Override List<OAuthTokenInfo> getLimitedList(int offset, int limit); @Override int getCountAll(); void setTemplate(MongoOperations template); static final Class<OAuthTokenInfoImpl> CLASS; }### Answer:
@Test public void findOAuthTokenInfo(){ OAuthTokenInfo info = new OAuthTokenInfoImpl(); String userId = "1234"; String appUrl = "www.test.com"; String moduleId = "2222"; String tokenName = "token"; String serviceName = "service"; info.setUserId(userId); info.setAppUrl(appUrl); info.setModuleId(moduleId); info.setTokenName(tokenName); info.setServiceName(serviceName); expect(template.findOne(query(where("userId").is(userId) .andOperator(where("appUrl").is(appUrl)) .andOperator(where("moduleId").is(moduleId)) .andOperator(where("tokenName").is(tokenName)) .andOperator(where("serviceName").is(serviceName)) ), CLASS1, OAUTH_TOKEN_COLLECTION)).andReturn(info); replay(template); }