@Test
public void saveOauthCode() throws Exception {

    final OAuthIssuerImpl oAuthIssuer = new OAuthIssuerImpl(new MD5Generator());
    OauthCode oauthCode = new OauthCode()
            .username("test")
            .code(oAuthIssuer.authorizationCode())
            .clientId("client+id");
    oauthJdbcRepository.saveOauthCode(oauthCode);
    final OauthCode oauthCode1 = oauthJdbcRepository.findOauthCode(oauthCode.code(), oauthCode.clientId());
    assertNotNull(oauthCode1);
    assertNotNull(oauthCode1.code());
    assertNotNull(oauthCode1.username());
    System.out.println(oauthCode1.code());
    final OauthCode oauthCode2 = oauthJdbcRepository.findOauthCodeByUsernameClientId(oauthCode.username(), oauthCode.clientId());
    assertNotNull(oauthCode2);
    final int i = oauthJdbcRepository.deleteOauthCode(oauthCode);
    assertEquals(i, 1);
    final OauthCode oauthCode3 = oauthJdbcRepository.findOauthCodeByUsernameClientId("add", "ddood");
    assertNull(oauthCode3);
}