public void testRegisterProcessSuccess() throws InvalidProcessStateException, ClassNotFoundException,
IOException, GetFailedException, NoPeerConnectionException {
NetworkManager client = network.get(0);
NetworkManager otherClient = network.get(1);
UserCredentials credentials = NetworkTestUtil.generateRandomCredentials();
UseCaseTestUtil.register(credentials, client);
// verify put user profile
UserProfile getUserProfile = UseCaseTestUtil.getUserProfile(otherClient, credentials);
assertNotNull(getUserProfile);
assertEquals(credentials.getUserId(), getUserProfile.getUserId());
// verify put locations
FutureGet getLocations = otherClient.getDataManager().getUnblocked(
new Parameters().setLocationKey(credentials.getUserId()).setContentKey(
H2HConstants.USER_LOCATIONS));
getLocations.awaitUninterruptibly();
getLocations.getFutureRequests().awaitUninterruptibly();
Locations locations = (Locations) getLocations.getData().object();
assertNotNull(locations);
assertEquals(credentials.getUserId(), locations.getUserId());
assertTrue(locations.getPeerAddresses().isEmpty());
// verify put user public key
FutureGet getKey = otherClient.getDataManager().getUnblocked(
new Parameters().setLocationKey(credentials.getUserId()).setContentKey(
H2HConstants.USER_PUBLIC_KEY));
getKey.awaitUninterruptibly();
getKey.getFutureRequests().awaitUninterruptibly();
UserPublicKey publicKey = (UserPublicKey) getKey.getData().object();