Search in sources :

Example 1 with InsertSubscriberDataRequest

use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.

the class S6aMessageFactoryImpl method createInsertSubscriberDataRequest.

public InsertSubscriberDataRequest createInsertSubscriberDataRequest(String sessionId) throws IllegalArgumentException {
    InsertSubscriberDataRequest idr = createInsertSubscriberDataRequest();
    idr.setSessionId(sessionId);
    return idr;
}
Also used : InsertSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest)

Example 2 with InsertSubscriberDataRequest

use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest 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());
}
Also used : InsertSubscriberDataAnswer(net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer) InsertSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 3 with InsertSubscriberDataRequest

use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method testMessageFactoryApplicationIdChangeIDR.

@Test
public void testMessageFactoryApplicationIdChangeIDR() throws Exception {
    long vendor = 10415L;
    ApplicationId originalAppId = ((S6aMessageFactoryImpl) s6aMessageFactory).getApplicationId();
    boolean isAuth = originalAppId.getAuthAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
    boolean isAcct = originalAppId.getAcctAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
    boolean isVendor = originalAppId.getVendorId() != 0L;
    assertTrue("Invalid Application-Id (" + originalAppId + "). Should only, and at least, contain either Auth or Acct value.", (isAuth && !isAcct) || (!isAuth && isAcct));
    System.out.println("Default VENDOR-ID for S6a is " + originalAppId.getVendorId());
    // let's create a message and see how it comes...
    InsertSubscriberDataRequest originalIDR = s6aMessageFactory.createInsertSubscriberDataRequest();
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalIDR);
    // now we switch..
    originalIDR = null;
    isVendor = !isVendor;
    ((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
    // create a new message and see how it comes...
    InsertSubscriberDataRequest changedIDR = s6aMessageFactory.createInsertSubscriberDataRequest();
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedIDR);
    // revert back to default
    ((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Also used : InsertSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest) S6aMessageFactoryImpl(org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl) ApplicationId(org.jdiameter.api.ApplicationId) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with InsertSubscriberDataRequest

use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method isRequestIDR.

@Test
public void isRequestIDR() throws Exception {
    InsertSubscriberDataRequest idr = s6aMessageFactory.createInsertSubscriberDataRequest();
    assertTrue("Request Flag in Insert-Subscriber-Data-Request is not set.", idr.getHeader().isRequest());
}
Also used : InsertSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with InsertSubscriberDataRequest

use of net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest 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());
}
Also used : InsertSubscriberDataAnswer(net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer) InsertSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

InsertSubscriberDataRequest (net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataRequest)13 Test (org.junit.Test)11 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)11 InsertSubscriberDataAnswer (net.java.slee.resource.diameter.s6a.events.InsertSubscriberDataAnswer)8 ApplicationId (org.jdiameter.api.ApplicationId)2 S6aMessageFactoryImpl (org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl)2 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 InternalException (org.jdiameter.api.InternalException)1