Search in sources :

Example 1 with GqAAAnswer

use of net.java.slee.resource.diameter.gq.events.GqAAAnswer in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method hasDestinationHostAAA.

@Test
public void hasDestinationHostAAA() throws Exception {
    GqAAAnswer aaa = gqServerSession.createGqAAAnswer(gqMessageFactory.createGqAARequest());
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", aaa.getDestinationHost());
}
Also used : GqAAAnswer(net.java.slee.resource.diameter.gq.events.GqAAAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 2 with GqAAAnswer

use of net.java.slee.resource.diameter.gq.events.GqAAAnswer in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method hasTFlagSetAAA.

@Test
public void hasTFlagSetAAA() throws Exception {
    GqAARequest aar = gqMessageFactory.createGqAARequest();
    ((DiameterMessageImpl) aar).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in AA-Request", aar.getHeader().isPotentiallyRetransmitted());
    GqAAAnswer aaa = gqMessageFactory.createGqAAAnswer(aar);
    assertFalse("The 'T' flag should not be set in AA-Answer", aaa.getHeader().isPotentiallyRetransmitted());
}
Also used : GqAARequest(net.java.slee.resource.diameter.gq.events.GqAARequest) GqAAAnswer(net.java.slee.resource.diameter.gq.events.GqAAAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 3 with GqAAAnswer

use of net.java.slee.resource.diameter.gq.events.GqAAAnswer in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method isAnswerAAA.

// AA-Answer
@Test
public void isAnswerAAA() throws Exception {
    GqAAAnswer aaa = gqServerSession.createGqAAAnswer(gqMessageFactory.createGqAARequest());
    assertFalse("Request Flag in AA-Answer is set.", aaa.getHeader().isRequest());
}
Also used : GqAAAnswer(net.java.slee.resource.diameter.gq.events.GqAAAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with GqAAAnswer

use of net.java.slee.resource.diameter.gq.events.GqAAAnswer in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method testMessageFactoryApplicationIdChangeAAA.

@Test
public void testMessageFactoryApplicationIdChangeAAA() throws Exception {
    long vendor = 10415L;
    ApplicationId originalAppId = ((GqMessageFactoryImpl) gqMessageFactory).getApplicationId();
    boolean isAuth = originalAppId.getAuthAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
    boolean isAcct = originalAppId.getAcctAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
    boolean isVendor = originalAppId.getVendorId() != 0L;
    assertTrue("Invalid Application-Id (" + originalAppId + "). Should only, and at least, contain either Auth or Acct value.", (isAuth && !isAcct) || (!isAuth && isAcct));
    System.out.println("Default VENDOR-ID for Gq is " + originalAppId.getVendorId());
    // let's create a message and see how it comes...
    GqAAAnswer originalAAA = gqMessageFactory.createGqAAAnswer(gqMessageFactory.createGqAARequest());
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalAAA);
    // now we switch..
    originalAAA = null;
    isVendor = !isVendor;
    ((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
    // create a new message and see how it comes...
    GqAAAnswer changedAAA = gqMessageFactory.createGqAAAnswer(gqMessageFactory.createGqAARequest());
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedAAA);
    // revert back to default
    ((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Also used : GqMessageFactoryImpl(org.mobicents.slee.resource.diameter.gq.GqMessageFactoryImpl) GqAAAnswer(net.java.slee.resource.diameter.gq.events.GqAAAnswer) ApplicationId(org.jdiameter.api.ApplicationId) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with GqAAAnswer

use of net.java.slee.resource.diameter.gq.events.GqAAAnswer in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method hasDestinationRealmAAA.

@Test
public void hasDestinationRealmAAA() throws Exception {
    GqAAAnswer aaa = gqServerSession.createGqAAAnswer(gqMessageFactory.createGqAARequest());
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", aaa.getDestinationRealm());
}
Also used : GqAAAnswer(net.java.slee.resource.diameter.gq.events.GqAAAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

GqAAAnswer (net.java.slee.resource.diameter.gq.events.GqAAAnswer)8 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 GqAARequest (net.java.slee.resource.diameter.gq.events.GqAARequest)2 ApplicationId (org.jdiameter.api.ApplicationId)1 GqMessageFactoryImpl (org.mobicents.slee.resource.diameter.gq.GqMessageFactoryImpl)1