Skip to content

Commit

Permalink
slack notifier switch to native maven build
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir I committed Nov 14, 2023
1 parent 39667d8 commit 13edd76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import jetbrains.buildServer.notification.*
import jetbrains.buildServer.notification.slackNotifier.notification.*
import jetbrains.buildServer.notification.slackNotifier.slack.*
import jetbrains.buildServer.serverSide.*
import jetbrains.buildServer.serverSide.auth.Role
import jetbrains.buildServer.serverSide.auth.RoleScope
import jetbrains.buildServer.serverSide.impl.NotificationRulesConstants
import jetbrains.buildServer.serverSide.impl.approval.ApprovalBuildFeatureConfiguration
import jetbrains.buildServer.serverSide.oauth.OAuthConnectionDescriptor
Expand Down Expand Up @@ -159,6 +161,10 @@ open class BaseSlackTestCase : BaseNotificationRulesTestCase() {
storeRules(myUser, myNotifier, newRule(*events))
}

fun `given user has role for the project`(role: Role) {
myUser.addRole(RoleScope.projectScope(myProject.projectId), role)
}

fun `given build feature is subscribed to`(vararg events: NotificationRule.Event) {
addBuildFeature(*events)
}
Expand Down Expand Up @@ -307,7 +313,6 @@ open class BaseSlackTestCase : BaseNotificationRulesTestCase() {
ApprovalConstants.FEATURE_SETTING_MANUAL_START_IS_APPROVAL to true.toString()
)
)

return addToQueue(myBuildType)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class SlackNotifierTest : BaseSlackTestCase() {
@Test
fun `should send notification about build that requires approval`() {
`given user is subscribed to`(QUEUED_BUILD_REQUIRES_APPROVAL)
`given user has role for the project`(projectDevRole)
`when approvable build is queued`()
`then message should contain`("is waiting for approval") And
1.`messages should be sent`()
Expand Down

0 comments on commit 13edd76

Please sign in to comment.