use of com.quorum.tessera.config.Peer in project tessera by ConsenSys.
the class PicoCliDelegateTest method overridePeers.
@Test
public void overridePeers() throws Exception {
Path configFile = Paths.get(getClass().getResource("/sample-config.json").toURI());
CliResult result = cliDelegate.execute("-configfile", configFile.toString(), "-o", "peer[2].url=http://anotherpeer", "--override", "peer[3].url=http://yetanotherpeer");
assertThat(result).isNotNull();
assertThat(result.getConfig()).isPresent();
assertThat(result.getConfig().get().getPeers()).hasSize(4);
assertThat(result.getConfig().get().getPeers().stream().map(Peer::getUrl)).containsExactlyInAnyOrder("http://anotherpeer", "http://yetanotherpeer", "http://bogus1.com", "http://bogus2.com");
}
use of com.quorum.tessera.config.Peer in project tessera by ConsenSys.
the class AdminConfigIT method addPeer.
@Test
public void addPeer() {
Party party = partyHelper.getParties().findAny().get();
String url = "http://" + UUID.randomUUID().toString().replaceAll("-", "");
Peer peer = new Peer(url);
Response response = client.target(party.getAdminUri()).path("config").path("peers").request(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).put(Entity.entity(peer, MediaType.APPLICATION_JSON));
assertThat(response.getStatus()).isEqualTo(201);
URI location = response.getLocation();
Response queryResponse = client.target(location).request(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).get();
assertThat(queryResponse.getStatus()).isEqualTo(200);
assertThat(queryResponse.readEntity(Peer.class)).isEqualTo(peer);
}