File tree Expand file tree Collapse file tree
src/test/groovy/com/featureprobe/api/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.featureprobe.api.service
22
33import com.featureprobe.api.auth.UserPasswordAuthenticationToken
44import com.featureprobe.api.base.enums.RoleEnum
5+ import com.featureprobe.api.base.exception.ForbiddenException
56import com.featureprobe.api.base.exception.ResourceConflictException
67import com.featureprobe.api.base.exception.ResourceNotFoundException
78import com.featureprobe.api.dto.MemberCreateRequest
@@ -117,6 +118,17 @@ class MemberServiceSpec extends Specification {
117118 }
118119 }
119120
121+ def " delete member failed when logged user is not admin" () {
122+ given :
123+ setAuthContext(" user" , " MEMBER" )
124+
125+ when :
126+ memberService. delete(" s1" )
127+
128+ then :
129+ thrown(ForbiddenException )
130+ }
131+
120132 def " update member visited time by account" () {
121133 when :
122134 memberService. updateVisitedTime(" test" )
You can’t perform that action at this time.
0 commit comments