use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isProxiableULR.
@Test
public void isProxiableULR() throws Exception {
UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
assertTrue("The 'P' bit is not set by default in Update-Location-Request it should.", ulr.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testMessageFactoryApplicationIdChangeULR.
@Test
public void testMessageFactoryApplicationIdChangeULR() 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...
UpdateLocationRequest originalULR = s6aMessageFactory.createUpdateLocationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalULR);
// now we switch..
originalULR = null;
isVendor = !isVendor;
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
UpdateLocationRequest changedULR = s6aMessageFactory.createUpdateLocationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedULR);
// revert back to default
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testServerSessionApplicationIdChangeULA.
@Test
public void testServerSessionApplicationIdChangeULA() 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...
UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
serverSession.fetchSessionData(ulr);
UpdateLocationAnswer originalULA = serverSession.createUpdateLocationAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalULA);
// now we switch..
originalULA = null;
isVendor = !isVendor;
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
UpdateLocationAnswer changedULA = serverSession.createUpdateLocationAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedULA);
// revert back to default
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationHostULA.
@Test
public void hasDestinationHostULA() throws Exception {
UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
serverSession.fetchSessionData(ulr);
UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", ula.getDestinationHost());
}
Aggregations