org.springframework.boot.test.mock.mockito

Enum MockReset

    • Enum Constant Detail

      • BEFORE

        public static final MockReset BEFORE
        Reset the mock before the test method runs.
      • AFTER

        public static final MockReset AFTER
        Reset the mock after the test method runs.
      • NONE

        public static final MockReset NONE
        Don't reset the mock.
    • Method Detail

      • values

        public static MockReset[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MockReset c : MockReset.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MockReset valueOf(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • before

        public static org.mockito.MockSettings before()
        Create settings to be used with mocks where reset should occur before each test method runs.
        Returns:
        mock settings
      • after

        public static org.mockito.MockSettings after()
        Create settings to be used with mocks where reset should occur after each test method runs.
        Returns:
        mock settings
      • withSettings

        public static org.mockito.MockSettings withSettings(MockReset reset)
        Create settings to be used with mocks where a specific reset should occur.
        Parameters:
        reset - the reset type
        Returns:
        mock settings
      • apply

        public static org.mockito.MockSettings apply(MockReset reset,
                                                     org.mockito.MockSettings settings)
        Apply MockReset to existing settings.
        Parameters:
        reset - the reset type
        settings - the settings
        Returns:
        the configured settings