use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testServerSessionApplicationIdChangeMAA.
@Test
public void testServerSessionApplicationIdChangeMAA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((CxDxMessageFactoryImpl) cxdxMessageFactory).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 CxDx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
MultimediaAuthenticationRequest mar = cxdxMessageFactory.createMultimediaAuthenticationRequest();
serverSession.fetchSessionData(mar);
MultimediaAuthenticationAnswer originalMAA = serverSession.createMultimediaAuthenticationAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalMAA);
// now we switch..
originalMAA = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
MultimediaAuthenticationAnswer changedMAA = serverSession.createMultimediaAuthenticationAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedMAA);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method hasDestinationHostMAA.
@Test
public void hasDestinationHostMAA() throws Exception {
serverSession.fetchSessionData(cxdxMessageFactory.createMultimediaAuthenticationRequest());
MultimediaAuthenticationAnswer maa = serverSession.createMultimediaAuthenticationAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", maa.getDestinationHost());
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method isAnswerMAA.
@Test
public void isAnswerMAA() throws Exception {
serverSession.fetchSessionData(cxdxMessageFactory.createMultimediaAuthenticationRequest());
MultimediaAuthenticationAnswer maa = serverSession.createMultimediaAuthenticationAnswer();
assertFalse("Request Flag in Multimedia-Authentication-Answer is set.", maa.getHeader().isRequest());
}
Aggregations