use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxServerSessionImpl method createMultimediaAuthenticationAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createMultimediaAuthenticationAnswer()
*/
public MultimediaAuthenticationAnswer createMultimediaAuthenticationAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof MultimediaAuthenticationRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
MultimediaAuthenticationAnswer maa = (MultimediaAuthenticationAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, MultimediaAuthenticationAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(maa);
return maa;
} catch (InternalException e) {
logger.error("Failed to create Multimedia-Authentication-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method hasDestinationRealmMAA.
@Test
public void hasDestinationRealmMAA() 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.getDestinationRealm());
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method hasTFlagSetMAA.
@Test
public void hasTFlagSetMAA() throws Exception {
MultimediaAuthenticationRequest mar = cxdxMessageFactory.createMultimediaAuthenticationRequest();
((DiameterMessageImpl) mar).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Multimedia-Authentication-Request", mar.getHeader().isPotentiallyRetransmitted());
serverSession.fetchSessionData(mar);
MultimediaAuthenticationAnswer maa = serverSession.createMultimediaAuthenticationAnswer();
assertFalse("The 'T' flag should not be set in Multimedia-Authentication-Answer", maa.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method isProxiableCopiedMAA.
@Test
public void isProxiableCopiedMAA() throws Exception {
MultimediaAuthenticationRequest mar = cxdxMessageFactory.createMultimediaAuthenticationRequest();
serverSession.fetchSessionData(mar);
MultimediaAuthenticationAnswer maa = serverSession.createMultimediaAuthenticationAnswer();
assertEquals("The 'P' bit is not copied from request in Multimedia-Authentication-Answer, it should. [RFC3588/6.2]", mar.getHeader().isProxiable(), maa.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) mar).getGenericData().setProxiable(!mar.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Multimedia-Authentication-Request, it should.", mar.getHeader().isProxiable() != maa.getHeader().isProxiable());
serverSession.fetchSessionData(mar);
maa = serverSession.createMultimediaAuthenticationAnswer();
assertEquals("The 'P' bit is not copied from request in Multimedia-Authentication-Answer, it should. [RFC3588/6.2]", mar.getHeader().isProxiable(), maa.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testGettersAndSettersMAA.
@Test
public void testGettersAndSettersMAA() throws Exception {
serverSession.fetchSessionData(cxdxMessageFactory.createMultimediaAuthenticationRequest());
MultimediaAuthenticationAnswer maa = serverSession.createMultimediaAuthenticationAnswer();
int nFailures = CxDxAvpAssistant.INSTANCE.testMethods(maa, MultimediaAuthenticationAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Aggregations