use of com.quorum.tessera.test.PartyHelper in project tessera by ConsenSys.
the class OpenApiIT method setUp.
@Before
public void setUp() {
PartyHelper partyHelper = PartyHelper.create();
node = partyHelper.getParties().findFirst().get();
client = node.getRestClient();
LOGGER.debug("Begin test: {}", testName.getMethodName());
}
use of com.quorum.tessera.test.PartyHelper in project tessera by ConsenSys.
the class ReceiveIT method beforeTest.
// Persist a single transaction that can be used later
@Before
public void beforeTest() throws UnsupportedEncodingException {
final PartyHelper partyHelper = PartyHelper.create();
partyOne = partyHelper.findByAlias("A");
partyTwo = partyHelper.findByAlias("B");
SendRequest sendRequest = new SendRequest();
sendRequest.setFrom(partyOne.getPublicKey());
sendRequest.setTo(partyTwo.getPublicKey());
sendRequest.setPayload(transactionData);
final Response response = partyOne.getRestClient().target(partyOne.getQ2TUri()).path("/send").request().post(Entity.entity(sendRequest, MIME_TYPE_JSON_2_1));
assertThat(response.getStatus()).isEqualTo(201);
final SendResponse result = response.readEntity(SendResponse.class);
final String hash = result.getKey();
this.encodedHash = URLEncoder.encode(hash, UTF_8.toString());
this.encodedSender = URLEncoder.encode(partyOne.getPublicKey(), UTF_8.toString());
this.encodedRecipient = URLEncoder.encode(partyTwo.getPublicKey(), UTF_8.toString());
}
use of com.quorum.tessera.test.PartyHelper in project tessera by ConsenSys.
the class MetricsIT method metrics.
@Test
public void metrics() {
final PartyHelper partyHelper = PartyHelper.create();
Set<ServerConfig> serverConfigs = partyHelper.getParties().map(Party::getConfig).map(Config::getServerConfigs).flatMap(List::stream).collect(Collectors.toUnmodifiableSet());
ClientFactory clientFactory = new ClientFactory();
for (ServerConfig serverConfig : serverConfigs) {
Client c = clientFactory.buildFrom(serverConfig);
Response response = c.target(serverConfig.getServerUri()).path("metrics").request().get();
assertThat(response).isNotNull();
assertThat(response.getStatus()).isEqualTo(200);
}
}
Aggregations