Esempio n. 1
0
  private void testException() throws Exception {
    ToHeaderValidator validator = new ToHeaderValidator();
    validator.sipUtils = sipUtils;

    try {
      validator.validateRequest(requestEvent);
      fail();
    } catch (RequestException ex) {
      assertEquals(ex.getErrorCode(), new Integer(Response.NOT_FOUND));
    }
  }
Esempio n. 2
0
  @Test
  public void testValidate() throws Exception {
    when(toAddressURI.isSipURI()).thenReturn(true);
    when(toAddressURI.getHost()).thenReturn("domain1.org");
    when(requestURI.getHost()).thenReturn("domain1.org");

    ToHeaderValidator validator = new ToHeaderValidator();
    validator.sipUtils = sipUtils;
    validator.validateRequest(requestEvent);

    assertTrue(true);
  }