use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isProxiableCopiedIDA.
@Test
public void isProxiableCopiedIDA() throws Exception {
InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
clientSession.fetchSessionData(idr);
InsertSubscriberDataAnswer ida = clientSession.createInsertSubscriberDataAnswer();
assertEquals("The 'P' bit is not copied from request in Location-Info-Answer, it should. [RFC3588/6.2]", idr.getHeader().isProxiable(), ida.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) idr).getGenericData().setProxiable(!idr.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Insert-Subscriber-Data-Request, it should.", idr.getHeader().isProxiable() != ida.getHeader().isProxiable());
clientSession.fetchSessionData(idr);
ida = clientSession.createInsertSubscriberDataAnswer();
assertEquals("The 'P' bit is not copied from request in Insert-Subscriber-Data-Answer, it should. [RFC3588/6.2]", idr.getHeader().isProxiable(), ida.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationHostIDA.
@Test
public void hasDestinationHostIDA() 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.getDestinationHost());
}
use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer 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.InsertSubscriberDataAnswer 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.InsertSubscriberDataAnswer 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);
}
Aggregations