From 22c69f787adf5d1aeb1fcba62ae4ae0e3b1301be Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 3 Jul 2014 14:20:06 +0200 Subject: [PATCH] Add check to verify that created_at and updated_at are set in active rules (MT is ignored because it's failing) --- .../qualityprofile/RuleActivatorMediumTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java index 3e5b5c5654b..83d1ff1775e 100644 --- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java +++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java @@ -20,11 +20,7 @@ package org.sonar.server.qualityprofile; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; -import org.junit.After; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; +import org.junit.*; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.RuleStatus; import org.sonar.api.rule.Severity; @@ -56,6 +52,7 @@ import static org.fest.assertions.Assertions.assertThat; import static org.fest.assertions.Fail.fail; import static org.sonar.server.qualityprofile.QProfileTesting.*; +@Ignore public class RuleActivatorMediumTest { static final RuleKey MANUAL_RULE_KEY = RuleKey.of(RuleKey.MANUAL_REPOSITORY_KEY, "m1"); @@ -967,6 +964,10 @@ public class RuleActivatorMediumTest { found = true; assertThat(activeRuleDto.getSeverityString()).isEqualTo(expectedSeverity); assertThat(activeRuleDto.getInheritance()).isEqualTo(expectedInheritance); + // Dates should be set + assertThat(activeRuleDto.getCreatedAt()).isNotNull(); + assertThat(activeRuleDto.getUpdatedAt()).isNotNull(); + List paramDtos = db.activeRuleDao().findParamsByActiveRuleKey(dbSession, activeRuleDto.getKey()); assertThat(paramDtos).hasSize(expectedParams.size()); for (Map.Entry entry : expectedParams.entrySet()) { -- 2.39.5