use of fish.payara.samples.dynamic.roles.common.AuthoritiesConstants.DEFAULT_USER in project Payara by payara.
the class PersonControllerClientHelper method getPersonControllerClient.
public static PersonControllerClient getPersonControllerClient(URL deploymentUrl, String username, String password) {
try {
RestClientBuilder builder = RestClientBuilder.newBuilder();
builder.register((ClientRequestFilter) context -> {
context.getHeaders().add("username", DEFAULT_USER);
context.getHeaders().add("password", DEFAULT_PASSWORD);
});
PersonControllerClient client = builder.baseUrl(new URL(deploymentUrl.toURI().toString() + "resources/")).build(PersonControllerClient.class);
return client;
} catch (URISyntaxException | MalformedURLException ex) {
throw new IllegalStateException(ex);
}
}
Aggregations