Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
briar
Commits
e05575b9
Verified
Commit
e05575b9
authored
4 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Add unit tests for addRotationKeys() methods.
parent
6e6cadd3
No related branches found
No related tags found
1 merge request
!1473
Key manager changes to support transport key agreement client
Pipeline
#6855
passed
4 years ago
Stage: test
Stage: optional_tests
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bramble-core/src/test/java/org/briarproject/bramble/transport/KeyManagerImplTest.java
+33
-0
33 additions, 0 deletions
...rg/briarproject/bramble/transport/KeyManagerImplTest.java
with
33 additions
and
0 deletions
bramble-core/src/test/java/org/briarproject/bramble/transport/KeyManagerImplTest.java
+
33
−
0
View file @
e05575b9
...
...
@@ -242,4 +242,37 @@ public class KeyManagerImplTest extends BrambleMockTestCase {
keyManager
.
eventOccurred
(
event
);
executor
.
runUntilIdle
();
}
@Test
public
void
testAddMultipleRotationKeySets
()
throws
Exception
{
long
timestamp
=
System
.
currentTimeMillis
();
boolean
alice
=
random
.
nextBoolean
();
boolean
active
=
random
.
nextBoolean
();
context
.
checking
(
new
Expectations
()
{{
oneOf
(
transportKeyManager
).
addRotationKeys
(
txn
,
contactId
,
rootKey
,
timestamp
,
alice
,
active
);
will
(
returnValue
(
keySetId
));
}});
assertEquals
(
singletonMap
(
transportId
,
keySetId
),
keyManager
.
addRotationKeys
(
txn
,
contactId
,
rootKey
,
timestamp
,
alice
,
active
));
}
@Test
public
void
testAddSingleRotationKeySet
()
throws
Exception
{
long
timestamp
=
System
.
currentTimeMillis
();
boolean
alice
=
random
.
nextBoolean
();
boolean
active
=
random
.
nextBoolean
();
context
.
checking
(
new
Expectations
()
{{
oneOf
(
transportKeyManager
).
addRotationKeys
(
txn
,
contactId
,
rootKey
,
timestamp
,
alice
,
active
);
will
(
returnValue
(
keySetId
));
}});
assertEquals
(
keySetId
,
keyManager
.
addRotationKeys
(
txn
,
contactId
,
transportId
,
rootKey
,
timestamp
,
alice
,
active
));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment