use of net.java.slee.resource.diameter.gx.events.GxReAuthAnswer in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method testMessageFactoryApplicationIdChangeInClientSessionRAA.
@Test
public void testMessageFactoryApplicationIdChangeInClientSessionRAA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((GxMessageFactoryImpl) gxMessageFactory).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 Gx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
GxReAuthAnswer originalRAA = gxClientSession.createGxReAuthAnswer(gxMessageFactory.createGxReAuthRequest());
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalRAA);
// now we switch..
originalRAA = null;
isVendor = !isVendor;
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
GxReAuthAnswer changedRAA = gxClientSession.createGxReAuthAnswer(gxMessageFactory.createGxReAuthRequest());
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedRAA);
// revert back to default
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.gx.events.GxReAuthAnswer in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method isAnswerRAA.
@Test
public void isAnswerRAA() throws Exception {
GxReAuthAnswer raa = gxClientSession.createGxReAuthAnswer(gxMessageFactory.createGxReAuthRequest());
assertFalse("Request Flag in Gx Re-Auth-Answer is set.", raa.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.gx.events.GxReAuthAnswer in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method hasTFlagSetRAA.
@Test
public void hasTFlagSetRAA() throws Exception {
GxReAuthRequest rar = gxMessageFactory.createGxReAuthRequest();
((DiameterMessageImpl) rar).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Re-Auth-Request", rar.getHeader().isPotentiallyRetransmitted());
GxReAuthAnswer raa = gxClientSession.createGxReAuthAnswer(rar);
assertFalse("The 'T' flag should not be set in Re-Auth-Answer", raa.getHeader().isPotentiallyRetransmitted());
}
Aggregations