Commit 04c94da1 authored by Jason Song's avatar Jason Song

fix the tests to run against jdk7

parent 9f1264f2
package com.ctrip.framework.apollo.core.signature;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
......@@ -17,6 +17,6 @@ public class HmacSha1UtilsTest {
String actualSignature = HmacSha1Utils.signString(stringToSign, accessKeySecret);
String expectedSignature = "EoKyziXvKqzHgwx+ijDJwgVTDgE=";
assertThat(actualSignature).isEqualTo(expectedSignature);
assertEquals(expectedSignature, actualSignature);
}
}
\ No newline at end of file
package com.ctrip.framework.apollo.core.signature;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Map;
import org.junit.Test;
......@@ -19,7 +20,7 @@ public class SignatureTest {
String actualSignature = Signature.signature(timestamp, pathWithQuery, secret);
String expectedSignature = "EoKyziXvKqzHgwx+ijDJwgVTDgE=";
assertThat(actualSignature).isEqualTo(expectedSignature);
assertEquals(expectedSignature, actualSignature);
}
@Test
......@@ -30,7 +31,7 @@ public class SignatureTest {
Map<String, String> actualHttpHeaders = Signature.buildHttpHeaders(url, appId, secret);
assertThat(actualHttpHeaders)
.containsKeys(Signature.HTTP_HEADER_AUTHORIZATION, Signature.HTTP_HEADER_TIMESTAMP);
assertTrue(actualHttpHeaders.containsKey(Signature.HTTP_HEADER_AUTHORIZATION));
assertTrue(actualHttpHeaders.containsKey(Signature.HTTP_HEADER_TIMESTAMP));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment