NtlmState state = new NtlmState();
Element ntlmssp_challenge = new ServerNtlmsspChallenge("ntlmssp_challenge", state);
Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers());
Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));
Pipeline pipeline = new PipelineImpl("test");
pipeline.add(source, ntlmssp_challenge, sink, mainSink);
pipeline.link("source", "ntlmssp_challenge", "mainSink");
pipeline.link("ntlmssp_challenge >" + OTOUT, "sink");
pipeline.runMainLoop("source", STDOUT, false, false);
// Check state challenge
byte[] challenge = new byte[] {0x52, (byte)0xbe, (byte)0x83, (byte)0xd1, (byte)0xf8, (byte)0x80, 0x16, 0x6a};
if (state.serverChallenge == null)
throw new RuntimeException("Challenge was not extracted from server NTLMSSP Challenge packet.");