Esempio n. 1
0
  @Test
  public void testCreateCanonicalHeaders() {
    Map<String, String> headers = new HashMap<String, String>();
    headers.put("Content-Type", " application/json ");
    headers.put("Host", "http://localhost");

    String result = SignUtil.createCanonicalHeaders(headers);
    assertThat(result, is("content-type:application/json\nhost:http://localhost"));
  }
Esempio n. 2
0
 @Test
 public void testCreateCanonicalHeaders_withEmptyMap() {
   assertThat(SignUtil.createCanonicalHeaders(null), is(""));
   assertThat(SignUtil.createCanonicalHeaders(new HashMap<String, String>()), is(""));
 }