public interface ClientPutCommand {
ClientPutCommand named(String targetFilename);
- Keyed<Optional<Key>> redirectTo(Key key);
+ Keyed<Optional<Key>> redirectTo(String uri);
Keyed<Optional<Key>> from(File file);
Lengthed<Keyed<Optional<Key>>> from(InputStream inputStream);
}
@Override
- public Keyed<Optional<Key>> redirectTo(Key key) {
- this.redirectUri.set(Objects.requireNonNull(key, "key must not be null").getKey());
+ public Keyed<Optional<Key>> redirectTo(String uri) {
+ this.redirectUri.set(Objects.requireNonNull(uri, "uri must not be null"));
return this::key;
}
@Test
public void clientPutWithRedirectSendsCorrectCommand()
throws IOException, ExecutionException, InterruptedException {
- fcpClient.clientPut().redirectTo(new Key("KSK@bar.txt")).key(new Key("KSK@foo.txt"));
+ fcpClient.clientPut().redirectTo("KSK@bar.txt").key(new Key("KSK@foo.txt"));
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines,