use of org.apache.metron.hbase.client.UserSettingsClient in project metron by apache.
the class HBaseConfig method userSettingsClient.
@Bean()
public UserSettingsClient userSettingsClient() {
UserSettingsClient userSettingsClient = new UserSettingsClient();
userSettingsClient.init(() -> {
try {
return globalConfigService.get();
} catch (RestException e) {
throw new IllegalStateException("Unable to retrieve the global config.", e);
}
}, new HTableProvider());
return userSettingsClient;
}
use of org.apache.metron.hbase.client.UserSettingsClient in project metron by apache.
the class AlertsUIServiceImplTest method setUp.
@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
kafkaService = mock(KafkaService.class);
environment = mock(Environment.class);
userSettingsClient = mock(UserSettingsClient.class);
alertsUIService = new AlertsUIServiceImpl(kafkaService, environment, userSettingsClient);
// assume user1 is logged in for tests
Authentication authentication = Mockito.mock(Authentication.class);
UserDetails userDetails = Mockito.mock(UserDetails.class);
when(authentication.getPrincipal()).thenReturn(userDetails);
when(userDetails.getUsername()).thenReturn(user1);
SecurityContextHolder.getContext().setAuthentication(authentication);
}
Aggregations