Search in sources :

Example 6 with UserAuthorizationAnswer

use of net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer in project jain-slee.diameter by RestComm.

the class CxDxFactoriesTest method isProxiableCopiedUAA.

@Test
public void isProxiableCopiedUAA() throws Exception {
    UserAuthorizationRequest uar = cxdxMessageFactory.createUserAuthorizationRequest();
    serverSession.fetchSessionData(uar);
    UserAuthorizationAnswer uaa = serverSession.createUserAuthorizationAnswer();
    assertEquals("The 'P' bit is not copied from request in User-Authorization-Answer, it should. [RFC3588/6.2]", uar.getHeader().isProxiable(), uaa.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) uar).getGenericData().setProxiable(!uar.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in User-Authorization-Request, it should.", uar.getHeader().isProxiable() != uaa.getHeader().isProxiable());
    serverSession.fetchSessionData(uar);
    uaa = serverSession.createUserAuthorizationAnswer();
    assertEquals("The 'P' bit is not copied from request in User-Authorization-Answer, it should. [RFC3588/6.2]", uar.getHeader().isProxiable(), uaa.getHeader().isProxiable());
}
Also used : UserAuthorizationRequest(net.java.slee.resource.diameter.cxdx.events.UserAuthorizationRequest) UserAuthorizationAnswer(net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with UserAuthorizationAnswer

use of net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer in project jain-slee.diameter by RestComm.

the class CxDxFactoriesTest method isAnswerUAA.

@Test
public void isAnswerUAA() throws Exception {
    serverSession.fetchSessionData(cxdxMessageFactory.createUserAuthorizationRequest());
    UserAuthorizationAnswer uaa = serverSession.createUserAuthorizationAnswer();
    assertFalse("Request Flag in Server-Assignment-Answer is set.", uaa.getHeader().isRequest());
}
Also used : UserAuthorizationAnswer(net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 8 with UserAuthorizationAnswer

use of net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer in project jain-slee.diameter by RestComm.

the class CxDxFactoriesTest method hasDestinationHostUAA.

@Test
public void hasDestinationHostUAA() throws Exception {
    serverSession.fetchSessionData(cxdxMessageFactory.createUserAuthorizationRequest());
    UserAuthorizationAnswer uaa = serverSession.createUserAuthorizationAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", uaa.getDestinationHost());
}
Also used : UserAuthorizationAnswer(net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

UserAuthorizationAnswer (net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer)8 Test (org.junit.Test)7 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)7 UserAuthorizationRequest (net.java.slee.resource.diameter.cxdx.events.UserAuthorizationRequest)4 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 ApplicationId (org.jdiameter.api.ApplicationId)1 InternalException (org.jdiameter.api.InternalException)1 CxDxMessageFactoryImpl (org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl)1