TokenBindingHeaderPreparator extends Preparator<TokenBindingHeader> { @Override public void prepare() { header.setHeaderName("Sec-Token-Binding"); TokenBindingMessagePreparator preparator = new TokenBindingMessagePreparator(chooser, header.getMessage()); preparator.prepare(); TokenBindingMessageSerializer serializer = new TokenBindingMessageSerializer(header.getMessage(), chooser.getSelectedProtocolVersion()); String encodedTokenBinding = Base64.getUrlEncoder().withoutPadding().encodeToString(serializer.serialize()); header.setHeaderValue(encodedTokenBinding); } TokenBindingHeaderPreparator(Chooser chooser, TokenBindingHeader header); @Override void prepare();  }
@Test public void testPrepare() { preparator.prepare(); assertEquals(header.getHeaderName().getValue(), "Sec-Token-Binding"); assertEquals( header.getHeaderValue().getValue(), "AIkAAgBBQF7L5NGmMwpEyPfvlR1L8WXmxrch762phftBZhvG5_1shzRkDEmY_343SwbOGmSi7NgqsDY4T7g9mnmxJ6J9UDIAQBiMGdH7awDozrs8wPI2pfRAqtPX2vx3LTNCmY-9ngpdWHu9GFxflmo9jN0yKR1IxnVNtU-85XOUEwjlYaPYUJMAAA"); }