def test_dispatch_success_with_validation_disabled_and_invalid_payload(self):
        """
        Tests that an invalid payload still results in dispatch success with default config

        The previous config defition used StrOpt instead of BoolOpt for
        cfg.CONF.system.validate_trigger_payload. This meant that even though the intention
        was to bypass validation, the fact that this option was a string, meant it always
        resulted in True during conditionals.the

        However, the other unit tests directly modified
        cfg.CONF.system.validate_trigger_payload before running, which
        obscured this bug during testing.

        This test (as well as resetting cfg.CONF.system.validate_trigger_payload
        to it's original value during tearDown) will test validation does
        NOT take place with the default configuration.
        """
        cfg.CONF.system.validate_trigger_payload = False

        # define a invalid payload (the type of 'age' is incorrect)
        payload = {
            "name": "John Doe",
            "age": "25",
        }

        self.sensor_service.dispatch("trigger-name", payload)

        # The default config is to disable validation. So, we want to make sure
        # the dispatch actually went through.
        self.assertEqual(self._dispatched_count, 1)

        Tests that an invalid payload still results in dispatch success with default config

        The previous config defition used StrOpt instead of BoolOpt for
        cfg.CONF.system.validate_trigger_payload. This meant that even though the intention
        was to bypass validation, the fact that this option was a string, meant it always
        resulted in True during conditionals.the

        However, the other unit tests directly modified
        cfg.CONF.system.validate_trigger_payload before running, which
        obscured this bug during testing.

        This test (as well as resetting cfg.CONF.system.validate_trigger_payload
        to it's original value during tearDown) will test validation does
        NOT take place with the default configuration.
        
st2reactor/tests/unit/test_sensor_service.py