assertThat(peer.get(), is(true));
}
+ @Test
+ public void defaultFcpClientCanRemovePeerByIdentity() throws InterruptedException, ExecutionException, IOException {
+ Future<Boolean> peer = fcpClient.removePeer().byIdentity("id1").execute();
+ connectNode();
+ List<String> lines = fcpServer.collectUntil(is("EndMessage"));
+ String identifier = extractIdentifier(lines);
+ assertThat(lines, matchesFcpMessage(
+ "RemovePeer",
+ "Identifier=" + identifier,
+ "NodeIdentifier=id1",
+ "EndMessage"
+ ));
+ fcpServer.writeLine(
+ "PeerRemoved",
+ "Identifier=" + identifier,
+ "NodeIdentifier=Friend1",
+ "EndMessage"
+ );
+ assertThat(peer.get(), is(true));
+ }
+
}