Search in sources :

Example 1 with ReAuthAnswer

use of net.java.slee.resource.diameter.base.events.ReAuthAnswer in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method isAnswerRAA.

@Test
public void isAnswerRAA() throws Exception {
    ReAuthAnswer raa = messageFactory.createReAuthAnswer(messageFactory.createReAuthRequest());
    assertFalse("Request Flag in Re-Auth-Answer is set.", raa.getHeader().isRequest());
}
Also used : ReAuthAnswer(net.java.slee.resource.diameter.base.events.ReAuthAnswer) Test(org.junit.Test)

Example 2 with ReAuthAnswer

use of net.java.slee.resource.diameter.base.events.ReAuthAnswer in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method hasDestinationRealmRAA.

@Test
public void hasDestinationRealmRAA() throws Exception {
    ReAuthAnswer raa = messageFactory.createReAuthAnswer(messageFactory.createReAuthRequest());
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", raa.getDestinationRealm());
}
Also used : ReAuthAnswer(net.java.slee.resource.diameter.base.events.ReAuthAnswer) Test(org.junit.Test)

Example 3 with ReAuthAnswer

use of net.java.slee.resource.diameter.base.events.ReAuthAnswer in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method isProxiableCopiedRAA.

@Test
public void isProxiableCopiedRAA() throws Exception {
    ReAuthRequest asr = messageFactory.createReAuthRequest();
    ReAuthAnswer asa = messageFactory.createReAuthAnswer(asr);
    assertEquals("The 'P' bit is not copied from request in Re-Auth-Answer, it should. [RFC3588/6.2]", asr.getHeader().isProxiable(), asa.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) asr).getGenericData().setProxiable(!asr.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Re-Auth-Request, it should.", asr.getHeader().isProxiable() != asa.getHeader().isProxiable());
    asa = messageFactory.createReAuthAnswer(asr);
    assertEquals("The 'P' bit is not copied from request in Re-Auth-Answer, it should. [RFC3588/6.2]", asr.getHeader().isProxiable(), asa.getHeader().isProxiable());
}
Also used : ReAuthRequest(net.java.slee.resource.diameter.base.events.ReAuthRequest) ReAuthAnswer(net.java.slee.resource.diameter.base.events.ReAuthAnswer) Test(org.junit.Test)

Example 4 with ReAuthAnswer

use of net.java.slee.resource.diameter.base.events.ReAuthAnswer in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method hasDestinationHostRAA.

@Test
public void hasDestinationHostRAA() throws Exception {
    ReAuthAnswer raa = messageFactory.createReAuthAnswer(messageFactory.createReAuthRequest());
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", raa.getDestinationHost());
}
Also used : ReAuthAnswer(net.java.slee.resource.diameter.base.events.ReAuthAnswer) Test(org.junit.Test)

Example 5 with ReAuthAnswer

use of net.java.slee.resource.diameter.base.events.ReAuthAnswer in project jain-slee.diameter by RestComm.

the class AuthClientSessionActivityImpl method sendReAuthAnswer.

public void sendReAuthAnswer(ReAuthAnswer answer) throws IOException {
    try {
        // super.sendMessage(answer);
        DiameterMessageImpl msg = (DiameterMessageImpl) answer;
        this.clientSession.sendReAuthAnswer(new ReAuthAnswerImpl((Answer) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        throw new IOException("Failed to send message, due to: " + e.getMessage());
    }
}
Also used : ReAuthAnswer(net.java.slee.resource.diameter.base.events.ReAuthAnswer) AbortSessionAnswer(net.java.slee.resource.diameter.base.events.AbortSessionAnswer) Answer(org.jdiameter.api.Answer) ReAuthAnswerImpl(org.jdiameter.common.impl.app.auth.ReAuthAnswerImpl) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Aggregations

ReAuthAnswer (net.java.slee.resource.diameter.base.events.ReAuthAnswer)8 Test (org.junit.Test)6 ReAuthRequest (net.java.slee.resource.diameter.base.events.ReAuthRequest)2 IOException (java.io.IOException)1 AbortSessionAnswer (net.java.slee.resource.diameter.base.events.AbortSessionAnswer)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 Answer (org.jdiameter.api.Answer)1 ReAuthAnswerImpl (org.jdiameter.common.impl.app.auth.ReAuthAnswerImpl)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1