use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method hasDestinationRealmCCA.
@Test
public void hasDestinationRealmCCA() throws Exception {
GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", cca.getDestinationRealm());
}
use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer 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 net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method hasGxApplicationIdCCA.
@Test
public void hasGxApplicationIdCCA() throws Exception {
GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
assertTrue("Auth-Application-Id AVP in Gx CCA must be 16777224, it is " + cca.getAuthApplicationId(), cca.getAuthApplicationId() == 16777224);
}
use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer 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());
}
use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method isAnswerCCA.
@Test
public void isAnswerCCA() throws Exception {
GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
assertFalse("Request Flag in Credit-Control-Answer is set.", cca.getHeader().isRequest());
}
Aggregations