@Test
  public void authPlainTextWithEncryption() {
    // Start a handshaker disabling encryption.
    final ECIESHandshaker initiator = new ECIESHandshaker();

    // Prepare the handshaker to take the initiator role.
    initiator.prepareInitiator(
        NodeKeyUtils.createFrom(Input.initiatorKeyPair), Input.responderKeyPair.getPublicKey());

    // Set the test vectors.
    initiator.setEphKeyPair(Input.initiatorEphKeyPair);
    initiator.setInitiatorNonce(Input.initiatorNonce);

    // Get the first message and compare it against expected output value.
    final ByteBuf initiatorRq = initiator.firstMessage();
    // assertThat(initiatorRq).isEqualTo(Messages.initiatorMsgPlain);

    // Create the responder handshaker.
    final ECIESHandshaker responder = new ECIESHandshaker();

    // Prepare the handshaker with the responder's keypair.
    responder.prepareResponder(NodeKeyUtils.createFrom(Input.responderKeyPair));

    // Set the test data.
    responder.setEphKeyPair(Input.responderEphKeyPair);
    responder.setResponderNonce(Input.responderNonce);

    // Give the responder the initiator's request. Check that it has a message to send.
    final ByteBuf responderRp =
        responder
            .handleMessage(initiatorRq)
            .orElseThrow(() -> new AssertionError("Expected responder message"));
    assertThat(responder.getPartyEphPubKey()).isEqualTo(initiator.getEphKeyPair().getPublicKey());
    assertThat(responder.getInitiatorNonce()).isEqualTo(initiator.getInitiatorNonce());
    assertThat(responder.partyPubKey()).isEqualTo(initiator.getNodeKey().getPublicKey());

    // Provide that message to the initiator, check that it has nothing to send.
    final Optional<ByteBuf> noMessage = initiator.handleMessage(responderRp);
    assertThat(noMessage).isNotPresent();

    // Ensure that both handshakes are in SUCCESS state.
    assertThat(initiator.getStatus()).isEqualTo(HandshakeStatus.SUCCESS);
    assertThat(responder.getStatus()).isEqualTo(HandshakeStatus.SUCCESS);

    // Compare data across handshakes.
    assertThat(initiator.getPartyEphPubKey()).isEqualTo(responder.getEphKeyPair().getPublicKey());
    assertThat(initiator.getResponderNonce()).isEqualTo(Input.responderNonce);
  }
Test vectors taken from https://gist.github.com/fjl/3a78780d17c755d22df2
ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/handshake/ecies/ECIESHandshakeTest.java