@Test public void testCheckOutCached() { final CachedConnection cachedConnection = mock(CachedConnection.class); cachedConnections.add(cachedConnection); assertThat(librarian.checkOut(USERNAME, PASSWORD, SERVER_ADDRESS)).isEqualTo(cachedConnection); }
@Override public CachedConnection checkOut(final String username, final String password, final URI serverAddress) { final String id = idGenerator.buildKey(username, password, serverAddress); return retrieveCachedConnection(id, new UserPasswordCreator(username, password, serverAddress, this)); }
CachedLibrarian implements ConnectionLibrarian<CachedConnection> { @Override public CachedConnection checkOut(final String username, final String password, final URI serverAddress) { final String id = idGenerator.buildKey(username, password, serverAddress); return retrieveCachedConnection(id, new UserPasswordCreator(username, password, serverAddress, this)); } }
CachedLibrarian implements ConnectionLibrarian<CachedConnection> { @Override public CachedConnection checkOut(final String username, final String password, final URI serverAddress) { final String id = idGenerator.buildKey(username, password, serverAddress); return retrieveCachedConnection(id, new UserPasswordCreator(username, password, serverAddress, this)); } CachedLibrarian(final IdentifierGenerator idGenerator, final Cache cache); }
CachedLibrarian implements ConnectionLibrarian<CachedConnection> { @Override public CachedConnection checkOut(final String username, final String password, final URI serverAddress) { final String id = idGenerator.buildKey(username, password, serverAddress); return retrieveCachedConnection(id, new UserPasswordCreator(username, password, serverAddress, this)); } CachedLibrarian(final IdentifierGenerator idGenerator, final Cache cache); @Override void checkIn(final CachedConnection connection); @Override CachedConnection checkOut(final String username, final String password, final URI serverAddress); @Override CachedConnection checkOut(final String username, final String salt, final URI privateKeyLocation,
            final URI serverAddress); }
CachedLibrarian implements ConnectionLibrarian<CachedConnection> { @Override public CachedConnection checkOut(final String username, final String password, final URI serverAddress) { final String id = idGenerator.buildKey(username, password, serverAddress); return retrieveCachedConnection(id, new UserPasswordCreator(username, password, serverAddress, this)); } CachedLibrarian(final IdentifierGenerator idGenerator, final Cache cache); @Override void checkIn(final CachedConnection connection); @Override CachedConnection checkOut(final String username, final String password, final URI serverAddress); @Override CachedConnection checkOut(final String username, final String salt, final URI privateKeyLocation,
            final URI serverAddress);  }