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)); } }
@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); }