use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasTFlagSetIDA.
@Test
public void hasTFlagSetIDA() throws Exception {
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
((DiameterMessageImpl) idr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Insert-Subscriber-Data-Request", idr.getHeader().isPotentiallyRetransmitted());
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer ida = clientSession.createInsertSubscriberDataAnswer();
assertFalse("The 'T' flag should not be set in Insert-Subscriber-Data-Answer", ida.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationRealmIDA.
@Test
public void hasDestinationRealmIDA() throws Exception {
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer ida = clientSession.createInsertSubscriberDataAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", ida.getDestinationRealm());
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testClientSessionApplicationIdChangeIDA.
@Test
public void testClientSessionApplicationIdChangeIDA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((S6aMessageFactoryImpl) s6aMessageFactory).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 S6a is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer originalIDA = clientSession.createInsertSubscriberDataAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalIDA);
// now we switch..
originalIDA = null;
isVendor = !isVendor;
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
InsertSubscriberDataAnswer changedIDA = clientSession.createInsertSubscriberDataAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedIDA);
// revert back to default
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Aggregations