Move integration tests to their proper packages

parent 4226ba40
apply plugin: 'java'
plugins {
id "java"
id "net.ltgt.apt" version "0.9"
id "idea"
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
......@@ -9,6 +13,11 @@ dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.madgag.spongycastle:core:1.54.0.0'
compile 'com.h2database:h2:1.4.190'
testCompile project(':briar-tests') // TODO remove when moving unit tests (#778)
testCompile 'junit:junit:4.12'
testCompile 'com.google.dagger:dagger-compiler:2.8'
testApt 'com.google.dagger:dagger-compiler:2.8'
}
dependencyVerification {
......
package org.briarproject;
package org.briarproject.bramble.sync;
import org.briarproject.BriarTestCase;
import org.briarproject.TestUtils;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.crypto.CryptoComponent;
import org.briarproject.bramble.api.crypto.SecretKey;
......
package org.briarproject;
package org.briarproject.bramble.sync;
import org.briarproject.TestSeedProviderModule;
import org.briarproject.bramble.crypto.CryptoModule;
import org.briarproject.bramble.sync.SyncModule;
import org.briarproject.bramble.transport.TransportModule;
import javax.inject.Singleton;
......
bin
gen
build
local.properties
.settings
apply plugin: 'com.android.library'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 14
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../briar-android/proguard-rules.txt'
consumerProguardFiles getDefaultProguardFile('proguard-android.txt'), '../briar-android/proguard-rules.txt'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
testCompile project(':briar-tests')
testCompile 'junit:junit:4.12'
testCompile 'net.jodah:concurrentunit:0.4.2'
testCompile 'com.android.support:appcompat-v7:23.2.1'
testApt 'com.google.dagger:dagger-compiler:2.0.2'
provided 'javax.annotation:jsr250-api:1.0'
}
<manifest package="org.briarproject"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
>
</application>
</manifest>
<resources>
<string name="app_name">briar-android-tests</string>
</resources>
......@@ -37,8 +37,6 @@ dependencies {
compile 'uk.co.samuelwall:material-tap-target-prompt:1.3.0'
testCompile 'junit:junit:4.12'
testCompile 'net.jodah:concurrentunit:0.4.2'
testApt 'com.google.dagger:dagger-compiler:2.0.2'
testCompile project(path: ':briar-tests')
testCompile 'org.robolectric:robolectric:3.0'
testCompile 'org.mockito:mockito-core:1.10.19'
......
apply plugin: 'java'
plugins {
id "java"
id "net.ltgt.apt" version "0.9"
id "idea"
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
......@@ -11,6 +15,12 @@ dependencies {
compile 'org.jdom:jdom2:2.0.6'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'org.jsoup:jsoup:1.9.2'
testCompile project(':briar-tests') // TODO remove when moving unit tests (#778)
testCompile 'junit:junit:4.12'
testCompile 'net.jodah:concurrentunit:0.4.2'
testCompile 'com.google.dagger:dagger-compiler:2.8'
testApt 'com.google.dagger:dagger-compiler:2.8'
}
dependencyVerification {
......@@ -24,4 +34,3 @@ dependencyVerification {
'org.slf4j:slf4j-api:e56288031f5e60652c06e7bb6e9fa410a61231ab54890f7b708fc6adc4107c5b'
]
}
package org.briarproject;
import android.support.annotation.CallSuper;
package org.briarproject.briar;
import net.jodah.concurrentunit.Waiter;
import org.briarproject.BriarTestCase;
import org.briarproject.TestUtils;
import org.briarproject.bramble.api.client.ClientHelper;
import org.briarproject.bramble.api.client.ContactGroupFactory;
import org.briarproject.bramble.api.contact.Contact;
......@@ -101,19 +101,19 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
@Inject
protected AuthorFactory authorFactory;
@Inject
ContactGroupFactory contactGroupFactory;
protected ContactGroupFactory contactGroupFactory;
@Inject
PrivateGroupFactory privateGroupFactory;
protected PrivateGroupFactory privateGroupFactory;
@Inject
GroupMessageFactory groupMessageFactory;
protected GroupMessageFactory groupMessageFactory;
@Inject
GroupInvitationFactory groupInvitationFactory;
protected GroupInvitationFactory groupInvitationFactory;
@Inject
BlogFactory blogFactory;
protected BlogFactory blogFactory;
@Inject
BlogPostFactory blogPostFactory;
protected BlogPostFactory blogPostFactory;
@Inject
ForumPostFactory forumPostFactory;
protected ForumPostFactory forumPostFactory;
// objects accessed from background threads need to be volatile
private volatile Waiter validationWaiter;
......@@ -132,7 +132,6 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
protected File t2Dir = new File(testDir, AUTHOR2);
@Before
@CallSuper
public void setUp() throws Exception {
assertTrue(testDir.mkdirs());
createComponents();
......
package org.briarproject;
package org.briarproject.briar;
import org.briarproject.TestDatabaseModule;
import org.briarproject.TestPluginConfigModule;
import org.briarproject.TestSeedProviderModule;
import org.briarproject.bramble.api.client.ClientHelper;
import org.briarproject.bramble.api.contact.ContactManager;
import org.briarproject.bramble.api.db.DatabaseComponent;
......
package org.briarproject;
package org.briarproject.briar.blog;
import org.briarproject.TestDatabaseModule;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.DaggerBriarIntegrationTestComponent;
import org.briarproject.briar.api.blog.Blog;
import org.briarproject.briar.api.blog.BlogCommentHeader;
import org.briarproject.briar.api.blog.BlogManager;
......@@ -17,6 +21,7 @@ import java.util.Iterator;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static org.briarproject.TestUtils.getRandomString;
import static org.briarproject.briar.api.blog.MessageType.COMMENT;
import static org.briarproject.briar.api.blog.MessageType.POST;
import static org.briarproject.briar.api.blog.MessageType.WRAPPED_COMMENT;
......@@ -24,7 +29,7 @@ import static org.briarproject.briar.api.blog.MessageType.WRAPPED_POST;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class BlogManagerTest
public class BlogManagerIntegrationTest
extends BriarIntegrationTest<BriarIntegrationTestComponent> {
private BlogManager blogManager0, blogManager1;
......@@ -101,7 +106,7 @@ public class BlogManagerTest
@Test
public void testBlogPost() throws Exception {
// check that blog0 has no posts
final String body = TestUtils.getRandomString(42);
final String body = getRandomString(42);
Collection<BlogPostHeader> headers0 =
blogManager0.getPostHeaders(blog0.getId());
assertEquals(0, headers0.size());
......@@ -139,7 +144,7 @@ public class BlogManagerTest
@Test
public void testBlogPostInWrongBlog() throws Exception {
// add a post to blog1
final String body = TestUtils.getRandomString(42);
final String body = getRandomString(42);
BlogPost p = blogPostFactory
.createBlogPost(blog1.getId(), clock.currentTimeMillis(), null,
author0, body);
......@@ -178,7 +183,7 @@ public class BlogManagerTest
@Test
public void testBlogComment() throws Exception {
// add a post to blog0
final String body = TestUtils.getRandomString(42);
final String body = getRandomString(42);
BlogPost p = blogPostFactory
.createBlogPost(blog0.getId(), clock.currentTimeMillis(), null,
author0, body);
......@@ -223,7 +228,7 @@ public class BlogManagerTest
@Test
public void testBlogCommentOnOwnPost() throws Exception {
// add a post to blog0
final String body = TestUtils.getRandomString(42);
final String body = getRandomString(42);
BlogPost p = blogPostFactory
.createBlogPost(blog0.getId(), clock.currentTimeMillis(), null,
author0, body);
......@@ -259,7 +264,7 @@ public class BlogManagerTest
@Test
public void testCommentOnComment() throws Exception {
// add a post to blog0
final String body = TestUtils.getRandomString(42);
final String body = getRandomString(42);
BlogPost p = blogPostFactory
.createBlogPost(blog0.getId(), clock.currentTimeMillis(), null,
author0, body);
......@@ -349,7 +354,7 @@ public class BlogManagerTest
@Test
public void testCommentOnOwnComment() throws Exception {
// add a post to blog0
final String body = TestUtils.getRandomString(42);
final String body = getRandomString(42);
BlogPost p = blogPostFactory
.createBlogPost(blog0.getId(), clock.currentTimeMillis(), null,
author0, body);
......
package org.briarproject;
import junit.framework.Assert;
package org.briarproject.briar.forum;
import org.briarproject.TestDatabaseModule;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.DaggerBriarIntegrationTestComponent;
import org.briarproject.briar.api.forum.Forum;
import org.briarproject.briar.api.forum.ForumManager;
import org.briarproject.briar.api.forum.ForumPost;
......@@ -15,10 +17,10 @@ import java.util.Collection;
import javax.annotation.Nullable;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
import static junit.framework.TestCase.assertFalse;
import static org.briarproject.TestUtils.assertGroupCount;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class ForumManagerTest
......@@ -110,7 +112,7 @@ public class ForumManagerTest
boolean isPost1 = h.getId().equals(post1.getMessage().getId());
boolean isPost2 = h.getId().equals(post2.getMessage().getId());
Assert.assertTrue(isPost1 || isPost2);
assertTrue(isPost1 || isPost2);
if (isPost1) {
assertEquals(h.getTimestamp(), ms1);
assertEquals(body1, hBody);
......
......@@ -2,7 +2,6 @@ package org.briarproject.briar.introduction;
import net.jodah.concurrentunit.Waiter;
import org.briarproject.BriarIntegrationTest;
import org.briarproject.TestDatabaseModule;
import org.briarproject.TestUtils;
import org.briarproject.bramble.api.FormatException;
......@@ -27,6 +26,7 @@ import org.briarproject.bramble.api.properties.TransportPropertyManager;
import org.briarproject.bramble.api.sync.Group;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.introduction.IntroductionManager;
import org.briarproject.briar.api.introduction.IntroductionMessage;
......@@ -454,7 +454,7 @@ public class IntroductionIntegrationTest
assertTrue(listener1.requestReceived);
// get SessionId
List<IntroductionMessage> list = new ArrayList<>(
List<IntroductionMessage> list = new ArrayList<IntroductionMessage>(
introductionManager1.getIntroductionMessages(contactId0From1));
assertEquals(2, list.size());
assertTrue(list.get(0) instanceof IntroductionRequest);
......@@ -906,7 +906,9 @@ public class IntroductionIntegrationTest
time);
}
}
} catch (DbException | IOException exception) {
} catch (DbException exception) {
eventWaiter.rethrow(exception);
} catch (FormatException exception) {
eventWaiter.rethrow(exception);
} finally {
eventWaiter.resume();
......
package org.briarproject.briar.introduction;
import org.briarproject.BriarIntegrationTestComponent;
import org.briarproject.TestDatabaseModule;
import org.briarproject.TestPluginConfigModule;
import org.briarproject.TestSeedProviderModule;
......@@ -16,6 +15,7 @@ import org.briarproject.bramble.properties.PropertiesModule;
import org.briarproject.bramble.sync.SyncModule;
import org.briarproject.bramble.system.SystemModule;
import org.briarproject.bramble.transport.TransportModule;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.blog.BlogModule;
import org.briarproject.briar.client.BriarClientModule;
import org.briarproject.briar.forum.ForumModule;
......
package org.briarproject;
package org.briarproject.briar.messaging;
import org.briarproject.BriarTestCase;
import org.briarproject.TestUtils;
import org.briarproject.bramble.api.UniqueId;
import org.briarproject.bramble.api.crypto.CryptoComponent;
import org.briarproject.bramble.api.crypto.PrivateKey;
......@@ -18,6 +20,7 @@ import org.junit.Test;
import javax.inject.Inject;
import static org.briarproject.TestUtils.getRandomId;
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
import static org.briarproject.bramble.api.sync.SyncConstants.MAX_PACKET_PAYLOAD_LENGTH;
......@@ -46,7 +49,7 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
@Test
public void testPrivateMessageFitsIntoPacket() throws Exception {
// Create a maximum-length private message
GroupId groupId = new GroupId(TestUtils.getRandomId());
GroupId groupId = new GroupId(getRandomId());
long timestamp = Long.MAX_VALUE;
String body =
StringUtils.fromUtf8(new byte[MAX_PRIVATE_MESSAGE_BODY_LENGTH]);
......@@ -70,9 +73,9 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
.createLocalAuthor(authorName, authorPublic,
privateKey.getEncoded());
// Create a maximum-length forum post
GroupId groupId = new GroupId(TestUtils.getRandomId());
GroupId groupId = new GroupId(getRandomId());
long timestamp = Long.MAX_VALUE;
MessageId parent = new MessageId(TestUtils.getRandomId());
MessageId parent = new MessageId(getRandomId());
String body = TestUtils.getRandomString(MAX_FORUM_POST_BODY_LENGTH);
ForumPost post = forumPostFactory.createPost(groupId,
timestamp, parent, author, body);
......
package org.briarproject;
package org.briarproject.briar.messaging;
import org.briarproject.TestDatabaseModule;
import org.briarproject.TestLifecycleModule;
import org.briarproject.TestSeedProviderModule;
import org.briarproject.bramble.client.ClientModule;
import org.briarproject.bramble.crypto.CryptoModule;
import org.briarproject.bramble.data.DataModule;
......@@ -10,7 +13,6 @@ import org.briarproject.bramble.sync.SyncModule;
import org.briarproject.bramble.system.SystemModule;
import org.briarproject.briar.client.BriarClientModule;
import org.briarproject.briar.forum.ForumModule;
import org.briarproject.briar.messaging.MessagingModule;
import javax.inject.Singleton;
......
package org.briarproject;
package org.briarproject.briar.messaging;
import org.briarproject.BriarTestCase;
import org.briarproject.TestDatabaseModule;
import org.briarproject.TestUtils;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.contact.ContactManager;
import org.briarproject.bramble.api.crypto.SecretKey;
......@@ -23,7 +26,6 @@ import org.briarproject.bramble.system.SystemModule;
import org.briarproject.briar.api.messaging.MessagingManager;
import org.briarproject.briar.api.messaging.PrivateMessage;
import org.briarproject.briar.api.messaging.PrivateMessageFactory;
import org.briarproject.briar.messaging.MessagingModule;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
......
package org.briarproject;
package org.briarproject.briar.messaging;
import org.briarproject.TestDatabaseModule;
import org.briarproject.TestPluginConfigModule;
import org.briarproject.TestSeedProviderModule;
import org.briarproject.bramble.api.contact.ContactManager;
import org.briarproject.bramble.api.event.EventBus;
import org.briarproject.bramble.api.identity.IdentityManager;
......@@ -22,7 +25,6 @@ import org.briarproject.bramble.transport.TransportModule;
import org.briarproject.briar.api.messaging.MessagingManager;
import org.briarproject.briar.api.messaging.PrivateMessageFactory;
import org.briarproject.briar.client.BriarClientModule;
import org.briarproject.briar.messaging.MessagingModule;
import javax.inject.Singleton;
......
package org.briarproject;
package org.briarproject.briar.privategroup;
import org.briarproject.TestDatabaseModule;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.sync.Group;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.DaggerBriarIntegrationTestComponent;
import org.briarproject.briar.api.client.ProtocolStateException;
import org.briarproject.briar.api.privategroup.GroupMessage;
import org.briarproject.briar.api.privategroup.PrivateGroup;
......@@ -18,11 +22,11 @@ import java.util.Collection;
import javax.annotation.Nullable;
import static junit.framework.TestCase.fail;
import static org.briarproject.TestUtils.assertGroupCount;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class GroupInvitationIntegrationTest
extends BriarIntegrationTest<BriarIntegrationTestComponent> {
......
package org.briarproject;
package org.briarproject.briar.privategroup;
import org.briarproject.TestDatabaseModule;
import org.briarproject.bramble.api.contact.Contact;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.identity.AuthorId;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.DaggerBriarIntegrationTestComponent;
import org.briarproject.briar.api.privategroup.GroupMember;
import org.briarproject.briar.api.privategroup.GroupMessage;
import org.briarproject.briar.api.privategroup.GroupMessageHeader;
......
package org.briarproject;
package org.briarproject.briar.privategroup;
import org.briarproject.TestDatabaseModule;
import org.briarproject.bramble.api.contact.Contact;
import org.briarproject.bramble.api.data.BdfList;
import org.briarproject.bramble.api.db.Transaction;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.DaggerBriarIntegrationTestComponent;
import org.briarproject.briar.api.client.MessageTracker.GroupCount;
import org.briarproject.briar.api.privategroup.GroupMember;
import org.briarproject.briar.api.privategroup.GroupMessage;
......@@ -18,6 +22,7 @@ import org.junit.Test;
import java.util.Collection;
import static org.briarproject.TestUtils.getRandomBytes;
import static org.briarproject.TestUtils.getRandomId;
import static org.briarproject.bramble.api.identity.Author.Status.VERIFIED;
import static org.briarproject.bramble.api.sync.Group.Visibility.SHARED;
import static org.briarproject.briar.api.privategroup.Visibility.INVISIBLE;
......@@ -29,7 +34,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class PrivateGroupManagerTest
public class PrivateGroupManagerIntegrationTest
extends BriarIntegrationTest<BriarIntegrationTestComponent> {
private PrivateGroup privateGroup0;
......@@ -127,7 +132,7 @@ public class PrivateGroupManagerTest
assertEquals(2, groupManager1.getHeaders(groupId0).size());
// create and add test message with random previousMsgId
MessageId previousMsgId = new MessageId(TestUtils.getRandomId());
MessageId previousMsgId = new MessageId(getRandomId());
msg = groupMessageFactory
.createGroupMessage(groupId0, clock.currentTimeMillis(), null,
author0, "test", previousMsgId);
......@@ -158,7 +163,7 @@ public class PrivateGroupManagerTest
addGroup();
// create and add test message with random parentMsgId
MessageId parentMsgId = new MessageId(TestUtils.getRandomId());
MessageId parentMsgId = new MessageId(getRandomId());
MessageId previousMsgId = groupManager0.getPreviousMsgId(groupId0);
GroupMessage msg = groupMessageFactory
.createGroupMessage(groupId0, clock.currentTimeMillis(),
......
package org.briarproject;
package org.briarproject.briar.sharing;
import net.jodah.concurrentunit.Waiter;
import org.briarproject.TestDatabaseModule;
import org.briarproject.bramble.api.contact.Contact;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.db.NoSuchGroupException;
......@@ -9,6 +10,9 @@ import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.event.EventListener;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.DaggerBriarIntegrationTestComponent;
import org.briarproject.briar.api.blog.Blog;
import org.briarproject.briar.api.blog.BlogInvitationRequest;
import org.briarproject.briar.api.blog.BlogInvitationResponse;
......@@ -147,7 +151,7 @@ public class BlogSharingIntegrationTest
// invitee has one invitation message from sharer
List<InvitationMessage> list =
new ArrayList<>(blogSharingManager1
new ArrayList<InvitationMessage>(blogSharingManager1
.getInvitationMessages(contactId0From1));
assertEquals(2, list.size());
// check other things are alright with the message
......@@ -210,7 +214,7 @@ public class BlogSharingIntegrationTest
// invitee has one invitation message from sharer and one response
List<InvitationMessage> list =
new ArrayList<>(blogSharingManager1
new ArrayList<InvitationMessage>(blogSharingManager1
.getInvitationMessages(contactId0From1));
assertEquals(2, list.size());
// check things are alright with the message
......
package org.briarproject;
package org.briarproject.briar.sharing;
import net.jodah.concurrentunit.Waiter;
import org.briarproject.TestDatabaseModule;
import org.briarproject.bramble.api.Bytes;
import org.briarproject.bramble.api.contact.Contact;
import org.briarproject.bramble.api.data.BdfList;
......@@ -12,6 +13,9 @@ import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.event.EventListener;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.Group;
import org.briarproject.briar.BriarIntegrationTest;
import org.briarproject.briar.BriarIntegrationTestComponent;
import org.briarproject.briar.DaggerBriarIntegrationTestComponent;
import org.briarproject.briar.api.client.MessageQueueManager;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.forum.Forum;
......@@ -35,6 +39,8 @@ import java.util.Collection;
import java.util.List;
import static junit.framework.Assert.assertNotNull;
import static org.briarproject.TestUtils.getRandomBytes;
import static org.briarproject.TestUtils.getRandomString;
import static org.briarproject.briar.api.forum.ForumConstants.FORUM_SALT_LENGTH;
import static org.briarproject.briar.api.forum.ForumSharingManager.CLIENT_ID;
import static org.briarproject.briar.api.sharing.SharingConstants.SHARE_MSG_TYPE_INVITATION;
......@@ -127,7 +133,7 @@ public class ForumSharingIntegrationTest
// invitee has one invitation message from sharer
List<InvitationMessage> list =
new ArrayList<>(forumSharingManager1
new ArrayList<InvitationMessage>(forumSharingManager1
.getInvitationMessages(contactId0From1));
assertEquals(2, list.size());
// check other things are alright with the forum message
......@@ -185,7 +191,7 @@ public class ForumSharingIntegrationTest
// invitee has one invitation message from sharer and one response
List<InvitationMessage> list =
new ArrayList<>(forumSharingManager1
new ArrayList<InvitationMessage>(forumSharingManager1
.getInvitationMessages(contactId0From1));
assertEquals(2, list.size());
// check things are alright with the forum message
......@@ -395,7 +401,7 @@ public class ForumSharingIntegrationTest
listener1.requestReceived = false;
// get SessionId from invitation
List<InvitationMessage> list = new ArrayList<>(
List<InvitationMessage> list = new ArrayList<InvitationMessage>(
forumSharingManager1
.getInvitationMessages(contactId0From1));
assertEquals(2, list.size());
......@@ -408,11 +414,9 @@ public class ForumSharingIntegrationTest
Contact c1 = contactManager0.getContact(contactId1From0);
Group group = contactGroupFactory.createContactGroup(CLIENT_ID, c1);
long time = clock.currentTimeMillis();
BdfList bodyList = BdfList.of(SHARE_MSG_TYPE_INVITATION,
sessionId.getBytes(),
TestUtils.getRandomString(42),
TestUtils.getRandomBytes(FORUM_SALT_LENGTH)
);
BdfList bodyList =
BdfList.of(SHARE_MSG_TYPE_INVITATION, sessionId.getBytes(),
<