### Question:
RequestSigningService { public Signature buildSignature(Map<String, String> headersMap) { return Signature.builder() .keyId(getKeyId()) .headers(headersMap) .privateKey(getPrivateKey()) .build(); } RequestSigningService(Pkcs12KeyStore keyStore); Digest buildDigest(String requestBody); Signature buildSignature(Map<String, String> headersMap); TppSignatureCertificate buildTppSignatureCertificate();  }### Answer:
@Test void buildSignature() throws KeyStoreException, UnsupportedEncodingException, CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException { Map<String, String> headers = new HashMap<>(); headers.put("header", "header"); when(keyStore.getQsealCertificate()).thenReturn(certificate); when(keyStore.getQsealPrivateKey()).thenReturn(generatePrivateKey()); Signature actual = service.buildSignature(headers); verify(keyStore, times(1)).getQsealCertificate(); verify(keyStore, times(1)).getQsealPrivateKey(); assertNotNull(actual); assertEquals("Signature", actual.getHeaderName()); assertTrue(actual.getHeaderValue().contains("keyId=")); assertTrue(actual.getHeaderValue().contains("algorithm=\"SHA256withRSA\"")); }