NetStorageCmsSigner { public Map<String, String> computeHeaders() { final Map<String, String> headers = new HashMap<String, String>(3); final String action = getActionHeaderValue(); final String authData = getAuthDataHeaderValue(); final String authSign = getAuthSignHeaderValue(action, authData); headers.put(NetStorageCmsSigner.ACTION_HEADER, action); headers.put(NetStorageCmsSigner.AUTH_DATA_HEADER, authData); headers.put(NetStorageCmsSigner.AUTH_SIGN_HEADER, authSign); return headers; } NetStorageCmsSigner(URI uri, String nonce, String accessToken, NetStorageAction action);  NetStorageCmsSigner(URI uri, String nonce, String accessToken, NetStorageAction action, SignType signVersion); SignType getSignVersion(); void setSignVersion(SignType signVersion); Map<String, String> computeHeaders();  }
@Test public void vaidateDataAndSignHeader() throws URISyntaxException { URI uri = new URI("http: NetStorageAction action = new NetStorageAction("du"); NetStorageCmsSigner signer = new NetStorageCmsSigner(uri, "myNonce", "accessToken", action) { @Override protected String getAuthDataHeaderValue() { return "much auth value"; } }; Map<String, String> headers = signer.computeHeaders(); String sign = headers.get(NetStorageCmsSigner.AUTH_SIGN_HEADER); assertEquals("w8k5LZTRNKubFvWIqUEgcTrDZhPCo48PeHX45zxSlBU=", sign); }