### Question:
Signature { public static Builder builder() { return new Builder(); } private  Signature(String headerValue); static Builder builder(); String getHeaderName(); String getHeaderValue();  }### Answer:
@Test void build_failure_privateKeyIsMissing() { Signature.Builder builder = Signature.builder() .keyId(KEY_ID) .headers(HEADERS_MAP) .signingAlgorithm(signingAlgorithm) .encodingAlgorithm(encodingAlgorithm) .charset(UTF8_CHARSET); Assertions.assertThrows(HttpRequestSigningException.class, builder::build); }
@Test void build_failure_keyIdIsMissing() { Signature.Builder builder = Signature.builder() .headers(HEADERS_MAP) .signingAlgorithm(signingAlgorithm) .encodingAlgorithm(encodingAlgorithm) .charset(UTF8_CHARSET) .privateKey(privateKey); Assertions.assertThrows(HttpRequestSigningException.class, builder::build); }
@Test void build_failure_headersAreMissing() { Signature.Builder builder = Signature.builder() .keyId(KEY_ID) .signingAlgorithm(signingAlgorithm) .encodingAlgorithm(encodingAlgorithm) .charset(UTF8_CHARSET) .privateKey(privateKey); Assertions.assertThrows(HttpRequestSigningException.class, builder::build); }
@Test void build_failure_signingAlgorithmIsMissing() { Signature.Builder builder = Signature.builder() .keyId(KEY_ID) .headers(HEADERS_MAP) .signingAlgorithm(null) .encodingAlgorithm(encodingAlgorithm) .charset(UTF8_CHARSET) .privateKey(privateKey); Assertions.assertThrows(HttpRequestSigningException.class, builder::build); }