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
Snippets
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
Julian Dehm
briar
Commits
df7d48d5
Verified
Commit
df7d48d5
authored
6 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Fix test expectations.
parent
1987dcb9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-android/src/test/java/org/briarproject/briar/android/login/SetupControllerImplTest.java
+15
-0
15 additions, 0 deletions
...rproject/briar/android/login/SetupControllerImplTest.java
with
15 additions
and
0 deletions
briar-android/src/test/java/org/briarproject/briar/android/login/SetupControllerImplTest.java
+
15
−
0
View file @
df7d48d5
package
org.briarproject.briar.android.login
;
import
android.content.SharedPreferences
;
import
android.content.pm.ApplicationInfo
;
import
org.briarproject.bramble.api.crypto.CryptoComponent
;
import
org.briarproject.bramble.api.crypto.PasswordStrengthEstimator
;
...
...
@@ -8,10 +9,13 @@ import org.briarproject.bramble.api.crypto.SecretKey;
import
org.briarproject.bramble.api.db.DatabaseConfig
;
import
org.briarproject.bramble.test.BrambleMockTestCase
;
import
org.briarproject.bramble.test.ImmediateExecutor
;
import
org.briarproject.bramble.test.TestUtils
;
import
org.jmock.Expectations
;
import
org.jmock.lib.legacy.ClassImposteriser
;
import
org.junit.After
;
import
org.junit.Test
;
import
java.io.File
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.atomic.AtomicBoolean
;
...
...
@@ -40,6 +44,7 @@ public class SetupControllerImplTest extends BrambleMockTestCase {
private
final
String
encryptedHex
=
"010203"
;
private
final
byte
[]
encryptedBytes
=
new
byte
[]
{
1
,
2
,
3
};
private
final
SecretKey
key
=
getSecretKey
();
private
final
File
testDir
=
TestUtils
.
getTestDirectory
();
public
SetupControllerImplTest
()
{
context
.
setImposteriser
(
ClassImposteriser
.
INSTANCE
);
...
...
@@ -50,6 +55,11 @@ public class SetupControllerImplTest extends BrambleMockTestCase {
@SuppressWarnings
(
"ResultOfMethodCallIgnored"
)
public
void
testCreateAccount
()
{
context
.
checking
(
new
Expectations
()
{{
// Allow the contents of the data directory to be logged
allowing
(
setupActivity
).
getApplicationInfo
();
will
(
returnValue
(
new
ApplicationInfo
()
{{
dataDir
=
testDir
.
getAbsolutePath
();
}}));
// Set the author name and password
oneOf
(
setupActivity
).
setAuthorName
(
authorName
);
oneOf
(
setupActivity
).
setPassword
(
password
);
...
...
@@ -84,4 +94,9 @@ public class SetupControllerImplTest extends BrambleMockTestCase {
s
.
createAccount
(
result
->
called
.
set
(
true
));
assertTrue
(
called
.
get
());
}
@After
public
void
tearDown
()
{
TestUtils
.
deleteTestDirectory
(
testDir
);
}
}
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