Search in sources :

Example 11 with LAORepository

use of com.github.dedis.popstellar.repository.LAORepository in project popstellar by dedis.

the class ElectionHandlerTest method setup.

@Before
public void setup() throws GeneralSecurityException, IOException {
    lenient().when(keyManager.getMainKeyPair()).thenReturn(SENDER_KEY);
    lenient().when(keyManager.getMainPublicKey()).thenReturn(SENDER);
    laoRepository = new LAORepository();
    when(messageSender.subscribe(any())).then(args -> Completable.complete());
    laoRepository = new LAORepository();
    messageHandler = new MessageHandler(DataRegistryModule.provideDataRegistry(), keyManager);
    // Create one LAO
    lao = new Lao(CREATE_LAO.getName(), CREATE_LAO.getOrganizer(), CREATE_LAO.getCreation());
    lao.setLastModified(lao.getCreation());
    // Create one Roll Call and add it to the LAO
    rollCall = new RollCall(lao.getId(), Instant.now().getEpochSecond(), "roll call 1");
    lao.setRollCalls(new HashMap<String, RollCall>() {

        {
            put(rollCall.getId(), rollCall);
        }
    });
    // Create one Election and add it to the LAO
    election = new Election(lao.getId(), Instant.now().getEpochSecond(), "election 1");
    election.setStart(Instant.now().getEpochSecond());
    election.setEnd(Instant.now().getEpochSecond() + 20L);
    election.setChannel(lao.getChannel().subChannel(election.getId()));
    electionQuestion = new ElectionQuestion("question", "Plurality", false, Arrays.asList("a", "b"), election.getId());
    election.setElectionQuestions(Collections.singletonList(electionQuestion));
    lao.setElections(new HashMap<String, Election>() {

        {
            put(election.getId(), election);
        }
    });
    // Add the LAO to the LAORepository
    laoRepository.getLaoById().put(lao.getId(), new LAOState(lao));
    laoRepository.setAllLaoSubject();
    // Add the CreateLao message to the LAORepository
    MessageGeneral createLaoMessage = new MessageGeneral(SENDER_KEY, CREATE_LAO, GSON);
    laoRepository.getMessageById().put(createLaoMessage.getMessageId(), createLaoMessage);
}
Also used : LAOState(com.github.dedis.popstellar.repository.LAOState) MessageGeneral(com.github.dedis.popstellar.model.network.method.message.MessageGeneral) LAORepository(com.github.dedis.popstellar.repository.LAORepository) ElectionQuestion(com.github.dedis.popstellar.model.network.method.message.data.election.ElectionQuestion) RollCall(com.github.dedis.popstellar.model.objects.RollCall) CreateLao(com.github.dedis.popstellar.model.network.method.message.data.lao.CreateLao) Lao(com.github.dedis.popstellar.model.objects.Lao) Election(com.github.dedis.popstellar.model.objects.Election) Before(org.junit.Before)

Example 12 with LAORepository

use of com.github.dedis.popstellar.repository.LAORepository in project popstellar by dedis.

the class LAONetworkManagerTest method unsubscribeSendsTheRightMessage.

@Test
public void unsubscribeSendsTheRightMessage() {
    TestSchedulerProvider schedulerProvider = new TestSchedulerProvider();
    TestScheduler testScheduler = schedulerProvider.getTestScheduler();
    LAONetworkManager networkManager = new LAONetworkManager(laoRepository, handler, connection, JsonModule.provideGson(DataRegistryModule.provideDataRegistry()), schedulerProvider);
    Answer<?> answer = args -> {
        // Retrieve subscribe object
        Unsubscribe subscribe = args.getArgument(0);
        // Make sure the channel is correct
        assertEquals(CHANNEL, subscribe.getChannel());
        // Return a positive result
        messages.onNext(new Result(subscribe.getRequestId()));
        return null;
    };
    doAnswer(answer).when(connection).sendMessage(any(Unsubscribe.class));
    // Actual test
    Disposable disposable = networkManager.unsubscribe(CHANNEL).subscribe();
    testScheduler.advanceTimeBy(5, TimeUnit.SECONDS);
    disposable.dispose();
    networkManager.dispose();
    verify(connection).sendMessage(any(Unsubscribe.class));
    verify(connection, atLeastOnce()).observeMessage();
    verify(connection).observeConnectionEvents();
    verify(connection).close();
    verifyNoMoreInteractions(connection);
}
Also used : TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Publish(com.github.dedis.popstellar.model.network.method.Publish) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) BehaviorSubject(io.reactivex.subjects.BehaviorSubject) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ResultMessages(com.github.dedis.popstellar.model.network.answer.ResultMessages) Subscribe(com.github.dedis.popstellar.model.network.method.Subscribe) LAORepository(com.github.dedis.popstellar.repository.LAORepository) Unsubscribe(com.github.dedis.popstellar.model.network.method.Unsubscribe) DataRegistryModule(com.github.dedis.popstellar.di.DataRegistryModule) HashSet(java.util.HashSet) WebSocket(com.tinder.scarlet.WebSocket) Answer(org.mockito.stubbing.Answer) GenericMessage(com.github.dedis.popstellar.model.network.GenericMessage) JsonRPCErrorException(com.github.dedis.popstellar.utility.error.JsonRPCErrorException) CreateLao(com.github.dedis.popstellar.model.network.method.message.data.lao.CreateLao) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Error(com.github.dedis.popstellar.model.network.answer.Error) KeyPair(com.github.dedis.popstellar.model.objects.security.KeyPair) Mockito.doAnswer(org.mockito.Mockito.doAnswer) ErrorCode(com.github.dedis.popstellar.model.network.answer.ErrorCode) JsonModule(com.github.dedis.popstellar.di.JsonModule) Before(org.junit.Before) Channel(com.github.dedis.popstellar.model.objects.Channel) Result(com.github.dedis.popstellar.model.network.answer.Result) Catchup(com.github.dedis.popstellar.model.network.method.Catchup) MessageGeneral(com.github.dedis.popstellar.model.network.method.message.MessageGeneral) Data(com.github.dedis.popstellar.model.network.method.message.data.Data) Base64DataUtils(com.github.dedis.popstellar.testutils.Base64DataUtils) Query(com.github.dedis.popstellar.model.network.method.Query) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) MessageHandler(com.github.dedis.popstellar.utility.handler.MessageHandler) TimeUnit(java.util.concurrent.TimeUnit) Mockito.never(org.mockito.Mockito.never) Disposable(io.reactivex.disposables.Disposable) TestScheduler(io.reactivex.schedulers.TestScheduler) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Disposable(io.reactivex.disposables.Disposable) TestScheduler(io.reactivex.schedulers.TestScheduler) Unsubscribe(com.github.dedis.popstellar.model.network.method.Unsubscribe) Result(com.github.dedis.popstellar.model.network.answer.Result) Test(org.junit.Test)

Example 13 with LAORepository

use of com.github.dedis.popstellar.repository.LAORepository in project popstellar by dedis.

the class LAONetworkManagerTest method multipleRequestsAtATimeShouldAllSucceed.

@Test
public void multipleRequestsAtATimeShouldAllSucceed() {
    TestSchedulerProvider schedulerProvider = new TestSchedulerProvider();
    TestScheduler testScheduler = schedulerProvider.getTestScheduler();
    LAONetworkManager networkManager = new LAONetworkManager(laoRepository, handler, connection, JsonModule.provideGson(DataRegistryModule.provideDataRegistry()), schedulerProvider);
    // Set a response that stores requested ids
    Set<Integer> requests = new HashSet<>();
    Set<Integer> catchups = new HashSet<>();
    // Setup mock answer
    Answer<?> answer = args -> {
        // Retrieve subscribe object
        Query query = args.getArgument(0);
        if (query instanceof Catchup)
            catchups.add(query.getRequestId());
        else
            requests.add(query.getRequestId());
        return null;
    };
    doAnswer(answer).when(connection).sendMessage(any());
    // Actual test
    // Create
    AtomicBoolean sub1Called = new AtomicBoolean(false);
    AtomicBoolean sub2Called = new AtomicBoolean(false);
    Disposable disposable1 = networkManager.subscribe(CHANNEL).subscribe(() -> sub1Called.set(true));
    Disposable disposable2 = networkManager.subscribe(CHANNEL).subscribe(() -> sub2Called.set(true));
    testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);
    // Responses for subscribes
    requests.forEach(id -> messages.onNext(new Result(id)));
    testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);
    // Expect catchups to be sent now
    testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);
    // Responses to catchups
    catchups.forEach(id -> messages.onNext(new ResultMessages(id, Collections.emptyList())));
    testScheduler.advanceTimeBy(1, TimeUnit.SECONDS);
    // Make sure the subscription succeed
    assertTrue(sub1Called.get());
    assertTrue(sub2Called.get());
    disposable1.dispose();
    disposable2.dispose();
    networkManager.dispose();
    verify(connection, times(2)).sendMessage(any(Subscribe.class));
    verify(connection, times(2)).sendMessage(any(Catchup.class));
    verify(connection, atLeastOnce()).observeMessage();
    verify(connection).observeConnectionEvents();
    verify(connection).close();
    verifyNoMoreInteractions(connection);
}
Also used : TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Publish(com.github.dedis.popstellar.model.network.method.Publish) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) BehaviorSubject(io.reactivex.subjects.BehaviorSubject) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ResultMessages(com.github.dedis.popstellar.model.network.answer.ResultMessages) Subscribe(com.github.dedis.popstellar.model.network.method.Subscribe) LAORepository(com.github.dedis.popstellar.repository.LAORepository) Unsubscribe(com.github.dedis.popstellar.model.network.method.Unsubscribe) DataRegistryModule(com.github.dedis.popstellar.di.DataRegistryModule) HashSet(java.util.HashSet) WebSocket(com.tinder.scarlet.WebSocket) Answer(org.mockito.stubbing.Answer) GenericMessage(com.github.dedis.popstellar.model.network.GenericMessage) JsonRPCErrorException(com.github.dedis.popstellar.utility.error.JsonRPCErrorException) CreateLao(com.github.dedis.popstellar.model.network.method.message.data.lao.CreateLao) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Error(com.github.dedis.popstellar.model.network.answer.Error) KeyPair(com.github.dedis.popstellar.model.objects.security.KeyPair) Mockito.doAnswer(org.mockito.Mockito.doAnswer) ErrorCode(com.github.dedis.popstellar.model.network.answer.ErrorCode) JsonModule(com.github.dedis.popstellar.di.JsonModule) Before(org.junit.Before) Channel(com.github.dedis.popstellar.model.objects.Channel) Result(com.github.dedis.popstellar.model.network.answer.Result) Catchup(com.github.dedis.popstellar.model.network.method.Catchup) MessageGeneral(com.github.dedis.popstellar.model.network.method.message.MessageGeneral) Data(com.github.dedis.popstellar.model.network.method.message.data.Data) Base64DataUtils(com.github.dedis.popstellar.testutils.Base64DataUtils) Query(com.github.dedis.popstellar.model.network.method.Query) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) MessageHandler(com.github.dedis.popstellar.utility.handler.MessageHandler) TimeUnit(java.util.concurrent.TimeUnit) Mockito.never(org.mockito.Mockito.never) Disposable(io.reactivex.disposables.Disposable) TestScheduler(io.reactivex.schedulers.TestScheduler) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Disposable(io.reactivex.disposables.Disposable) Query(com.github.dedis.popstellar.model.network.method.Query) Subscribe(com.github.dedis.popstellar.model.network.method.Subscribe) Catchup(com.github.dedis.popstellar.model.network.method.Catchup) Result(com.github.dedis.popstellar.model.network.answer.Result) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ResultMessages(com.github.dedis.popstellar.model.network.answer.ResultMessages) TestScheduler(io.reactivex.schedulers.TestScheduler) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 14 with LAORepository

use of com.github.dedis.popstellar.repository.LAORepository in project popstellar by dedis.

the class LAONetworkManagerTest method publishSendsRightMessage.

@Test
public void publishSendsRightMessage() {
    TestSchedulerProvider schedulerProvider = new TestSchedulerProvider();
    TestScheduler testScheduler = schedulerProvider.getTestScheduler();
    LAONetworkManager networkManager = new LAONetworkManager(laoRepository, handler, connection, JsonModule.provideGson(DataRegistryModule.provideDataRegistry()), schedulerProvider);
    Answer<?> answer = args -> {
        // Retrieve subscribe object
        Publish publish = args.getArgument(0);
        // Make sure the channel is correct
        assertEquals(CHANNEL, publish.getChannel());
        MessageGeneral messageGeneral = publish.getMessage();
        assertEquals(DATA, messageGeneral.getData());
        // Return a positive result
        messages.onNext(new Result(publish.getRequestId()));
        return null;
    };
    doAnswer(answer).when(connection).sendMessage(any(Publish.class));
    // Actual test
    Disposable disposable = networkManager.publish(KEY_PAIR, CHANNEL, DATA).subscribe();
    testScheduler.advanceTimeBy(5, TimeUnit.SECONDS);
    disposable.dispose();
    networkManager.dispose();
    verify(connection).sendMessage(any(Publish.class));
    verify(connection, atLeastOnce()).observeMessage();
    verify(connection).observeConnectionEvents();
    verify(connection).close();
    verifyNoMoreInteractions(connection);
}
Also used : TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Publish(com.github.dedis.popstellar.model.network.method.Publish) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) BehaviorSubject(io.reactivex.subjects.BehaviorSubject) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ResultMessages(com.github.dedis.popstellar.model.network.answer.ResultMessages) Subscribe(com.github.dedis.popstellar.model.network.method.Subscribe) LAORepository(com.github.dedis.popstellar.repository.LAORepository) Unsubscribe(com.github.dedis.popstellar.model.network.method.Unsubscribe) DataRegistryModule(com.github.dedis.popstellar.di.DataRegistryModule) HashSet(java.util.HashSet) WebSocket(com.tinder.scarlet.WebSocket) Answer(org.mockito.stubbing.Answer) GenericMessage(com.github.dedis.popstellar.model.network.GenericMessage) JsonRPCErrorException(com.github.dedis.popstellar.utility.error.JsonRPCErrorException) CreateLao(com.github.dedis.popstellar.model.network.method.message.data.lao.CreateLao) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Error(com.github.dedis.popstellar.model.network.answer.Error) KeyPair(com.github.dedis.popstellar.model.objects.security.KeyPair) Mockito.doAnswer(org.mockito.Mockito.doAnswer) ErrorCode(com.github.dedis.popstellar.model.network.answer.ErrorCode) JsonModule(com.github.dedis.popstellar.di.JsonModule) Before(org.junit.Before) Channel(com.github.dedis.popstellar.model.objects.Channel) Result(com.github.dedis.popstellar.model.network.answer.Result) Catchup(com.github.dedis.popstellar.model.network.method.Catchup) MessageGeneral(com.github.dedis.popstellar.model.network.method.message.MessageGeneral) Data(com.github.dedis.popstellar.model.network.method.message.data.Data) Base64DataUtils(com.github.dedis.popstellar.testutils.Base64DataUtils) Query(com.github.dedis.popstellar.model.network.method.Query) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) MessageHandler(com.github.dedis.popstellar.utility.handler.MessageHandler) TimeUnit(java.util.concurrent.TimeUnit) Mockito.never(org.mockito.Mockito.never) Disposable(io.reactivex.disposables.Disposable) TestScheduler(io.reactivex.schedulers.TestScheduler) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Disposable(io.reactivex.disposables.Disposable) MessageGeneral(com.github.dedis.popstellar.model.network.method.message.MessageGeneral) TestScheduler(io.reactivex.schedulers.TestScheduler) Publish(com.github.dedis.popstellar.model.network.method.Publish) Result(com.github.dedis.popstellar.model.network.answer.Result) Test(org.junit.Test)

Example 15 with LAORepository

use of com.github.dedis.popstellar.repository.LAORepository in project popstellar by dedis.

the class LAONetworkManagerTest method resubscribeToChannelWhenConnectionReopened.

@Test
public void resubscribeToChannelWhenConnectionReopened() {
    TestSchedulerProvider schedulerProvider = new TestSchedulerProvider();
    TestScheduler testScheduler = schedulerProvider.getTestScheduler();
    LAONetworkManager networkManager = new LAONetworkManager(laoRepository, handler, connection, JsonModule.provideGson(DataRegistryModule.provideDataRegistry()), schedulerProvider);
    // First subscribe
    networkManager.subscribe(CHANNEL).subscribe();
    testScheduler.advanceTimeBy(5, TimeUnit.SECONDS);
    verify(connection).sendMessage(any(Subscribe.class));
    verify(connection).sendMessage(any(Catchup.class));
    // Setup mock answer
    Answer<?> answer = args -> {
        // Retrieve subscribe object
        Subscribe subscribe = args.getArgument(0);
        // Make sure the channel is correct
        assertEquals(CHANNEL, subscribe.getChannel());
        // Return a positive result
        messages.onNext(new Result(subscribe.getRequestId()));
        return null;
    };
    doAnswer(answer).when(connection).sendMessage(any(Subscribe.class));
    // Push Connection open event
    events.onNext(new WebSocket.Event.OnConnectionOpened<>(mock(WebSocket.class)));
    testScheduler.advanceTimeBy(5, TimeUnit.SECONDS);
    networkManager.dispose();
    verify(connection, times(2)).sendMessage(any(Subscribe.class));
    verify(connection, times(2)).sendMessage(any(Catchup.class));
    verify(connection, atLeastOnce()).observeMessage();
    verify(connection).observeConnectionEvents();
    verify(connection).close();
    verifyNoMoreInteractions(connection);
}
Also used : TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Publish(com.github.dedis.popstellar.model.network.method.Publish) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) BehaviorSubject(io.reactivex.subjects.BehaviorSubject) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestSchedulerProvider(com.github.dedis.popstellar.utility.scheduler.TestSchedulerProvider) ResultMessages(com.github.dedis.popstellar.model.network.answer.ResultMessages) Subscribe(com.github.dedis.popstellar.model.network.method.Subscribe) LAORepository(com.github.dedis.popstellar.repository.LAORepository) Unsubscribe(com.github.dedis.popstellar.model.network.method.Unsubscribe) DataRegistryModule(com.github.dedis.popstellar.di.DataRegistryModule) HashSet(java.util.HashSet) WebSocket(com.tinder.scarlet.WebSocket) Answer(org.mockito.stubbing.Answer) GenericMessage(com.github.dedis.popstellar.model.network.GenericMessage) JsonRPCErrorException(com.github.dedis.popstellar.utility.error.JsonRPCErrorException) CreateLao(com.github.dedis.popstellar.model.network.method.message.data.lao.CreateLao) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Error(com.github.dedis.popstellar.model.network.answer.Error) KeyPair(com.github.dedis.popstellar.model.objects.security.KeyPair) Mockito.doAnswer(org.mockito.Mockito.doAnswer) ErrorCode(com.github.dedis.popstellar.model.network.answer.ErrorCode) JsonModule(com.github.dedis.popstellar.di.JsonModule) Before(org.junit.Before) Channel(com.github.dedis.popstellar.model.objects.Channel) Result(com.github.dedis.popstellar.model.network.answer.Result) Catchup(com.github.dedis.popstellar.model.network.method.Catchup) MessageGeneral(com.github.dedis.popstellar.model.network.method.message.MessageGeneral) Data(com.github.dedis.popstellar.model.network.method.message.data.Data) Base64DataUtils(com.github.dedis.popstellar.testutils.Base64DataUtils) Query(com.github.dedis.popstellar.model.network.method.Query) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) MessageHandler(com.github.dedis.popstellar.utility.handler.MessageHandler) TimeUnit(java.util.concurrent.TimeUnit) Mockito.never(org.mockito.Mockito.never) Disposable(io.reactivex.disposables.Disposable) TestScheduler(io.reactivex.schedulers.TestScheduler) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Subscribe(com.github.dedis.popstellar.model.network.method.Subscribe) TestScheduler(io.reactivex.schedulers.TestScheduler) Catchup(com.github.dedis.popstellar.model.network.method.Catchup) Result(com.github.dedis.popstellar.model.network.answer.Result) Test(org.junit.Test)

Aggregations

LAORepository (com.github.dedis.popstellar.repository.LAORepository)30 Channel (com.github.dedis.popstellar.model.objects.Channel)25 Lao (com.github.dedis.popstellar.model.objects.Lao)22 CreateLao (com.github.dedis.popstellar.model.network.method.message.data.lao.CreateLao)15 MessageGeneral (com.github.dedis.popstellar.model.network.method.message.MessageGeneral)12 Before (org.junit.Before)11 Test (org.junit.Test)7 DataRegistryModule (com.github.dedis.popstellar.di.DataRegistryModule)6 JsonModule (com.github.dedis.popstellar.di.JsonModule)6 GenericMessage (com.github.dedis.popstellar.model.network.GenericMessage)6 Error (com.github.dedis.popstellar.model.network.answer.Error)6 ErrorCode (com.github.dedis.popstellar.model.network.answer.ErrorCode)6 Result (com.github.dedis.popstellar.model.network.answer.Result)6 ResultMessages (com.github.dedis.popstellar.model.network.answer.ResultMessages)6 Catchup (com.github.dedis.popstellar.model.network.method.Catchup)6 Publish (com.github.dedis.popstellar.model.network.method.Publish)6 Query (com.github.dedis.popstellar.model.network.method.Query)6 Subscribe (com.github.dedis.popstellar.model.network.method.Subscribe)6 Unsubscribe (com.github.dedis.popstellar.model.network.method.Unsubscribe)6 Data (com.github.dedis.popstellar.model.network.method.message.data.Data)6