@Test
  public void generateHeaderStrategyForSubjectTest() throws Exception {
    SignatureCredential signatureCredential =
        new SignatureCredential("testusername", "testpassword", "testsignature");
    SignatureSOAPHeaderAuthStrategy signatureSOAPHeaderAuthStrategy =
        new SignatureSOAPHeaderAuthStrategy();
    SubjectAuthorization subjectAuthorization = new SubjectAuthorization("testsubject");
    signatureSOAPHeaderAuthStrategy.setThirdPartyAuthorization(subjectAuthorization);
    signatureCredential.setThirdPartyAuthorization(subjectAuthorization);
    String payload = signatureSOAPHeaderAuthStrategy.generateHeaderStrategy(signatureCredential);

    Document dom = loadXMLFromString(payload);
    Element docEle = dom.getDocumentElement();
    NodeList credential = docEle.getElementsByTagName("ebl:Credentials");
    NodeList user = ((Element) credential.item(0)).getElementsByTagName("ebl:Username");
    NodeList psw = ((Element) credential.item(0)).getElementsByTagName("ebl:Password");
    NodeList sign = ((Element) credential.item(0)).getElementsByTagName("ebl:Signature");
    NodeList subject = ((Element) credential.item(0)).getElementsByTagName("ebl:Subject");

    String username = user.item(0).getTextContent();
    String password = psw.item(0).getTextContent();
    String signature = sign.item(0).getTextContent();
    String sub = subject.item(0).getTextContent();

    Assert.assertEquals("testusername", username);
    Assert.assertEquals("testpassword", password);
    Assert.assertEquals("testsignature", signature);
    Assert.assertEquals("testsubject", sub);
  }
 @Test
 public void generateHeaderStrategyForTokenTest() throws Exception {
   SignatureCredential signatureCredential =
       new SignatureCredential("testusername", "testpassword", "testsignature");
   SignatureSOAPHeaderAuthStrategy signatureSOAPHeaderAuthStrategy =
       new SignatureSOAPHeaderAuthStrategy();
   TokenAuthorization tokenAuthorization = new TokenAuthorization("accessToken", "tokenSecret");
   signatureSOAPHeaderAuthStrategy.setThirdPartyAuthorization(tokenAuthorization);
   signatureCredential.setThirdPartyAuthorization(tokenAuthorization);
   String payload = signatureSOAPHeaderAuthStrategy.generateHeaderStrategy(signatureCredential);
   Assert.assertEquals("<ns:RequesterCredentials/>", payload);
 }