### Question:
OAuth2TokenDAO extends AbstractSearcherDAO implements IOAuth2TokenDAO { @Override public void removeAccessToken(final String accessToken) { super.executeQueryWithoutResultset(DELETE_TOKEN, accessToken); }  @Override List<OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String username); @Override List<OAuth2AccessToken> findTokensByUserName(String username); @Override List<OAuth2AccessToken> findTokensByClientId(String clientId); @Override void storeAccessToken(OAuth2AccessToken accessToken, OAuth2Authentication authentication); @Override OAuth2AccessToken readAccessToken(final String accessToken); @Override void removeAccessToken(final String accessToken); @Override void removeAccessTokenUsingRefreshToken(String refreshToken); @Override void deleteExpiredToken(int expirationTime); @Override OAuth2RefreshToken readRefreshToken(String tokenValue); @Override OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken refreshToken);  }### Answer:
@Test public void removeAccessToken() throws Exception { this.tokenDAO.removeAccessToken("token"); Mockito.verify(stat, Mockito.times(1)).setObject(Mockito.anyInt(), Mockito.any()); Mockito.verify(stat, Mockito.times(1)).close(); Mockito.verify(conn, Mockito.times(1)).close(); }
@Test(expected = RuntimeException.class) public void failRemoveAccessToken() throws Exception { try { Mockito.doThrow(SQLException.class).when(stat).setObject(Mockito.anyInt(), Mockito.any()); this.tokenDAO.removeAccessToken("token"); Assert.fail(); } catch (RuntimeException e) { Mockito.verify(stat, Mockito.times(1)).close(); Mockito.verify(conn, Mockito.times(1)).close(); throw e; } }