クラス WithSecurityContextTestExecutionListener

    • フィールドサマリー

      • インターフェース org.springframework.core.Ordered から継承されたフィールド

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • メソッドのサマリー

      すべてのメソッド   インスタンスメソッド   具象メソッド  
      修飾子と型 メソッド 説明
      voidafterTestMethod​(org.springframework.test.context.TestContext testContext)
      各テストメソッドの後に TestSecurityContextHolderSecurityContextHolder をクリアします。
      voidbeforeTestExecution​(org.springframework.test.context.TestContext testContext)
      テスト実行前に構成されている場合、SecurityContext が設定されます
      voidbeforeTestMethod​(org.springframework.test.context.TestContext testContext)
      テストメソッドごとに SecurityContext を設定します。
      intgetOrder()
      10000 を返します。
      • クラス org.springframework.test.context.support.AbstractTestExecutionListener から継承されたメソッド

        afterTestClass, afterTestExecution, beforeTestClass, prepareTestInstance
      • クラス java.lang.Object から継承されたメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • コンストラクターの詳細

      • WithSecurityContextTestExecutionListener

        public WithSecurityContextTestExecutionListener()
    • メソッドの詳細

      • beforeTestMethod

        public void beforeTestMethod​(org.springframework.test.context.TestContext testContext)
        テストメソッドごとに SecurityContext を設定します。最初に、特定のメソッドで、WithSecurityContext が含まれている WithSecurityContext または Annotation がインスペクションされます。それが見つからない場合は、クラスがインスペクションされます。それでも見つからない場合は、SecurityContext は入力されていません。
        次で指定:
        インターフェース org.springframework.test.context.TestExecutionListenerbeforeTestMethod 
        オーバーライド:
        クラス org.springframework.test.context.support.AbstractTestExecutionListenerbeforeTestMethod 
      • beforeTestExecution

        public void beforeTestExecution​(org.springframework.test.context.TestContext testContext)
        テスト実行前に構成されている場合、SecurityContext が設定されます
        次で指定:
        インターフェース org.springframework.test.context.TestExecutionListenerbeforeTestExecution 
        オーバーライド:
        クラス org.springframework.test.context.support.AbstractTestExecutionListenerbeforeTestExecution 
        導入:
        5.1
      • afterTestMethod

        public void afterTestMethod​(org.springframework.test.context.TestContext testContext)
        各テストメソッドの後に TestSecurityContextHolderSecurityContextHolder をクリアします。
        次で指定:
        インターフェース org.springframework.test.context.TestExecutionListenerafterTestMethod 
        オーバーライド:
        クラス org.springframework.test.context.support.AbstractTestExecutionListenerafterTestMethod 
      • getOrder

        public int getOrder()
        10000 を返します。
        次で指定:
        インターフェース org.springframework.core.OrderedgetOrder 
        オーバーライド:
        クラス org.springframework.test.context.support.AbstractTestExecutionListenergetOrder