SaajUtils { public static int getSaajVersion() { return saajVersion; }  static int getSaajVersion(); static int getSaajVersion(SOAPMessage soapMessage); static int getSaajVersion(SOAPElement soapElement); static String getSaajVersionString(); static Name toName(QName qName, SOAPElement resolveElement); static QName toQName(Name name); static SOAPMessage loadMessage(Resource resource, MessageFactory messageFactory); static SOAPEnvelope getEnvelope(SOAPElement element); static SOAPElement getFirstBodyElement(SOAPBody body); static final int SAAJ_11; static final int SAAJ_12; static final int SAAJ_13; }
@Test public void testGetSaajVersion() throws Exception { Assert.assertEquals("Invalid SAAJ version", SaajUtils.SAAJ_13, SaajUtils.getSaajVersion()); }
@Test(expected = SOAPException.class) public void testGetSaajVersionInvalidEnvelope() throws Exception { Resource resource = new ClassPathResource("invalidNamespaceReferenceSoapMessage.xml", getClass()); InputStream in = resource.getInputStream(); MimeHeaders headers = new MimeHeaders(); SOAPMessage soapMessage = messageFactory.createMessage(headers, in); SaajUtils.getSaajVersion(soapMessage); }