network = NetworkTestUtil.createNetwork(networkSize);
}
@Test
public void testPutProcessSuccess() throws ClassNotFoundException, IOException, NoPeerConnectionException {
NetworkManager putter = network.get(0);
putter.getConnection().getPeer().getPeerBean().storage(new H2HStorageMemory());
NetworkManager proxy = network.get(1);
proxy.getConnection().getPeer().getPeerBean().storage(new H2HStorageMemory());
String locationKey = proxy.getNodeId();
String contentKey = NetworkTestUtil.randomString();
String data = NetworkTestUtil.randomString();
// initialize the process and the one and only step to test
TestPutProcessStep putStep = new TestPutProcessStep(locationKey, contentKey, new H2HTestData(data),
putter.getDataManager());
UseCaseTestUtil.executeProcess(putStep);
FutureGet futureGet = proxy.getDataManager().getUnblocked(
new Parameters().setLocationKey(locationKey).setContentKey(contentKey));
futureGet.awaitUninterruptibly();
assertEquals(data, ((H2HTestData) futureGet.getData().object()).getTestString());
}