示例#1
0
  @Test
  public void testDifferentURIs() throws Exception {
    when(toAddressURI.isSipURI()).thenReturn(true);
    when(toAddressURI.getHost()).thenReturn("domain1.org");
    when(requestURI.getHost()).thenReturn("domain2.org");

    testException();
  }
示例#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);
  }
示例#3
0
  @Test
  public void testBadAddressUri() throws Exception {
    when(toAddressURI.isSipURI()).thenReturn(false);

    testException();
  }