@Test public void shouldPerformDelete() throws LDAPOperationFailedException, ErrorResultException, DeleteFailedException { String tokenId = "badger"; adapter.delete(tokenId); verify(mockLDAPAdapter).delete(any(Connection.class), eq(tokenId)); }
public void delete(String tokenId) throws DeleteFailedException { Connection connection = null; try { connection = connectionFactory.getConnection(); ldapAdapter.delete(connection, tokenId); if (debug.messageEnabled()) { debug.message(MessageFormat.format( CoreTokenConstants.DEBUG_HEADER + "Delete: Deleted DN {0}", tokenId)); } } catch (ErrorResultException e) { throw new DeleteFailedException(tokenId, e); } catch (LDAPOperationFailedException e) { throw new DeleteFailedException(tokenId, e); } finally { IOUtils.closeIfNotNull(connection); } }
CoreTokenAdapter { public void delete(String tokenId) throws DeleteFailedException { Connection connection = null; try { connection = connectionFactory.getConnection(); ldapAdapter.delete(connection, tokenId); if (debug.messageEnabled()) { debug.message(MessageFormat.format( CoreTokenConstants.DEBUG_HEADER + "Delete: Deleted DN {0}", tokenId)); } } catch (ErrorResultException e) { throw new DeleteFailedException(tokenId, e); } catch (LDAPOperationFailedException e) { throw new DeleteFailedException(tokenId, e); } finally { IOUtils.closeIfNotNull(connection); } } }
CoreTokenAdapter { public void delete(String tokenId) throws DeleteFailedException { Connection connection = null; try { connection = connectionFactory.getConnection(); ldapAdapter.delete(connection, tokenId); if (debug.messageEnabled()) { debug.message(MessageFormat.format( CoreTokenConstants.DEBUG_HEADER + "Delete: Deleted DN {0}", tokenId)); } } catch (ErrorResultException e) { throw new DeleteFailedException(tokenId, e); } catch (LDAPOperationFailedException e) { throw new DeleteFailedException(tokenId, e); } finally { IOUtils.closeIfNotNull(connection); } } @Inject  CoreTokenAdapter(ConnectionFactory connectionFactory, QueryFactory queryFactory,
                            LDAPAdapter ldapAdapter, ConfigurationObserver observer,
                            CoreTokenConfigListener listener, @Named(CoreTokenConstants.CTS_DEBUG) Debug debug); }
CoreTokenAdapter { public void delete(String tokenId) throws DeleteFailedException { Connection connection = null; try { connection = connectionFactory.getConnection(); ldapAdapter.delete(connection, tokenId); if (debug.messageEnabled()) { debug.message(MessageFormat.format( CoreTokenConstants.DEBUG_HEADER + "Delete: Deleted DN {0}", tokenId)); } } catch (ErrorResultException e) { throw new DeleteFailedException(tokenId, e); } catch (LDAPOperationFailedException e) { throw new DeleteFailedException(tokenId, e); } finally { IOUtils.closeIfNotNull(connection); } } @Inject  CoreTokenAdapter(ConnectionFactory connectionFactory, QueryFactory queryFactory,
                            LDAPAdapter ldapAdapter, ConfigurationObserver observer,
                            CoreTokenConfigListener listener, @Named(CoreTokenConstants.CTS_DEBUG) Debug debug); void create(Token token); Token read(String tokenId); QueryBuilder query(); QueryFilter buildFilter(); void updateOrCreate(Token token); void delete(String tokenId); }
CoreTokenAdapter { public void delete(String tokenId) throws DeleteFailedException { Connection connection = null; try { connection = connectionFactory.getConnection(); ldapAdapter.delete(connection, tokenId); if (debug.messageEnabled()) { debug.message(MessageFormat.format( CoreTokenConstants.DEBUG_HEADER + "Delete: Deleted DN {0}", tokenId)); } } catch (ErrorResultException e) { throw new DeleteFailedException(tokenId, e); } catch (LDAPOperationFailedException e) { throw new DeleteFailedException(tokenId, e); } finally { IOUtils.closeIfNotNull(connection); } } @Inject  CoreTokenAdapter(ConnectionFactory connectionFactory, QueryFactory queryFactory,
                            LDAPAdapter ldapAdapter, ConfigurationObserver observer,
                            CoreTokenConfigListener listener, @Named(CoreTokenConstants.CTS_DEBUG) Debug debug); void create(Token token); Token read(String tokenId); QueryBuilder query(); QueryFilter buildFilter(); void updateOrCreate(Token token); void delete(String tokenId);  }