Search in sources :

Example 6 with Slf4jIntLogger

use of com.blackducksoftware.integration.log.Slf4jIntLogger in project hub-alert by blackducksoftware.

the class LoginActionsTestIT method testIsUserValidFailIT.

@Test
public void testIsUserValidFailIT() throws IntegrationException, IOException {
    final LoginRestModel loginRestModel = mockLoginRestModel.createRestModel();
    final GlobalProperties globalProperties = new TestGlobalProperties();
    final HubServerConfigBuilder serverConfigBuilder = new HubServerConfigBuilder();
    serverConfigBuilder.setLogger(new Slf4jIntLogger(logger));
    serverConfigBuilder.setHubUrl(globalProperties.getHubUrl());
    serverConfigBuilder.setAlwaysTrustServerCertificate(globalProperties.getHubTrustCertificate());
    serverConfigBuilder.setTimeout(globalProperties.getHubTimeout());
    serverConfigBuilder.setPassword(loginRestModel.getHubPassword());
    serverConfigBuilder.setUsername(loginRestModel.getHubUsername());
    final LoginActions loginActions = new LoginActions(globalProperties);
    final RestConnection restConnection = loginActions.createRestConnection(serverConfigBuilder);
    final boolean roleValid = loginActions.isUserRoleValid("broken", restConnection);
    assertFalse(roleValid);
}
Also used : RestConnection(com.blackducksoftware.integration.hub.rest.RestConnection) LoginRestModel(com.blackducksoftware.integration.hub.alert.web.model.LoginRestModel) MockLoginRestModel(com.blackducksoftware.integration.hub.alert.mock.model.MockLoginRestModel) TestGlobalProperties(com.blackducksoftware.integration.hub.alert.TestGlobalProperties) GlobalProperties(com.blackducksoftware.integration.hub.alert.config.GlobalProperties) Slf4jIntLogger(com.blackducksoftware.integration.log.Slf4jIntLogger) HubServerConfigBuilder(com.blackducksoftware.integration.hub.configuration.HubServerConfigBuilder) TestGlobalProperties(com.blackducksoftware.integration.hub.alert.TestGlobalProperties) Test(org.junit.Test) HubConnectionTest(com.blackducksoftware.integration.test.annotation.HubConnectionTest)

Aggregations

Slf4jIntLogger (com.blackducksoftware.integration.log.Slf4jIntLogger)6 TestGlobalProperties (com.blackducksoftware.integration.hub.alert.TestGlobalProperties)5 HubConnectionTest (com.blackducksoftware.integration.test.annotation.HubConnectionTest)5 Test (org.junit.Test)5 MockLoginRestModel (com.blackducksoftware.integration.hub.alert.mock.model.MockLoginRestModel)2 HubServerConfigBuilder (com.blackducksoftware.integration.hub.configuration.HubServerConfigBuilder)2 RestConnection (com.blackducksoftware.integration.hub.rest.RestConnection)2 IntegrationException (com.blackducksoftware.integration.exception.IntegrationException)1 GlobalProperties (com.blackducksoftware.integration.hub.alert.config.GlobalProperties)1 GlobalHubConfigEntity (com.blackducksoftware.integration.hub.alert.datasource.entity.global.GlobalHubConfigEntity)1 LoginRestModel (com.blackducksoftware.integration.hub.alert.web.model.LoginRestModel)1