ModifyPeerCommand setBurstOnly();
ModifyPeerCommand clearBurstOnly();
ModifyPeerCommand setListenOnly();
+ ModifyPeerCommand clearListenOnly();
Executable<Optional<Peer>> byName(String name);
Executable<Optional<Peer>> byIdentity(String nodeIdentity);
assertThat(peer.get().get().getIdentity(), is("id1"));
}
+ @Test
+ public void defaultFcpClientCanClearListenOnlyForPeer()
+ throws InterruptedException, ExecutionException, IOException {
+ Future<Optional<Peer>> peer = fcpClient.modifyPeer().clearListenOnly().byIdentity("id1").execute();
+ connectNode();
+ List<String> lines = fcpServer.collectUntil(is("EndMessage"));
+ String identifier = extractIdentifier(lines);
+ assertThat(lines, matchesFcpMessage(
+ "ModifyPeer",
+ "Identifier=" + identifier,
+ "NodeIdentifier=id1",
+ "IsListenOnly=false",
+ "EndMessage"
+ ));
+ assertThat(lines, not(contains(startsWith("AllowLocalAddresses="))));
+ assertThat(lines, not(contains(startsWith("IsDisabled="))));
+ assertThat(lines, not(contains(startsWith("IsBurstOnly="))));
+ fcpServer.writeLine(
+ "Peer",
+ "Identifier=" + identifier,
+ "NodeIdentifier=Friend1",
+ "identity=id1",
+ "EndMessage"
+ );
+ assertThat(peer.get().get().getIdentity(), is("id1"));
+ }
+
}