use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isAnswerIDA.
@Test
public void isAnswerIDA() throws Exception {
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer ida = clientSession.createInsertSubscriberDataAnswer();
assertFalse("Request Flag in Insert-Subscriber-Data-Answer is set.", ida.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.
the class S6aClientSessionImpl method createInsertSubscriberDataAnswer.
public InsertSubscriberDataAnswer createInsertSubscriberDataAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof InsertSubscriberDataRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
InsertSubscriberDataAnswer ida = (InsertSubscriberDataAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, InsertSubscriberDataAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(ida);
return ida;
} catch (InternalException e) {
logger.error("Failed to create Insert-Subscriber-Data-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testGettersAndSettersIDA.
@Test
public void testGettersAndSettersIDA() throws Exception {
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer ida = clientSession.createInsertSubscriberDataAnswer();
int nFailures = S6aAvpAssistant.INSTANCE.testMethods(ida, InsertSubscriberDataAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasTFlagSetIDA.
@Test
public void hasTFlagSetIDA() throws Exception {
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
((DiameterMessageImpl) idr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Insert-Subscriber-Data-Request", idr.getHeader().isPotentiallyRetransmitted());
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer ida = clientSession.createInsertSubscriberDataAnswer();
assertFalse("The 'T' flag should not be set in Insert-Subscriber-Data-Answer", ida.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationRealmIDA.
@Test
public void hasDestinationRealmIDA() throws Exception {
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer ida = clientSession.createInsertSubscriberDataAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", ida.getDestinationRealm());
}
Aggregations