@@ -0,0 +1,2322 @@
+package uk.co.techblue.docusign.client.credential;%0A%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.jboss.resteasy.client.ClientRequest;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport uk.co.techblue.docusign.client.utils.DocuSignConstants;%0A%0Apublic class BasicDocusignCredentialTest %7B%0A%0A    private static final String USERNAME = %22username%22;%0A    private static final String PASSWORD = %22password%22;%0A    private static final String INTERGRATION_KEY = %22intKey%22;%0A    private static final String SEND_ON_BEHALF_OF = %22otherUsername%22;%0A%0A    @Test%0A    public void testSendOnBehalfOf() %7B%0A        BasicDocusignCredential credential = new BasicDocusignCredential(USERNAME, PASSWORD, INTERGRATION_KEY, SEND_ON_BEHALF_OF);%0A        Assert.assertEquals(getCredentialString(true), BasicDocusignCredential.valueOf(credential));%0A    %7D%0A%0A    @Test%0A    public void testValueOf() %7B%0A        BasicDocusignCredential credential = new BasicDocusignCredential(USERNAME, PASSWORD, INTERGRATION_KEY);%0A        Assert.assertEquals(getCredentialString(), BasicDocusignCredential.valueOf(credential));%0A    %7D%0A%0A    @Test%0A    public void testSetHeader() %7B%0A        BasicDocusignCredential credential = new BasicDocusignCredential(USERNAME, PASSWORD, INTERGRATION_KEY);%0A        ClientRequest request = new ClientRequest(%22uriTemplate%22);%0A        // make sure auth header is not set%0A        Assert.assertNull(request.getHeaders().getFirst(DocuSignConstants.HEADER_PARAM_AUTHENTICATION));%0A        credential.setHeader(request);%0A        // verify auth header was set%0A        Assert.assertEquals(getCredentialString(), request.getHeaders().getFirst(DocuSignConstants.HEADER_PARAM_AUTHENTICATION));%0A    %7D%0A%0A    private String getCredentialString() %7B%0A        return getCredentialString(false);%0A    %7D%0A%0A    private String getCredentialString(boolean includeSendOnBehalfOf) %7B%0A        String expected = %22%3CDocuSignCredentials%3E%22%0A                        + %22%3CUsername%3E%22 + USERNAME + %22%3C/Username%3E%22%0A                        + %22%3CPassword%3E%22 + PASSWORD + %22%3C/Password%3E%22%0A                        + %22%3CIntegratorKey%3E%22 + INTERGRATION_KEY + %22%3C/IntegratorKey%3E%22;%0A        if(includeSendOnBehalfOf) %7B%0A                expected += %22%3CSendOnBehalfOf%3E%22 + SEND_ON_BEHALF_OF + %22%3C/SendOnBehalfOf%3E%22;%0A        %7D%0A        expected += %22%3C/DocuSignCredentials%3E%22;%0A        return expected;%0A    %7D%0A%0A%7D%0A

add basic credential test