Class StrictnessSelector


  • public final class StrictnessSelector
    extends java.lang.Object
    Helps determining the actual strictness given that it can be configured in multiple ways (at mock, at stubbing, in rule)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private StrictnessSelector()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Strictness determineStrictness​(Stubbing stubbing, MockCreationSettings mockSettings, Strictness testLevelStrictness)
      Determines the actual strictness in the following importance order: 1st - strictness configured when declaring stubbing; 2nd - strictness configured at mock level; 3rd - strictness configured at test level (rule, mockito session)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StrictnessSelector

        private StrictnessSelector()
    • Method Detail

      • determineStrictness

        public static Strictness determineStrictness​(Stubbing stubbing,
                                                     MockCreationSettings mockSettings,
                                                     Strictness testLevelStrictness)
        Determines the actual strictness in the following importance order: 1st - strictness configured when declaring stubbing; 2nd - strictness configured at mock level; 3rd - strictness configured at test level (rule, mockito session)
        Parameters:
        stubbing - stubbing to check for strictness. Null permitted.
        mockSettings - settings of the mock object, may or may not have strictness configured. Must not be null.
        testLevelStrictness - strictness configured using the test-level configuration (rule, mockito session). Null permitted.
        Returns:
        actual strictness, can be null.