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
f7b062c5
Commit
f7b062c5
authored
Mar 15, 2020
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust test case timeout
parent
794e5011
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/AccessKeyServiceWithCacheTest.java
.../configservice/service/AccessKeyServiceWithCacheTest.java
+6
-6
No files found.
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/AccessKeyServiceWithCacheTest.java
View file @
f7b062c5
...
...
@@ -19,7 +19,7 @@ import org.mockito.junit.MockitoJUnitRunner;
/**
* @author nisiyong
*/
@RunWith
(
MockitoJUnitRunner
.
class
)
@RunWith
(
MockitoJUnitRunner
.
Silent
.
class
)
public
class
AccessKeyServiceWithCacheTest
{
private
AccessKeyServiceWithCache
accessKeyServiceWithCache
;
...
...
@@ -63,7 +63,7 @@ public class AccessKeyServiceWithCacheTest {
when
(
accessKeyRepository
.
findAllById
(
anyList
()))
.
thenReturn
(
Lists
.
newArrayList
(
firstAccessKey
,
secondAccessKey
));
TimeUnit
.
SECONDS
.
sleep
(
1
);
scanIntervalTimeUnit
.
sleep
(
scanInterval
*
10
);
assertThat
(
accessKeyServiceWithCache
.
getAvailableSecrets
(
appId
)).
isEmpty
();
// Update access key, enable both of them
...
...
@@ -74,7 +74,7 @@ public class AccessKeyServiceWithCacheTest {
when
(
accessKeyRepository
.
findAllById
(
anyList
()))
.
thenReturn
(
Lists
.
newArrayList
(
firstAccessKey
,
secondAccessKey
));
TimeUnit
.
SECONDS
.
sleep
(
1
);
scanIntervalTimeUnit
.
sleep
(
scanInterval
*
10
);
assertThat
(
accessKeyServiceWithCache
.
getAvailableSecrets
(
appId
)).
containsExactly
(
"secret-1"
,
"secret-2"
);
// Update access key, disable the first one
...
...
@@ -84,14 +84,14 @@ public class AccessKeyServiceWithCacheTest {
when
(
accessKeyRepository
.
findAllById
(
anyList
()))
.
thenReturn
(
Lists
.
newArrayList
(
firstAccessKey
,
secondAccessKey
));
TimeUnit
.
SECONDS
.
sleep
(
1
);
scanIntervalTimeUnit
.
sleep
(
scanInterval
*
10
);
assertThat
(
accessKeyServiceWithCache
.
getAvailableSecrets
(
appId
)).
containsExactly
(
"secret-2"
);
// Delete access key, delete the second one
when
(
accessKeyRepository
.
findAllById
(
anyList
()))
.
thenReturn
(
Lists
.
newArrayList
(
firstAccessKey
));
TimeUnit
.
SECONDS
.
sleep
(
1
);
scanIntervalTimeUnit
.
sleep
(
scanInterval
*
10
);
assertThat
(
accessKeyServiceWithCache
.
getAvailableSecrets
(
appId
)).
isEmpty
();
// Add new access key in runtime, enable by default
...
...
@@ -100,7 +100,7 @@ public class AccessKeyServiceWithCacheTest {
when
(
accessKeyRepository
.
findAllById
(
anyList
()))
.
thenReturn
(
Lists
.
newArrayList
(
firstAccessKey
,
thirdAccessKey
));
TimeUnit
.
SECONDS
.
sleep
(
1
);
scanIntervalTimeUnit
.
sleep
(
scanInterval
*
10
);
assertThat
(
accessKeyServiceWithCache
.
getAvailableSecrets
(
appId
)).
containsExactly
(
"secret-3"
);
}
...
...
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