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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations