use of org.jboss.pnc.common.json.moduleconfig.SystemConfig in project pnc by project-ncl.
the class MessageSenderProviderTest method shouldNotGetMessageSenderWithInvalidId.
@Test
public void shouldNotGetMessageSenderWithInvalidId() {
// given
Instance<MessageSender> messageSenders = getMessageSenders();
SystemConfig systemConfig = Mockito.mock(SystemConfig.class);
Mockito.when(systemConfig.getMessageSenderId()).thenReturn("invalidId");
Exception exception = null;
// when
try {
new MessageSenderProvider(messageSenders, systemConfig);
} catch (MessagingConfigurationException e) {
exception = e;
}
// expect
Assert.assertTrue(exception instanceof MessagingConfigurationException);
}
use of org.jboss.pnc.common.json.moduleconfig.SystemConfig in project pnc by project-ncl.
the class BuildCoordinatorFactory method createBuildCoordinator.
public BuildCoordinatorBeans createBuildCoordinator(DatastoreMock datastore) {
DatastoreAdapter datastoreAdapter = new DatastoreAdapter(datastore);
SystemConfig systemConfig = createConfiguration();
BuildQueue queue = new BuildQueue(systemConfig);
LocalBuildSchedulerMock localBuildScheduler = new LocalBuildSchedulerMock();
BuildSchedulerFactory buildSchedulerFactory = new BuildSchedulerFactory() {
@Override
public BuildScheduler getBuildScheduler() {
return localBuildScheduler;
}
};
BuildCoordinator coordinator = new DefaultBuildCoordinator(datastoreAdapter, buildStatusChangedEventNotifier, buildSetStatusChangedEventNotifier, buildSchedulerFactory, queue, systemConfig, groupBuildMapper, buildMapper);
localBuildScheduler.setBuildCoordinator(coordinator);
coordinator.start();
queue.initSemaphore();
return new BuildCoordinatorBeans(queue, coordinator);
}
use of org.jboss.pnc.common.json.moduleconfig.SystemConfig in project pnc by project-ncl.
the class KeycloakServiceClientTest method shouldObtainAuthToken.
@Test
public void shouldObtainAuthToken() throws ConfigurationParseException, IOException {
SystemConfig systemConfig = SystemConfigMock.withKeycloakServiceAccount();
KeycloakServiceClient keycloakServiceClient = new DefaultKeycloakServiceClient(systemConfig);
String authToken = keycloakServiceClient.getAuthToken();
Assertions.assertThat(authToken).isNotEmpty();
}
Aggregations