public void testSuccessfulExchange() throws CryptoException { JPAKEParticipant alice = createAlice(); JPAKEParticipant bob = createBob(); ExchangeAfterRound2Creation exchange = runExchangeUntilRound2Creation(alice, bob); alice.validateRound2PayloadReceived(exchange.bobRound2Payload); bob.validateRound2PayloadReceived(exchange.aliceRound2Payload); BigInteger aliceKeyingMaterial = alice.calculateKeyingMaterial(); BigInteger bobKeyingMaterial = bob.calculateKeyingMaterial(); JPAKERound3Payload aliceRound3Payload = alice.createRound3PayloadToSend(aliceKeyingMaterial); JPAKERound3Payload bobRound3Payload = bob.createRound3PayloadToSend(bobKeyingMaterial); alice.validateRound3PayloadReceived(bobRound3Payload, aliceKeyingMaterial); bob.validateRound3PayloadReceived(aliceRound3Payload, bobKeyingMaterial); assertEquals(aliceKeyingMaterial, bobKeyingMaterial); }