use of org.infinispan.rest.authentication.SecurityDomain in project infinispan by infinispan.
the class AuthenticationTest method beforeMethod.
@BeforeMethod(alwaysRun = true)
public void beforeMethod() {
SecurityDomain securityDomainMock = mock(SecurityDomain.class);
Subject user = TestingUtil.makeSubject("test");
doReturn(user).when(securityDomainMock).authenticate(eq("test"), eq("test"));
BasicAuthenticator basicAuthenticator = new BasicAuthenticator(securityDomainMock, REALM);
restServer = RestServerHelper.defaultRestServer().withAuthenticator(basicAuthenticator).start(TestResourceTracker.getCurrentTestShortName());
RestClientConfigurationBuilder configurationBuilder = new RestClientConfigurationBuilder();
configurationBuilder.addServer().host(restServer.getHost()).port(restServer.getPort());
client = RestClient.forConfiguration(configurationBuilder.build());
}
Aggregations