Search in sources :

Example 1 with SlackUserProperty

use of jenkins.plugins.slack.user.SlackUserProperty in project configuration-as-code-plugin by jenkinsci.

the class HudsonPrivateSecurityRealmConfiguratorTest method configure_all_attributes.

@Test
@ConfiguredWithReadme("embedded-userdatabase/README.md#1")
public void configure_all_attributes() {
    final User admin = User.getById("admin", false);
    assertNotNull(admin);
    assertThat(admin.getFullName(), is("Admin"));
    assertThat(admin.getDescription(), is("Superwoman"));
    SlackUserProperty slackUserProperty = admin.getProperty(SlackUserProperty.class);
    assertThat(slackUserProperty.getUserId(), is("ABCDEFGH"));
    UserProperty mailerProperty = admin.getProperty(UserProperty.class);
    assertThat(mailerProperty.getEmailAddress(), is("admin3@example.com"));
// Pending https://github.com/jenkinsci/ssh-cli-auth-module/pull/16
// UserPropertyImpl authorizedKeysProperty = admin.getProperty(UserPropertyImpl.class);
// assertThat(authorizedKeysProperty.authorizedKeys, is("ssh-rsa some-key\n"));
}
Also used : User(hudson.model.User) SlackUserProperty(jenkins.plugins.slack.user.SlackUserProperty) UserProperty(hudson.tasks.Mailer.UserProperty) SlackUserProperty(jenkins.plugins.slack.user.SlackUserProperty) Test(org.junit.Test) ConfiguredWithReadme(io.jenkins.plugins.casc.misc.ConfiguredWithReadme)

Aggregations

User (hudson.model.User)1 UserProperty (hudson.tasks.Mailer.UserProperty)1 ConfiguredWithReadme (io.jenkins.plugins.casc.misc.ConfiguredWithReadme)1 SlackUserProperty (jenkins.plugins.slack.user.SlackUserProperty)1 Test (org.junit.Test)1