use of org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method hasTFlagSetCCA.
@Test
public void hasTFlagSetCCA() throws Exception {
GxCreditControlRequest ccr = gxMessageFactory.createGxCreditControlRequest();
((DiameterMessageImpl) ccr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Credit-Control-Request", ccr.getHeader().isPotentiallyRetransmitted());
((GxServerSessionActivityImpl) gxServerSession).fetchCurrentState(ccr);
GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
assertFalse("The 'T' flag should not be set in Credit-Control-Answer", cca.getHeader().isPotentiallyRetransmitted());
}
use of org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method isProxiableCopiedCCA.
@Test
public void isProxiableCopiedCCA() throws Exception {
GxCreditControlRequest ccr = gxMessageFactory.createGxCreditControlRequest();
((GxServerSessionActivityImpl) gxServerSession).fetchCurrentState(ccr);
GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
assertEquals("The 'P' bit is not copied from request in Credit-Control-Answer, it should. [RFC3588/6.2]", ccr.getHeader().isProxiable(), cca.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) ccr).getGenericData().setProxiable(!ccr.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Credit-Control-Request, it should.", ccr.getHeader().isProxiable() != cca.getHeader().isProxiable());
((GxServerSessionActivityImpl) gxServerSession).fetchCurrentState(ccr);
cca = gxServerSession.createGxCreditControlAnswer();
assertEquals("The 'P' bit is not copied from request in Credit-Control-Answer, it should. [RFC3588/6.2]", ccr.getHeader().isProxiable(), cca.getHeader().isProxiable());
}
Aggregations