Beispiel #1
0
        public virtual void testReportNowIfMetricsIsDisabled()
        {
            var defaultIsMetricsEnabled = processEngineConfiguration.MetricsEnabled;

            // given
            processEngineConfiguration.SetMetricsEnabled(false);

            try
            {
                // when
                managementService.ReportDbMetricsNow();
                Assert.Fail("Exception expected");
            }
            catch (ProcessEngineException e)
            {
                // then an exception is thrown
                Assert.True(e.Message.Contains("Metrics reporting is disabled"));
            }
            finally
            {
                // reset metrics setting
                processEngineConfiguration.SetMetricsEnabled(defaultIsMetricsEnabled);
            }
        }