Search in sources :

Example 6 with ConnectionStartBody

use of org.apache.qpid.server.protocol.v0_8.transport.ConnectionStartBody in project qpid-broker-j by apache.

the class AuthenticationTimeoutTest method authenticationTimeout.

@Test
public void authenticationTimeout() throws Exception {
    assumeThat(getBrokerAdmin().isSASLMechanismSupported("PLAIN"), is(true));
    try (FrameTransport transport = new FrameTransport(getBrokerAdmin(), BrokerAdmin.PortType.AMQP).connect()) {
        final Interaction interaction = transport.newInteraction();
        final ConnectionStartBody start = interaction.negotiateProtocol().consumeResponse().getLatestResponse(ConnectionStartBody.class);
        assertThat(Arrays.asList(new String(start.getMechanisms()).split(" ")), hasItem("PLAIN"));
        interaction.connection().startOkMechanism("PLAIN").startOk().consumeResponse(ConnectionSecureBody.class);
        transport.assertNoMoreResponsesAndChannelClosed();
    }
}
Also used : FrameTransport(org.apache.qpid.tests.protocol.v0_8.FrameTransport) Interaction(org.apache.qpid.tests.protocol.v0_8.Interaction) ConnectionStartBody(org.apache.qpid.server.protocol.v0_8.transport.ConnectionStartBody) Test(org.junit.Test)

Aggregations

ConnectionStartBody (org.apache.qpid.server.protocol.v0_8.transport.ConnectionStartBody)6 Test (org.junit.Test)5 SpecificationTest (org.apache.qpid.tests.protocol.SpecificationTest)4 ConnectionSecureBody (org.apache.qpid.server.protocol.v0_8.transport.ConnectionSecureBody)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3 ConnectionTuneBody (org.apache.qpid.server.protocol.v0_8.transport.ConnectionTuneBody)2 ConnectionCloseBody (org.apache.qpid.server.protocol.v0_8.transport.ConnectionCloseBody)1 FrameTransport (org.apache.qpid.tests.protocol.v0_8.FrameTransport)1 Interaction (org.apache.qpid.tests.protocol.v0_8.Interaction)1