Search in sources :

Example 6 with NotifyRequest

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

the class S6aFactoriesTest method hasTFlagSetNOA.

@Test
public void hasTFlagSetNOA() throws Exception {
    NotifyRequest nor = s6aMessageFactory.createNotifyRequest();
    ((DiameterMessageImpl) nor).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Notify-Request", nor.getHeader().isPotentiallyRetransmitted());
    serverSession.fetchSessionData(nor);
    NotifyAnswer noa = serverSession.createNotifyAnswer();
    assertFalse("The 'T' flag should not be set in Notify-Answer", noa.getHeader().isPotentiallyRetransmitted());
}
Also used : NotifyRequest(net.java.slee.resource.diameter.s6a.events.NotifyRequest) NotifyAnswer(net.java.slee.resource.diameter.s6a.events.NotifyAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with NotifyRequest

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

the class S6aFactoriesTest method hasDestinationHostNOA.

@Test
public void hasDestinationHostNOA() throws Exception {
    NotifyRequest nor = s6aMessageFactory.createNotifyRequest();
    serverSession.fetchSessionData(nor);
    NotifyAnswer noa = serverSession.createNotifyAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", noa.getDestinationHost());
}
Also used : NotifyRequest(net.java.slee.resource.diameter.s6a.events.NotifyRequest) NotifyAnswer(net.java.slee.resource.diameter.s6a.events.NotifyAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 8 with NotifyRequest

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

the class S6aFactoriesTest method isProxiableCopiedNOA.

@Test
public void isProxiableCopiedNOA() throws Exception {
    NotifyRequest nor = s6aMessageFactory.createNotifyRequest();
    serverSession.fetchSessionData(nor);
    NotifyAnswer noa = serverSession.createNotifyAnswer();
    assertEquals("The 'P' bit is not copied from request in Location-Info-Answer, it should. [RFC3588/6.2]", nor.getHeader().isProxiable(), noa.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) nor).getGenericData().setProxiable(!nor.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Notify-Request, it should.", nor.getHeader().isProxiable() != noa.getHeader().isProxiable());
    serverSession.fetchSessionData(nor);
    noa = serverSession.createNotifyAnswer();
    assertEquals("The 'P' bit is not copied from request in Notify-Answer, it should. [RFC3588/6.2]", nor.getHeader().isProxiable(), noa.getHeader().isProxiable());
}
Also used : NotifyRequest(net.java.slee.resource.diameter.s6a.events.NotifyRequest) NotifyAnswer(net.java.slee.resource.diameter.s6a.events.NotifyAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 9 with NotifyRequest

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

the class S6aMessageFactoryImpl method createNotifyRequest.

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

Example 10 with NotifyRequest

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

the class S6aFactoriesTest method isProxiableNOR.

@Test
public void isProxiableNOR() throws Exception {
    NotifyRequest nor = s6aMessageFactory.createNotifyRequest();
    assertTrue("The 'P' bit is not set by default in Notify-Request it should.", nor.getHeader().isProxiable());
}
Also used : NotifyRequest(net.java.slee.resource.diameter.s6a.events.NotifyRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

NotifyRequest (net.java.slee.resource.diameter.s6a.events.NotifyRequest)13 Test (org.junit.Test)11 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)11 NotifyAnswer (net.java.slee.resource.diameter.s6a.events.NotifyAnswer)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