Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apollo
Commits
04c94da1
Commit
04c94da1
authored
Mar 15, 2020
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the tests to run against jdk7
parent
9f1264f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
apollo-core/src/test/java/com/ctrip/framework/apollo/core/signature/HmacSha1UtilsTest.java
...ip/framework/apollo/core/signature/HmacSha1UtilsTest.java
+2
-2
apollo-core/src/test/java/com/ctrip/framework/apollo/core/signature/SignatureTest.java
.../ctrip/framework/apollo/core/signature/SignatureTest.java
+5
-4
No files found.
apollo-core/src/test/java/com/ctrip/framework/apollo/core/signature/HmacSha1UtilsTest.java
View file @
04c94da1
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="
;
assert
That
(
actualSignature
).
isEqualTo
(
expected
Signature
);
assert
Equals
(
expectedSignature
,
actual
Signature
);
}
}
\ No newline at end of file
apollo-core/src/test/java/com/ctrip/framework/apollo/core/signature/SignatureTest.java
View file @
04c94da1
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="
;
assert
That
(
actualSignature
).
isEqualTo
(
expected
Signature
);
assert
Equals
(
expectedSignature
,
actual
Signature
);
}
@Test
...
...
@@ -30,7 +31,7 @@ public class SignatureTest {
Map
<
String
,
String
>
actualHttpHeaders
=
Signature
.
buildHttpHeaders
(
url
,
appId
,
secret
);
assertT
hat
(
actualHttpHeaders
)
.
containsKeys
(
Signature
.
HTTP_HEADER_AUTHORIZATION
,
Signature
.
HTTP_HEADER_TIMESTAMP
);
assertT
rue
(
actualHttpHeaders
.
containsKey
(
Signature
.
HTTP_HEADER_AUTHORIZATION
));
assertTrue
(
actualHttpHeaders
.
containsKey
(
Signature
.
HTTP_HEADER_TIMESTAMP
)
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment