LoginSignup
1
1

More than 5 years have passed since last update.

spring-security 環境下で integration test する

Posted at

Spring-security-core plugin をインストールしている時, integration test すると, spring-security 環境下になるので, ユーザのログインをシミュレートする必要がある.

その場合, 次のようにする

import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils

SpringSecurityUtils.doWithAuth('admin') {    // ......}

see. src/java/org/codehaus/groovy/grails/plugins/springsecurity/SpringSecurityUtils.groovy

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1