### Question:
MongoDbOAuthTokenInfoRepository implements OAuthTokenInfoRepository { @Override public OAuthTokenInfo get(String id) { return template.findById(id, 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 get(){ OAuthTokenInfo result; OAuthTokenInfo item = new OAuthTokenInfoImpl("appUrl", "serviceName", "tokenName", "accessToken", "sessionHandle", "tokenSecret", "userId", 1111L); item.setId("1234L"); expect(template.findById("1234L", CLASS2, OAUTH_TOKEN_COLLECTION)).andReturn((OAuthTokenInfoImpl)item); replay(template); result = repo.get("1234L"); assertThat(result.getId(), is(equalTo("1234L"))); }