2016-03-04 08:36:48 -05:00
|
|
|
import com.google.common.util.concurrent.FutureCallback;
|
2016-01-30 05:30:12 -05:00
|
|
|
import com.google.protobuf.InvalidProtocolBufferException;
|
2016-01-16 09:57:12 -05:00
|
|
|
import junit.framework.TestCase;
|
2016-02-26 07:54:39 -05:00
|
|
|
import meerkat.Registry.CollectionMessagesUtils;
|
|
|
|
import meerkat.Registry.RegistryTags;
|
2016-02-26 08:17:29 -05:00
|
|
|
import meerkat.SimpleRegistry;
|
2016-03-04 08:36:48 -05:00
|
|
|
import meerkat.bulletinboard.AsyncBulletinBoardClient;
|
2016-02-20 10:48:10 -05:00
|
|
|
import meerkat.bulletinboard.ThreadedBulletinBoardClient;
|
2016-02-19 11:41:02 -05:00
|
|
|
import meerkat.crypto.concrete.ECDSASignature;
|
2016-02-26 07:54:39 -05:00
|
|
|
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage;
|
|
|
|
import meerkat.protobuf.BulletinBoardAPI.MessageFilterList;
|
2016-02-26 08:52:03 -05:00
|
|
|
import meerkat.protobuf.VoterRegistry.GroupID;
|
|
|
|
import meerkat.protobuf.VoterRegistry.VoterGroup;
|
|
|
|
import meerkat.protobuf.VoterRegistry.VoterID;
|
|
|
|
import meerkat.protobuf.VoterRegistry.VoterInfo;
|
2016-01-23 12:16:57 -05:00
|
|
|
import meerkat.protobuf.Voting;
|
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
import java.io.InputStream;
|
2016-01-23 12:16:57 -05:00
|
|
|
import java.math.BigInteger;
|
2016-02-20 10:48:10 -05:00
|
|
|
import java.security.KeyStore;
|
2016-01-30 05:30:12 -05:00
|
|
|
import java.security.SecureRandom;
|
2016-01-23 12:16:57 -05:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2016-02-20 10:48:10 -05:00
|
|
|
import java.util.concurrent.Semaphore;
|
2016-01-30 05:30:12 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
/**
|
2016-02-26 00:45:52 -05:00
|
|
|
* TODO: add logs prints for the tests to be clear what they are
|
2016-02-20 10:48:10 -05:00
|
|
|
*/
|
|
|
|
|
2016-01-16 09:57:12 -05:00
|
|
|
/**
|
|
|
|
* Created by Vladimir Eliezer Tokarev on 1/16/2016.
|
2016-02-26 07:54:39 -05:00
|
|
|
* Tests the Simple Registry contents
|
2016-01-23 12:16:57 -05:00
|
|
|
* NOTE: for most of this tests to pass there should run BulletinBoardServer
|
2016-01-30 05:30:12 -05:00
|
|
|
* that should be reachable on BULLETIN_BOARD_SERVER_ADDRESS
|
2016-01-16 09:57:12 -05:00
|
|
|
*/
|
2016-01-30 05:30:12 -05:00
|
|
|
public class SimpleRegistryTest extends TestCase {
|
2016-01-16 09:57:12 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
private ECDSASignature signer;
|
2016-03-04 08:36:48 -05:00
|
|
|
private AsyncBulletinBoardClient bulletinBoardClient;
|
2016-02-26 07:54:39 -05:00
|
|
|
private InputStream certStream;
|
2016-01-30 05:30:12 -05:00
|
|
|
private SecureRandom random = new SecureRandom();
|
2016-02-26 07:54:39 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
public static String KEYFILE_EXAMPLE = "/certs/enduser-certs/user1-key-with-password-secret.p12";
|
2016-02-26 07:54:39 -05:00
|
|
|
public static String CERT1_PEM_EXAMPLE = "/certs/enduser-certs/user1.crt";
|
2016-02-20 10:48:10 -05:00
|
|
|
public static String KEYFILE_PASSWORD = "secret";
|
|
|
|
Semaphore jobSemaphore;
|
|
|
|
|
2016-02-26 08:52:03 -05:00
|
|
|
class DummyRegistryCallBackHandler<T> implements meerkat.VoterRegistry.RegistryCallBack<T>{
|
2016-02-20 10:48:10 -05:00
|
|
|
public int counter;
|
|
|
|
public T data;
|
|
|
|
|
|
|
|
public DummyRegistryCallBackHandler()
|
|
|
|
{
|
|
|
|
counter=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void HandleResult(T result) {
|
|
|
|
counter++;
|
|
|
|
data = result;
|
|
|
|
jobSemaphore.release();
|
|
|
|
}
|
2016-02-27 06:46:36 -05:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void HandleFailure(Throwable throwable) {
|
|
|
|
}
|
2016-02-20 10:48:10 -05:00
|
|
|
}
|
|
|
|
|
2016-03-04 08:36:48 -05:00
|
|
|
public class DummyBulletinBoardCallBackHandler implements FutureCallback<List<BulletinBoardMessage>> {
|
2016-02-26 07:54:39 -05:00
|
|
|
public List<BulletinBoardMessage> messages;
|
2016-02-20 10:48:10 -05:00
|
|
|
|
|
|
|
@Override
|
2016-03-04 08:36:48 -05:00
|
|
|
public void onSuccess(List<BulletinBoardMessage> msg)
|
2016-02-20 10:48:10 -05:00
|
|
|
{
|
|
|
|
messages = msg;
|
|
|
|
jobSemaphore.release();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-03-04 08:36:48 -05:00
|
|
|
public void onFailure(Throwable t){
|
2016-02-20 10:48:10 -05:00
|
|
|
messages = null;
|
|
|
|
jobSemaphore.release();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
private void createCertificateStream()
|
|
|
|
{
|
|
|
|
this.certStream = getClass().getResourceAsStream(CERT1_PEM_EXAMPLE);
|
|
|
|
}
|
2016-01-23 12:16:57 -05:00
|
|
|
|
2016-01-30 05:30:12 -05:00
|
|
|
private void CommunicatorSetup() {
|
2016-02-26 00:45:52 -05:00
|
|
|
bulletinBoardClient = new ThreadedBulletinBoardClient();
|
2016-02-27 06:00:14 -05:00
|
|
|
String BULLETIN_BOARD_SERVER_ADDRESS = "http://localhost:8081/";
|
2016-02-26 00:45:52 -05:00
|
|
|
bulletinBoardClient.init(Voting.BulletinBoardClientParams.newBuilder()
|
2016-01-23 12:16:57 -05:00
|
|
|
.addBulletinBoardAddress(BULLETIN_BOARD_SERVER_ADDRESS)
|
|
|
|
.setMinRedundancy((float) 1.0)
|
|
|
|
.build());
|
|
|
|
}
|
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
private void SetSigner(){
|
|
|
|
try {
|
|
|
|
signer = new ECDSASignature();
|
|
|
|
InputStream keyStream = getClass().getResourceAsStream(KEYFILE_EXAMPLE);
|
|
|
|
char[] password = KEYFILE_PASSWORD.toCharArray();
|
|
|
|
|
|
|
|
KeyStore.Builder keyStore = signer.getPKCS12KeyStoreBuilder(keyStream, password);
|
|
|
|
signer.loadSigningCertificate(keyStore);
|
2016-02-26 07:54:39 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
keyStream.close();
|
|
|
|
}
|
|
|
|
catch (Exception e){
|
|
|
|
assert false : "The signer creation failed ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-30 05:30:12 -05:00
|
|
|
/**
|
2016-01-16 09:57:12 -05:00
|
|
|
* Initialize SimpleRegistry object
|
|
|
|
*/
|
2016-01-30 05:30:12 -05:00
|
|
|
public void setUp() {
|
2016-02-20 10:48:10 -05:00
|
|
|
SetSigner();
|
2016-01-23 12:16:57 -05:00
|
|
|
CommunicatorSetup();
|
2016-02-26 07:54:39 -05:00
|
|
|
createCertificateStream();
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore = new Semaphore(0);
|
2016-01-23 12:16:57 -05:00
|
|
|
}
|
2016-01-16 09:57:12 -05:00
|
|
|
|
2016-01-23 12:16:57 -05:00
|
|
|
/**
|
|
|
|
* Checks if the creation of the registry have been successful
|
|
|
|
*/
|
2016-01-30 05:30:12 -05:00
|
|
|
public void testSimpleRegistryCreation() {
|
2016-01-23 12:16:57 -05:00
|
|
|
try {
|
2016-02-26 07:54:39 -05:00
|
|
|
new SimpleRegistry(signer, bulletinBoardClient, certStream);
|
2016-01-30 05:30:12 -05:00
|
|
|
} catch (Exception e) {
|
2016-01-23 12:16:57 -05:00
|
|
|
assert false : "While creating the SimpleRegistry exception have been thrown " + e;
|
|
|
|
}
|
2016-01-16 09:57:12 -05:00
|
|
|
}
|
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
/**
|
|
|
|
* Counts the amount of messages from messages that have all the wanted tags inside
|
|
|
|
* @param messages List<VoterRegistryMessage>
|
|
|
|
* @param tags List<RegistryTags>
|
|
|
|
* @return integer that represent the amount of messages with wanted tags
|
|
|
|
*/
|
2016-02-27 06:46:36 -05:00
|
|
|
private int countMessagesWithTags(List<BulletinBoardMessage> messages, List<String> tags)
|
2016-02-20 10:48:10 -05:00
|
|
|
{
|
|
|
|
int counter = 0 ;
|
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
for (int i = 0 ; i < messages.size() ; i++) {
|
2016-02-27 06:46:36 -05:00
|
|
|
BulletinBoardMessage message = messages.get(i);
|
2016-02-20 10:48:10 -05:00
|
|
|
int wantedTagsCounter = 0;
|
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
for (int j = 0 ;j < tags.size() ; j++) {
|
|
|
|
String tag = tags.get(j);
|
2016-02-27 06:46:36 -05:00
|
|
|
if(CollectionMessagesUtils.GetTagByName(message.getMsg().getTagList(), tag)!=null){
|
2016-02-20 11:54:22 -05:00
|
|
|
wantedTagsCounter++;
|
|
|
|
}
|
2016-02-20 10:48:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if(wantedTagsCounter == tags.size())
|
|
|
|
{
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return counter;
|
|
|
|
}
|
|
|
|
|
2016-01-16 09:57:12 -05:00
|
|
|
/**
|
2016-02-19 11:41:02 -05:00
|
|
|
* Test that add voter creates new correct bulletin board message and adds the voter
|
2016-01-16 09:57:12 -05:00
|
|
|
*/
|
2016-02-20 10:48:10 -05:00
|
|
|
public void testAddVoter() throws InvalidProtocolBufferException, InterruptedException {
|
|
|
|
DummyRegistryCallBackHandler<Boolean> handler = new DummyRegistryCallBackHandler<>();
|
2016-01-23 12:16:57 -05:00
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
String id = new BigInteger(130, random).toString(32);
|
|
|
|
String data = new BigInteger(130, random).toString(32);
|
2016-02-27 06:00:14 -05:00
|
|
|
VoterInfo voterInfo = VoterInfo.newBuilder().setId(VoterID.newBuilder().setId(id)).setInfo(data).build();
|
2016-01-30 05:30:12 -05:00
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
SimpleRegistry registry = new SimpleRegistry(signer, bulletinBoardClient, certStream);
|
2016-02-19 11:41:02 -05:00
|
|
|
registry.AddVoter(voterInfo, handler);
|
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-02-20 11:54:22 -05:00
|
|
|
assertEquals(1, handler.counter );
|
2016-01-30 05:30:12 -05:00
|
|
|
|
2016-02-27 04:27:19 -05:00
|
|
|
List<String> tags = new ArrayList<String>(){{ add(RegistryTags.VOTER_ENTRY_TAG);}};
|
2016-02-26 07:54:39 -05:00
|
|
|
MessageFilterList filters = CollectionMessagesUtils.GenerateFiltersFromTags(tags);
|
2016-02-19 11:41:02 -05:00
|
|
|
DummyBulletinBoardCallBackHandler bulletinHandler = new DummyBulletinBoardCallBackHandler();
|
2016-02-26 00:45:52 -05:00
|
|
|
bulletinBoardClient.readMessages(filters, bulletinHandler);
|
2016-01-16 09:57:12 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
tags.add(id);
|
|
|
|
|
2016-02-27 06:46:36 -05:00
|
|
|
int counter = countMessagesWithTags(bulletinHandler.messages, tags);
|
2016-02-20 10:48:10 -05:00
|
|
|
assert counter == 1 : "The server don't have the new user data.";
|
2016-01-30 05:30:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-19 11:41:02 -05:00
|
|
|
* Test that set voted posts creates correct bulletin board message and sets that the user have been voted
|
2016-01-30 05:30:12 -05:00
|
|
|
*/
|
2016-02-20 10:48:10 -05:00
|
|
|
public void testSetVoted() throws InvalidProtocolBufferException, InterruptedException {
|
2016-02-19 11:41:02 -05:00
|
|
|
DummyRegistryCallBackHandler<Boolean> handler = new DummyRegistryCallBackHandler<>();
|
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
String id = new BigInteger(130, random).toString(32);
|
2016-02-26 08:17:29 -05:00
|
|
|
VoterID voterInfo = VoterID.newBuilder().setId(id).build();
|
2016-01-30 05:30:12 -05:00
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
SimpleRegistry registry = new SimpleRegistry(signer, bulletinBoardClient, certStream);
|
2016-02-19 11:41:02 -05:00
|
|
|
registry.SetVoted(voterInfo, handler);
|
2016-01-30 05:30:12 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-02-20 11:54:22 -05:00
|
|
|
assertEquals(1, handler.counter );
|
2016-01-30 05:30:12 -05:00
|
|
|
|
2016-02-27 04:27:19 -05:00
|
|
|
List<String> tags = new ArrayList<String>(){{ add(RegistryTags.VOTE_ACTION_TAG);}};
|
2016-02-26 07:54:39 -05:00
|
|
|
MessageFilterList filters = CollectionMessagesUtils.GenerateFiltersFromTags(tags);
|
2016-02-19 11:41:02 -05:00
|
|
|
DummyBulletinBoardCallBackHandler bulletinHandler = new DummyBulletinBoardCallBackHandler();
|
2016-02-26 00:45:52 -05:00
|
|
|
bulletinBoardClient.readMessages(filters, bulletinHandler);
|
2016-01-30 05:30:12 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-01-23 12:16:57 -05:00
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
tags.add(id);
|
2016-02-27 06:46:36 -05:00
|
|
|
int counter = countMessagesWithTags(bulletinHandler.messages, tags);
|
2016-02-20 10:48:10 -05:00
|
|
|
assert counter == 1 : "The server don't have the new user id.";
|
2016-01-16 09:57:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-30 12:19:25 -05:00
|
|
|
* Test that get groups retrieves the right groups the user are in
|
2016-01-16 09:57:12 -05:00
|
|
|
*/
|
2016-02-20 10:48:10 -05:00
|
|
|
public void testAddToGroup() throws InvalidProtocolBufferException, InterruptedException {
|
2016-02-19 11:41:02 -05:00
|
|
|
DummyRegistryCallBackHandler<Boolean> handler = new DummyRegistryCallBackHandler<>();
|
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
String voterId = new BigInteger(130, random).toString(32);
|
|
|
|
String groupId = new BigInteger(130, random).toString(32);
|
2016-02-26 08:52:03 -05:00
|
|
|
VoterGroup voterInfo = VoterGroup.newBuilder()
|
|
|
|
.setVoterId(VoterID.newBuilder().setId(voterId))
|
2016-02-26 08:17:29 -05:00
|
|
|
.setGroupId(GroupID.newBuilder().setId(groupId)).build();
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
SimpleRegistry registry = new SimpleRegistry(signer, bulletinBoardClient, certStream);
|
2016-03-04 09:02:53 -05:00
|
|
|
registry.AddToGroups(voterInfo, handler);
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-02-20 11:54:22 -05:00
|
|
|
assertEquals(1, handler.counter);
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-27 04:27:19 -05:00
|
|
|
List<String> tags = new ArrayList<String>(){{add(RegistryTags.ADD_TO_GROUP_TAG);}};
|
2016-02-26 07:54:39 -05:00
|
|
|
MessageFilterList filters = CollectionMessagesUtils.GenerateFiltersFromTags(tags);
|
2016-02-19 11:41:02 -05:00
|
|
|
DummyBulletinBoardCallBackHandler bulletinHandler = new DummyBulletinBoardCallBackHandler();
|
2016-02-26 00:45:52 -05:00
|
|
|
bulletinBoardClient.readMessages(filters, bulletinHandler);
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
tags.add(voterId);
|
|
|
|
tags.add(groupId);
|
|
|
|
|
2016-02-27 06:46:36 -05:00
|
|
|
int counter = countMessagesWithTags(bulletinHandler.messages, tags);
|
2016-02-20 10:48:10 -05:00
|
|
|
assert counter == 1 : "The server don't have the new user added to group.";
|
2016-01-16 09:57:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-30 12:19:25 -05:00
|
|
|
* Test that remove from group creates correct bulletin board message and removes the user from a group
|
2016-01-16 09:57:12 -05:00
|
|
|
*/
|
2016-01-30 12:19:25 -05:00
|
|
|
public void testGetGroups() throws InvalidProtocolBufferException, InterruptedException {
|
2016-02-26 07:54:39 -05:00
|
|
|
DummyRegistryCallBackHandler<List<BulletinBoardMessage>> handler =
|
2016-02-19 11:41:02 -05:00
|
|
|
new DummyRegistryCallBackHandler<>();
|
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
String voterId = new BigInteger(130, random).toString(32);
|
|
|
|
String groupId = new BigInteger(130, random).toString(32);
|
2016-02-26 08:52:03 -05:00
|
|
|
VoterGroup voterInfo = VoterGroup.newBuilder()
|
|
|
|
.setVoterId(VoterID.newBuilder().setId(voterId))
|
2016-02-26 08:17:29 -05:00
|
|
|
.setGroupId(GroupID.newBuilder().setId(groupId)).build();
|
2016-01-30 12:19:25 -05:00
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
this.certStream = getClass().getResourceAsStream(CERT1_PEM_EXAMPLE);
|
|
|
|
|
|
|
|
SimpleRegistry registry = new SimpleRegistry(signer, bulletinBoardClient,certStream);
|
2016-03-04 09:02:53 -05:00
|
|
|
registry.AddToGroups(voterInfo, handler);
|
2016-01-30 12:19:25 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-02-20 11:54:22 -05:00
|
|
|
assertEquals(1, handler.counter );
|
2016-01-30 12:19:25 -05:00
|
|
|
|
2016-02-20 11:54:22 -05:00
|
|
|
DummyRegistryCallBackHandler<List<String>> groupsHandler = new DummyRegistryCallBackHandler<>();
|
2016-02-26 08:17:29 -05:00
|
|
|
registry.GetGroups(GroupID.newBuilder().setId(groupId).build(), groupsHandler);
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
jobSemaphore.acquire(1);
|
2016-02-20 11:54:22 -05:00
|
|
|
List<String> userGroups = groupsHandler.data;
|
|
|
|
assert userGroups.contains(RegistryTags.GROUP_ID_TAG + groupId) :
|
|
|
|
"The simple voter registry object does not retrieved right user groups";
|
2016-01-16 09:57:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test that the personal data outputted about the user is right
|
|
|
|
*/
|
2016-01-30 12:19:25 -05:00
|
|
|
public void testGetPersonalIDDetails() throws InvalidProtocolBufferException, InterruptedException {
|
2016-02-26 07:54:39 -05:00
|
|
|
DummyRegistryCallBackHandler<List<BulletinBoardMessage>> handler =
|
2016-02-20 10:48:10 -05:00
|
|
|
new DummyRegistryCallBackHandler<>();
|
|
|
|
|
|
|
|
String id = new BigInteger(130, random).toString(32);
|
|
|
|
String data = new BigInteger(130, random).toString(32);
|
2016-02-26 08:52:03 -05:00
|
|
|
VoterInfo voterInfo = VoterInfo.newBuilder().
|
|
|
|
setId(VoterID.newBuilder().setId(id)).setInfo(data).build();
|
2016-01-30 12:19:25 -05:00
|
|
|
|
2016-02-26 07:54:39 -05:00
|
|
|
SimpleRegistry registry = new SimpleRegistry(signer, bulletinBoardClient, certStream);
|
2016-02-19 11:41:02 -05:00
|
|
|
registry.AddVoter(voterInfo, handler);
|
2016-01-30 12:19:25 -05:00
|
|
|
|
2016-02-20 10:48:10 -05:00
|
|
|
jobSemaphore.acquire();
|
2016-02-20 11:54:22 -05:00
|
|
|
assertEquals(1, handler.counter );
|
2016-01-30 12:19:25 -05:00
|
|
|
|
2016-02-27 06:46:36 -05:00
|
|
|
DummyRegistryCallBackHandler<BulletinBoardMessage> personalHandler = new DummyRegistryCallBackHandler<>();
|
2016-02-26 08:17:29 -05:00
|
|
|
registry.GetPersonIDDetails(VoterID.newBuilder().setId(id).build(), personalHandler);
|
2016-02-19 11:41:02 -05:00
|
|
|
|
2016-02-26 08:52:03 -05:00
|
|
|
jobSemaphore.acquire(1);
|
2016-02-27 06:46:36 -05:00
|
|
|
assertEquals(RegistryTags.ID_TAG + id, CollectionMessagesUtils.GetTagByName(personalHandler
|
|
|
|
.data.getMsg().getTagList(), RegistryTags.ID_TAG));
|
|
|
|
assertTrue(CollectionMessagesUtils.GetTagByName(personalHandler.data.getMsg().getTagList(),
|
|
|
|
RegistryTags.VOTER_DATA_TAG).contains(data));
|
2016-01-16 09:57:12 -05:00
|
|
|
}
|
|
|
|
}
|
2016-02-26 08:52:03 -05:00
|
|
|
|