diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-01-10 07:15:03 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-01-10 07:15:08 +0100 |
commit | 2faaf7e16a03e69c4ff5f9c53805a387211a0872 (patch) | |
tree | fed31d45904142eff2e4b501883f08d5f07f0ce8 /server | |
parent | 3167bed5685e9f4b87e3482cdde2ac95897c8cfd (diff) | |
download | sonarqube-2faaf7e16a03e69c4ff5f9c53805a387211a0872.tar.gz sonarqube-2faaf7e16a03e69c4ff5f9c53805a387211a0872.zip |
Replace fest-assert by assertJ
Diffstat (limited to 'server')
353 files changed, 706 insertions, 732 deletions
diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaCommandTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaCommandTest.java index 689f061ff06..c6e96e1e3f4 100644 --- a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaCommandTest.java +++ b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaCommandTest.java @@ -26,7 +26,7 @@ import org.junit.rules.TemporaryFolder; import java.io.File; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class JavaCommandTest { diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaProcessLauncherTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaProcessLauncherTest.java index 80def695fb1..f88481019c8 100644 --- a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaProcessLauncherTest.java +++ b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaProcessLauncherTest.java @@ -21,8 +21,8 @@ package org.sonar.process.monitor; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class JavaProcessLauncherTest { diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java index 289b371c46c..46200f45b7b 100644 --- a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java +++ b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java @@ -37,8 +37,8 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class MonitorTest { diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/TimeoutsTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/TimeoutsTest.java index dc5e63055ae..be954cb149f 100644 --- a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/TimeoutsTest.java +++ b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/TimeoutsTest.java @@ -21,7 +21,7 @@ package org.sonar.process.monitor; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class TimeoutsTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java b/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java index 8350eafaa3e..58e4d594fea 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java @@ -32,8 +32,8 @@ import java.io.File; import java.security.InvalidKeyException; import java.security.Key; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class AesCipherTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java b/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java index cd92bbf4e7e..6ed9dc357cb 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java @@ -30,8 +30,8 @@ import java.io.File; import java.util.Map; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ConfigurationUtilsTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/LifecycleTest.java b/server/sonar-process/src/test/java/org/sonar/process/LifecycleTest.java index 0ab9f3a29ba..11b267b3e77 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/LifecycleTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/LifecycleTest.java @@ -21,7 +21,7 @@ package org.sonar.process; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.process.Lifecycle.State; public class LifecycleTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java b/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java index 8ccafff1f66..782923d9aee 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java @@ -27,8 +27,8 @@ import java.net.NetworkInterface; import java.util.Collections; import java.util.Enumeration; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class LoopbackAddressTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/MinimumViableSystemTest.java b/server/sonar-process/src/test/java/org/sonar/process/MinimumViableSystemTest.java index 83841c79952..de339683db6 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/MinimumViableSystemTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/MinimumViableSystemTest.java @@ -19,14 +19,14 @@ */ package org.sonar.process; -import org.fest.assertions.Assertions; +import org.assertj.core.api.Assertions; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import java.io.File; -import static org.fest.assertions.Fail.fail; +import static org.junit.Assert.fail; public class MinimumViableSystemTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java b/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java index 052c67d94fe..c14aa4daa9b 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java @@ -22,7 +22,7 @@ package org.sonar.process; import org.junit.Test; import org.sonar.test.TestUtils; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class NetworkUtilsTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/ProcessCommandsTest.java b/server/sonar-process/src/test/java/org/sonar/process/ProcessCommandsTest.java index 984fbed74f7..0e163a8f1e3 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ProcessCommandsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ProcessCommandsTest.java @@ -26,8 +26,8 @@ import org.junit.rules.TemporaryFolder; import java.io.File; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java b/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java index e24f51b62e1..1857b7cc93b 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java @@ -32,8 +32,8 @@ import org.sonar.process.test.StandardProcess; import java.io.File; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class ProcessEntryPointTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java b/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java index 1a18d5983ae..fa97e2ae2f4 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java @@ -22,7 +22,7 @@ package org.sonar.process; import org.junit.Test; import org.sonar.test.TestUtils; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ProcessUtilsTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/PropsTest.java b/server/sonar-process/src/test/java/org/sonar/process/PropsTest.java index 25feeef39b8..8af1e96c086 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/PropsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/PropsTest.java @@ -27,8 +27,8 @@ import java.io.File; import java.io.IOException; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class PropsTest { diff --git a/server/sonar-process/src/test/java/org/sonar/process/SystemExitTest.java b/server/sonar-process/src/test/java/org/sonar/process/SystemExitTest.java index e02b07cf555..d2bb4e495c5 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/SystemExitTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/SystemExitTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import java.util.concurrent.atomic.AtomicInteger; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SystemExitTest { diff --git a/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java b/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java index 8a9823eccc6..3b012798916 100644 --- a/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java +++ b/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java @@ -39,8 +39,8 @@ import org.sonar.process.Props; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class SearchServerTest { diff --git a/server/sonar-search/src/test/java/org/sonar/search/SearchSettingsTest.java b/server/sonar-search/src/test/java/org/sonar/search/SearchSettingsTest.java index ee24ef492a0..78828e1804f 100644 --- a/server/sonar-search/src/test/java/org/sonar/search/SearchSettingsTest.java +++ b/server/sonar-search/src/test/java/org/sonar/search/SearchSettingsTest.java @@ -31,8 +31,8 @@ import java.io.File; import java.io.IOException; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class SearchSettingsTest { diff --git a/server/sonar-search/src/test/java/org/sonar/search/script/UpdateListScriptTest.java b/server/sonar-search/src/test/java/org/sonar/search/script/UpdateListScriptTest.java index a645cb99647..d0b6a19da8b 100644 --- a/server/sonar-search/src/test/java/org/sonar/search/script/UpdateListScriptTest.java +++ b/server/sonar-search/src/test/java/org/sonar/search/script/UpdateListScriptTest.java @@ -29,8 +29,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class UpdateListScriptTest { diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java index 4b5eb5eeb2f..843308ca2ea 100644 --- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java +++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java @@ -38,7 +38,7 @@ import java.sql.SQLException; import java.util.Timer; import java.util.concurrent.atomic.AtomicLong; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SourceDbBenchmarkTest { diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java index 313b407ffbc..1fa0fde3b81 100644 --- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java +++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java @@ -40,7 +40,7 @@ import java.util.List; import java.util.Timer; import java.util.concurrent.atomic.AtomicLong; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Performance tests of the Elasticsearch index sourcelines diff --git a/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityBackendMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityBackendMediumTest.java index 436654e69fc..d89298a63db 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityBackendMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityBackendMediumTest.java @@ -41,7 +41,7 @@ import org.sonar.server.tester.ServerTester; import java.util.Iterator; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActivityBackendMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityServiceMediumTest.java index 2bd347355dc..71fec3c117d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/activity/ActivityServiceMediumTest.java @@ -43,7 +43,7 @@ import org.sonar.server.tester.ServerTester; import java.util.Iterator; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActivityServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/activity/RubyQProfileActivityServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/activity/RubyQProfileActivityServiceTest.java index ddc33112ad5..10a2e55b65f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/activity/RubyQProfileActivityServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/activity/RubyQProfileActivityServiceTest.java @@ -39,7 +39,7 @@ import org.sonar.server.search.Result; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/activity/db/ActivityDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/activity/db/ActivityDaoTest.java index 802fba978d9..1a2cd967c17 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/activity/db/ActivityDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/activity/db/ActivityDaoTest.java @@ -35,7 +35,7 @@ import org.sonar.core.persistence.DbSession; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class ActivityDaoTest extends AbstractDaoTestCase { diff --git a/server/sonar-server/src/test/java/org/sonar/server/activity/ws/ActivitiesWebServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/activity/ws/ActivitiesWebServiceMediumTest.java index 3559f3cc83a..36920b23461 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/activity/ws/ActivitiesWebServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/activity/ws/ActivitiesWebServiceMediumTest.java @@ -32,7 +32,7 @@ import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActivitiesWebServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/app/ConnectorsTest.java b/server/sonar-server/src/test/java/org/sonar/server/app/ConnectorsTest.java index bef81bc8035..70ba503943b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/app/ConnectorsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/app/ConnectorsTest.java @@ -32,8 +32,8 @@ import java.net.InetAddress; import java.util.Map; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.argThat; diff --git a/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java b/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java index 27dbdc6d77a..db343c6e919 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java @@ -30,8 +30,8 @@ import org.sonar.process.Props; import java.io.File; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/authentication/ws/AuthenticationWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/authentication/ws/AuthenticationWsTest.java index e4d33fb790b..4fc95886c14 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/authentication/ws/AuthenticationWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/authentication/ws/AuthenticationWsTest.java @@ -25,7 +25,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class AuthenticationWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/BatchIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchIndexTest.java index 91d007d7a39..6fbf6aa4ce4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/batch/BatchIndexTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchIndexTest.java @@ -31,7 +31,7 @@ import org.sonar.api.platform.Server; import java.io.File; import java.io.IOException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsTest.java index a51eee53dd0..d2a01b11f67 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsTest.java @@ -35,7 +35,7 @@ import org.sonar.server.ws.WsTester; import java.io.File; import java.io.IOException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsActionTest.java index cffed5b6aa9..70789b842e8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsActionTest.java @@ -29,7 +29,7 @@ import org.mockito.runners.MockitoJUnitRunner; import org.sonar.batch.protocol.input.ProjectReferentials; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsLoaderMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsLoaderMediumTest.java index 42a8b6bec2b..c4ccf2ae1f2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsLoaderMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectReferentialsLoaderMediumTest.java @@ -57,8 +57,8 @@ import java.util.List; import java.util.Map; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProjectReferentialsLoaderMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentCleanerServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentCleanerServiceMediumTest.java index de5149cb00f..5c2268872f3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentCleanerServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentCleanerServiceMediumTest.java @@ -46,7 +46,7 @@ import org.sonar.server.search.IndexClient; import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ComponentCleanerServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentQueryTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentQueryTest.java index de83dd77452..0b2136f67ff 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentQueryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentQueryTest.java @@ -23,7 +23,7 @@ package org.sonar.server.component; import org.junit.Test; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ComponentQueryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceMediumTest.java index f54fad6aa91..0720efa9422 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceMediumTest.java @@ -20,7 +20,7 @@ package org.sonar.server.component; -import org.fest.assertions.Fail; +import org.assertj.core.api.Fail; import org.junit.After; import org.junit.Before; import org.junit.ClassRule; @@ -45,8 +45,8 @@ import org.sonar.server.user.MockUserSession; import java.util.Arrays; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ComponentServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentsFinderSortTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentsFinderSortTest.java index 08b98c5eab7..1e2cd6f51e7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentsFinderSortTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentsFinderSortTest.java @@ -27,7 +27,7 @@ import org.sonar.core.component.ComponentDto; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/DefaultComponentFinderTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/DefaultComponentFinderTest.java index c1f4f5bc43c..50c4b4c4d6f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/DefaultComponentFinderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/DefaultComponentFinderTest.java @@ -28,7 +28,7 @@ import java.util.Iterator; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DefaultComponentFinderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/DefaultRubyComponentServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/DefaultRubyComponentServiceTest.java index d41bc6beca9..b9483a0015f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/DefaultRubyComponentServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/DefaultRubyComponentServiceTest.java @@ -35,7 +35,7 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyListOf; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java index 8e3532cbe8e..ac8fafe3fe1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java @@ -36,7 +36,7 @@ import java.util.Date; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -336,13 +336,11 @@ public class ComponentDaoTest extends AbstractDaoTestCase { // From root project List<ComponentDto> modules = dao.findChildrenModulesFromModule(session, "org.struts:struts"); - assertThat(modules).hasSize(2); - assertThat(modules).onProperty("id").containsOnly(2L, 3L); + assertThat(modules).extracting("id").containsOnly(2L, 3L); // From module modules = dao.findChildrenModulesFromModule(session, "org.struts:struts-core"); - assertThat(modules).hasSize(1); - assertThat(modules).onProperty("id").containsOnly(3L); + assertThat(modules).extracting("id").containsOnly(3L); // From sub module modules = dao.findChildrenModulesFromModule(session, "org.struts:struts-data"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/db/SnapshotDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/db/SnapshotDaoTest.java index 742cc8d8da6..897b9cf7102 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/db/SnapshotDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/db/SnapshotDaoTest.java @@ -32,7 +32,7 @@ import org.sonar.core.persistence.DbSession; import java.util.Date; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -180,7 +180,7 @@ public class SnapshotDaoTest extends AbstractDaoTestCase { List<SnapshotDto> snapshots = sut.findSnapshotAndChildrenOfProjectScope(session, defaultSnapshot().setId(1L)); assertThat(snapshots).isNotEmpty(); - assertThat(snapshots).onProperty("id").containsOnly(1L, 6L); + assertThat(snapshots).extracting("id").containsOnly(1L, 6L); } @Test @@ -190,13 +190,13 @@ public class SnapshotDaoTest extends AbstractDaoTestCase { // From root project List<SnapshotDto> snapshots = sut.findChildrenModulesFromModule(session, "org.struts:struts"); assertThat(snapshots).hasSize(2); - assertThat(snapshots).onProperty("id").containsOnly(2L, 3L); - assertThat(snapshots).onProperty("last").containsOnly(true); + assertThat(snapshots).extracting("id").containsOnly(2L, 3L); + assertThat(snapshots).extracting("last").containsOnly(true); // From module snapshots = sut.findChildrenModulesFromModule(session, "org.struts:struts-core"); assertThat(snapshots).hasSize(1); - assertThat(snapshots).onProperty("id").containsOnly(3L); + assertThat(snapshots).extracting("id").containsOnly(3L); // From sub module snapshots = sut.findChildrenModulesFromModule(session, "org.struts:struts-data"); @@ -213,9 +213,9 @@ public class SnapshotDaoTest extends AbstractDaoTestCase { List<SnapshotDto> snapshots = sut.findSnapshotAndChildrenOfProjectScope(session, snapshot); assertThat(snapshots).hasSize(2); - assertThat(snapshots).onProperty("id").containsOnly(1L, 6L); - assertThat(snapshots).onProperty("last").containsOnly(false); - assertThat(snapshots).onProperty("status").containsOnly(SnapshotDto.STATUS_PROCESSED); + assertThat(snapshots).extracting("id").containsOnly(1L, 6L); + assertThat(snapshots).extracting("last").containsOnly(false); + assertThat(snapshots).extracting("status").containsOnly(SnapshotDto.STATUS_PROCESSED); } @Test @@ -228,8 +228,8 @@ public class SnapshotDaoTest extends AbstractDaoTestCase { List<SnapshotDto> snapshots = sut.findSnapshotAndChildrenOfProjectScope(session, snapshot); assertThat(snapshots).hasSize(2); - assertThat(snapshots).onProperty("id").containsOnly(1L, 6L); - assertThat(snapshots).onProperty("last").containsOnly(false); + assertThat(snapshots).extracting("id").containsOnly(1L, 6L); + assertThat(snapshots).extracting("last").containsOnly(false); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java index 4f1ddb7aeb6..6060174b54e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java @@ -50,7 +50,7 @@ import java.util.List; import java.util.Locale; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyListOf; import static org.mockito.Matchers.anyString; diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentsWsTest.java index 0119854b736..0e88b962bec 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentsWsTest.java @@ -29,7 +29,7 @@ import org.sonar.api.utils.Durations; import org.sonar.server.db.DbClient; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class ComponentsWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/EventsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/EventsWsTest.java index 16fbad5bce7..4246751004b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/EventsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/EventsWsTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class EventsWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ProjectsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ProjectsWsTest.java index 9a978d15338..162fc47f59d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ProjectsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ProjectsWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ProjectsWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java index 497a9fa5fcf..ddf33774804 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ResourcesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportLogMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportLogMediumTest.java index 0b39ea16aca..200aa32f00e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportLogMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportLogMediumTest.java @@ -38,7 +38,7 @@ import org.sonar.server.tester.ServerTester; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.core.activity.Activity.Type.ANALYSIS_REPORT; import static org.sonar.core.computation.db.AnalysisReportDto.Status.FAILED; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportQueueMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportQueueMediumTest.java index 27517509500..2b76903a7ca 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportQueueMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportQueueMediumTest.java @@ -42,7 +42,7 @@ import org.sonar.server.user.MockUserSession; import java.io.InputStream; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.core.computation.db.AnalysisReportDto.Status.SUCCESS; import static org.sonar.core.computation.db.AnalysisReportDto.Status.WORKING; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportServiceTest.java index 8c2cd60fc71..875ace20192 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportServiceTest.java @@ -37,7 +37,7 @@ import org.sonar.core.persistence.MyBatis; import java.io.File; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageFactoryTest.java index 492e71a44dc..87bc106e734 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageFactoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageFactoryTest.java @@ -27,7 +27,7 @@ import org.sonar.core.issue.db.IssueStorage; import org.sonar.core.persistence.MyBatis; import org.sonar.server.db.DbClient; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class ComputeEngineIssueStorageFactoryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageTest.java index 933ff910566..341d03becd3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputeEngineIssueStorageTest.java @@ -48,7 +48,7 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java index 501c5351620..436bfdb8c44 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java @@ -39,7 +39,7 @@ import java.io.File; import java.io.InputStream; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.sonar.core.computation.db.AnalysisReportDto.Status.PENDING; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepRegistryTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepRegistryTest.java index 5db55fa8dad..eece386a927 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepRegistryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepRegistryTest.java @@ -23,8 +23,8 @@ package org.sonar.server.computation.step; import org.junit.Test; import org.sonar.server.source.IndexSourceLinesStep; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class ComputationStepRegistryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepMediumTest.java index 21b6b02d4a4..124c1fa1fd8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepMediumTest.java @@ -42,7 +42,7 @@ import org.sonar.server.tester.ServerTester; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class PurgeDatastoresStepMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/ComputationWebServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/ComputationWebServiceTest.java index 4330952f233..02b436940f0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/ComputationWebServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/ComputationWebServiceTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.server.ws.RequestHandler; import org.sonar.api.server.ws.WebService; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class ComputationWebServiceTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/HistoryWsActionMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/HistoryWsActionMediumTest.java index a5129ddee25..51e8ca6c117 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/HistoryWsActionMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/HistoryWsActionMediumTest.java @@ -47,7 +47,7 @@ import org.sonar.server.ws.WsTester; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * TODO replace this medium test by a small test diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/IsQueueEmptyWebServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/IsQueueEmptyWebServiceTest.java index e975b07069d..346d871631f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/IsQueueEmptyWebServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/IsQueueEmptyWebServiceTest.java @@ -32,7 +32,7 @@ import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.util.ArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/QueueWsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/QueueWsActionTest.java index 9ab7d2b213a..3618bcefda6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/QueueWsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/QueueWsActionTest.java @@ -30,7 +30,7 @@ import org.sonar.server.ws.WsTester; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.sonar.core.computation.db.AnalysisReportDto.Status.PENDING; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/SubmitReportWsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/SubmitReportWsActionTest.java index 98a18eccd13..b3cff05cacd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ws/SubmitReportWsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ws/SubmitReportWsActionTest.java @@ -29,7 +29,7 @@ import org.sonar.server.ws.WsTester; import java.io.InputStream; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; public class SubmitReportWsActionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/config/ws/PropertiesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/config/ws/PropertiesWsTest.java index ec6ed930d71..3cec6c83eb5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/config/ws/PropertiesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/config/ws/PropertiesWsTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class PropertiesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java index 19ac5038335..2d825b1a423 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java @@ -37,7 +37,7 @@ import org.sonar.test.DbTests; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class BaseDaoTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/DatabaseCheckerTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/DatabaseCheckerTest.java index c4c5844e68e..6889c71da67 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/DatabaseCheckerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/DatabaseCheckerTest.java @@ -29,8 +29,8 @@ import org.sonar.core.persistence.dialect.Oracle; import java.sql.SQLException; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/DbClientTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/DbClientTest.java index 2074349b439..878a8b79a6e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/DbClientTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/DbClientTest.java @@ -31,7 +31,7 @@ import org.sonar.server.qualityprofile.db.ActiveRuleDao; import org.sonar.server.rule.db.RuleDao; import org.sonar.test.DbTests; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class DbClientTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseTest.java index 055d9223acb..29edb659620 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseTest.java @@ -33,7 +33,7 @@ import java.io.IOException; import java.sql.DriverManager; import static junit.framework.Assert.fail; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class EmbeddedDatabaseTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/ResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/ResultSetIteratorTest.java index bfc7a43c3ac..df297adf618 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/ResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/ResultSetIteratorTest.java @@ -34,8 +34,8 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.NoSuchElementException; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; @Category(DbTests.class) public class ResultSetIteratorTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/BaseDataChangeTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/BaseDataChangeTest.java index 141c536da4b..09a5c0a11c4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/BaseDataChangeTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/BaseDataChangeTest.java @@ -33,8 +33,8 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; @Category(DbTests.class) public class BaseDataChangeTest extends AbstractDaoTestCase { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigrationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigrationsTest.java index 4bf9403f7d2..1386ae5b725 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigrationsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigrationsTest.java @@ -22,7 +22,7 @@ package org.sonar.server.db.migrations; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DatabaseMigrationsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigratorTest.java index c453676f57c..c2ce5a734b8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigratorTest.java @@ -34,7 +34,7 @@ import org.sonar.server.db.DbClient; import java.sql.Connection; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.anyBoolean; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ProgressTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ProgressTest.java index 72b000a1ddb..d7800ebf86a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ProgressTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ProgressTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import org.mockito.ArgumentCaptor; import org.slf4j.Logger; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationConvertersTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationConvertersTest.java index 170589941dc..99fa0dde46f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationConvertersTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationConvertersTest.java @@ -28,8 +28,8 @@ import java.util.List; import java.util.TimerTask; import java.util.concurrent.Callable; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationMigrationTest.java index 730318bc457..ef8117c3620 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationMigrationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationMigrationTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.config.Settings; import org.sonar.core.persistence.DbTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ViolationMigrationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/IssueChangelogMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/IssueChangelogMigrationTest.java index 68c80e59856..76b89914aec 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/IssueChangelogMigrationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/IssueChangelogMigrationTest.java @@ -32,7 +32,7 @@ import org.sonar.core.persistence.DbTester; import org.sonar.core.properties.PropertiesDao; import org.sonar.core.properties.PropertyDto; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/WorkDurationConvertorTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/WorkDurationConvertorTest.java index 843bfa0a344..d1dbd9a48f5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/WorkDurationConvertorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/WorkDurationConvertorTest.java @@ -24,8 +24,8 @@ import org.junit.Test; import org.sonar.core.properties.PropertiesDao; import org.sonar.core.properties.PropertyDto; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ChangeLogMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ChangeLogMigrationTest.java index 81e0a8dab96..699581a22b6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ChangeLogMigrationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ChangeLogMigrationTest.java @@ -36,7 +36,7 @@ import org.sonar.server.db.DbClient; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ConvertProfileMeasuresMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ConvertProfileMeasuresMigrationTest.java index 988fb6de771..e7325c14cb7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ConvertProfileMeasuresMigrationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ConvertProfileMeasuresMigrationTest.java @@ -30,7 +30,7 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ConvertProfileMeasuresMigrationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/FeedQProfileKeysMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/FeedQProfileKeysMigrationTest.java index 7e27aa10216..b485ae17d02 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/FeedQProfileKeysMigrationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/FeedQProfileKeysMigrationTest.java @@ -27,7 +27,7 @@ import org.sonar.core.persistence.DbTester; import org.sonar.core.qualityprofile.db.QualityProfileDao; import org.sonar.core.qualityprofile.db.QualityProfileDto; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class FeedQProfileKeysMigrationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v45/DeleteMeasuresOnDeletedProfilesMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v45/DeleteMeasuresOnDeletedProfilesMigrationTest.java index d6a0e9be9f1..6b5b85be6d1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v45/DeleteMeasuresOnDeletedProfilesMigrationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v45/DeleteMeasuresOnDeletedProfilesMigrationTest.java @@ -31,7 +31,7 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DeleteMeasuresOnDeletedProfilesMigrationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v451/DeleteUnescapedActivitiesTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v451/DeleteUnescapedActivitiesTest.java index 81f5d5a01c1..1560bce72e4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v451/DeleteUnescapedActivitiesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v451/DeleteUnescapedActivitiesTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.core.persistence.DbTester; import org.sonar.server.db.migrations.DatabaseMigration; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DeleteUnescapedActivitiesTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/FeedIssueLongDatesTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/FeedIssueLongDatesTest.java index c62906df7ed..17b2e0ae512 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/FeedIssueLongDatesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/FeedIssueLongDatesTest.java @@ -26,7 +26,7 @@ import org.sonar.api.utils.System2; import org.sonar.core.persistence.DbTester; import org.sonar.server.db.migrations.DatabaseMigration; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/PopulateProjectsUuidColumnsMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/PopulateProjectsUuidColumnsMigrationTest.java index 95cd383fdab..20aec985042 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/PopulateProjectsUuidColumnsMigrationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/PopulateProjectsUuidColumnsMigrationTest.java @@ -32,7 +32,7 @@ import org.sonar.core.persistence.migration.v50.Migration50Mapper; import org.sonar.server.db.DbClient; import org.sonar.server.db.migrations.DatabaseMigration; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class PopulateProjectsUuidColumnsMigrationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/CopyScmAccountsFromAuthorsToUsersTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/CopyScmAccountsFromAuthorsToUsersTest.java index fc655e4a650..251a261795b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/CopyScmAccountsFromAuthorsToUsersTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/CopyScmAccountsFromAuthorsToUsersTest.java @@ -29,7 +29,7 @@ import org.sonar.server.db.migrations.DatabaseMigration; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedUsersLongDatesTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedUsersLongDatesTest.java index b72969dcc20..5a9ca798aa8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedUsersLongDatesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedUsersLongDatesTest.java @@ -26,7 +26,7 @@ import org.sonar.api.utils.System2; import org.sonar.core.persistence.DbTester; import org.sonar.server.db.migrations.DatabaseMigration; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtCharacteristicsXMLImporterTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtCharacteristicsXMLImporterTest.java index 41ad62857a2..9d04d96d86c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtCharacteristicsXMLImporterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtCharacteristicsXMLImporterTest.java @@ -27,8 +27,8 @@ import org.sonar.api.server.debt.DebtCharacteristic; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.sonar.server.debt.DebtModelXMLExporter.DebtModel; public class DebtCharacteristicsXMLImporterTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtMediumTest.java index 6a4434ea5ef..c0b0c174862 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtMediumTest.java @@ -30,7 +30,7 @@ import org.sonar.server.platform.Platform; import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DebtMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java index ac001b84a4c..5988ce6db05 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java @@ -58,7 +58,7 @@ import java.util.Date; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelLookupTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelLookupTest.java index a0390191cc9..202e3c7f2b3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelLookupTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelLookupTest.java @@ -30,7 +30,7 @@ import org.sonar.core.technicaldebt.db.CharacteristicDao; import org.sonar.core.technicaldebt.db.CharacteristicDto; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelOperationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelOperationsTest.java index 3f2d1c6e314..9f580a290ee 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelOperationsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelOperationsTest.java @@ -50,8 +50,8 @@ import org.sonar.server.user.MockUserSession; import java.util.Date; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doAnswer; diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelPluginRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelPluginRepositoryTest.java index 0197ce7ec9a..f6d21825030 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelPluginRepositoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelPluginRepositoryTest.java @@ -39,7 +39,7 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import static org.mockito.Matchers.anyString; diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelXMLExporterTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelXMLExporterTest.java index 8251e6095ca..08e5e653345 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelXMLExporterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelXMLExporterTest.java @@ -36,7 +36,7 @@ import java.util.List; import java.util.regex.Pattern; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertTrue; import static org.sonar.server.debt.DebtModelXMLExporter.DebtModel; import static org.sonar.server.debt.DebtModelXMLExporter.RuleDebt; diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtRulesXMLImporterTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtRulesXMLImporterTest.java index 80181a91100..087e96116d9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtRulesXMLImporterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtRulesXMLImporterTest.java @@ -29,8 +29,8 @@ import org.sonar.api.utils.ValidationMessages; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.sonar.server.debt.DebtModelXMLExporter.RuleDebt; public class DebtRulesXMLImporterTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java index c9e3857d21d..d9d09a7c7e2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java @@ -41,7 +41,7 @@ import java.io.File; import java.io.IOException; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java index 3e77df43941..6e146a4a2ee 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java @@ -27,7 +27,7 @@ import org.sonar.server.db.DbClient; import org.sonar.server.measure.persistence.MeasureDao; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class DuplicationsWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/BulkIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/BulkIndexerTest.java index 0d855cdfe70..5bf17aa0922 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/BulkIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/BulkIndexerTest.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.junit.Rule; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class BulkIndexerTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/DefaultIndexSettingsTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/DefaultIndexSettingsTest.java index a6f8eb33106..36e98501ff1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/DefaultIndexSettingsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/DefaultIndexSettingsTest.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.collect.ImmutableMap; import org.junit.Test; import org.sonar.test.TestUtils; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DefaultIndexSettingsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/EsClientTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/EsClientTest.java index 6549a6f08a7..bce0c2bd641 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/EsClientTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/EsClientTest.java @@ -40,7 +40,7 @@ import org.sonar.server.es.request.ProxyRefreshRequestBuilder; import org.sonar.server.es.request.ProxySearchRequestBuilder; import org.sonar.server.es.request.ProxySearchScrollRequestBuilder; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class EsClientTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java b/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java index 417f93f7c96..2cc58e8f6a4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java @@ -52,7 +52,7 @@ import java.io.FileInputStream; import java.util.Collections; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class EsTester extends ExternalResource { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/IndexCreatorTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/IndexCreatorTest.java index 8f46e89cc6b..06ba9d18d4a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/IndexCreatorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/IndexCreatorTest.java @@ -30,7 +30,7 @@ import javax.annotation.CheckForNull; import java.io.IOException; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IndexCreatorTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionContextTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionContextTest.java index 1b8b8bfe319..2fe786325ae 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionContextTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionContextTest.java @@ -21,8 +21,8 @@ package org.sonar.server.es; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class IndexDefinitionContextTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionHashTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionHashTest.java index 00a2143e6b5..958247d87a5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionHashTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionHashTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import java.util.Arrays; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IndexDefinitionHashTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/NewIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/NewIndexTest.java index f44d95a6b4c..5e6102c6108 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/NewIndexTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/NewIndexTest.java @@ -21,13 +21,12 @@ package org.sonar.server.es; import com.google.common.collect.ImmutableMap; import org.elasticsearch.common.settings.Settings; -import org.fest.assertions.MapAssert; import org.junit.Test; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class NewIndexTest { @@ -70,11 +69,11 @@ public class NewIndexTest { assertThat(mapping.getAttributes().get("dynamic")).isEqualTo("true"); assertThat(mapping).isNotNull(); assertThat(mapping.getProperty("foo_field")).isInstanceOf(Map.class); - assertThat((Map) mapping.getProperty("foo_field")).includes(MapAssert.entry("type", "string")); + assertThat((Map) mapping.getProperty("foo_field")).containsEntry("type", "string"); assertThat((Map) mapping.getProperty("byte_field")).isNotEmpty(); assertThat((Map) mapping.getProperty("double_field")).isNotEmpty(); assertThat((Map) mapping.getProperty("dt_field")).isNotEmpty(); - assertThat((Map) mapping.getProperty("int_field")).includes(MapAssert.entry("type", "integer")); + assertThat((Map) mapping.getProperty("int_field")).containsEntry("type", "integer"); assertThat((Map) mapping.getProperty("long_field")).isNotEmpty(); assertThat((Map) mapping.getProperty("short_field")).isNotEmpty(); assertThat((Map) mapping.getProperty("uuid_path_field")).isNotEmpty(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/SortingTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/SortingTest.java index eab76595c31..db1874a929d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/SortingTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/SortingTest.java @@ -30,8 +30,8 @@ import org.sonar.server.exceptions.BadRequestException; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class SortingTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyBulkRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyBulkRequestBuilderTest.java index eee35ee4fd2..d56df24ef34 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyBulkRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyBulkRequestBuilderTest.java @@ -32,7 +32,7 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.es.EsTester; import org.sonar.server.es.FakeIndexDefinition; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ProxyBulkRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterHealthRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterHealthRequestBuilderTest.java index 3efdab661ab..6abbd47e057 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterHealthRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterHealthRequestBuilderTest.java @@ -29,8 +29,8 @@ import org.junit.Test; import org.sonar.core.profiling.Profiling; import org.sonar.server.es.EsTester; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyClusterHealthRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStateRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStateRequestBuilderTest.java index 58b11ddba85..6f220a693f8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStateRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStateRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.api.config.Settings; import org.sonar.core.profiling.Profiling; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyClusterStateRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStatsRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStatsRequestBuilderTest.java index b63fedbd158..937abf83ba5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStatsRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStatsRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.api.config.Settings; import org.sonar.core.profiling.Profiling; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyClusterStatsRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCountRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCountRequestBuilderTest.java index 206fb338eac..01f73380d16 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCountRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCountRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyCountRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCreateIndexRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCreateIndexRequestBuilderTest.java index 17e3e368f1d..fbf7338e951 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCreateIndexRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCreateIndexRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.api.config.Settings; import org.sonar.core.profiling.Profiling; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyCreateIndexRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteByQueryRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteByQueryRequestBuilderTest.java index bbb130fd5ca..2c81fff5231 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteByQueryRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteByQueryRequestBuilderTest.java @@ -29,8 +29,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyDeleteByQueryRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteRequestBuilderTest.java index fe04a3d236b..f475542b091 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteRequestBuilderTest.java @@ -26,8 +26,8 @@ import org.sonar.api.config.Settings; import org.sonar.core.profiling.Profiling; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyDeleteRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyFlushRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyFlushRequestBuilderTest.java index 823e5c9029c..48991566840 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyFlushRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyFlushRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyFlushRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyGetRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyGetRequestBuilderTest.java index 318d890ed4c..c7307039880 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyGetRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyGetRequestBuilderTest.java @@ -29,8 +29,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyGetRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndexRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndexRequestBuilderTest.java index 4a78049279e..d9c0527d792 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndexRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndexRequestBuilderTest.java @@ -29,8 +29,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.es.EsTester; import org.sonar.server.es.FakeIndexDefinition; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyIndexRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesExistsRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesExistsRequestBuilderTest.java index 3fd4bc16c45..4446bbe9c9e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesExistsRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesExistsRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyIndicesExistsRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesStatsRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesStatsRequestBuilderTest.java index 70509adc10f..65110596a1a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesStatsRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesStatsRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyIndicesStatsRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyMultiGetRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyMultiGetRequestBuilderTest.java index 3d78ed4d18a..eba934555b4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyMultiGetRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyMultiGetRequestBuilderTest.java @@ -31,8 +31,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyMultiGetRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyNodesStatsRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyNodesStatsRequestBuilderTest.java index 765a91edfc6..e4c89d4fb7b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyNodesStatsRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyNodesStatsRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyNodesStatsRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyPutMappingRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyPutMappingRequestBuilderTest.java index d3cb2bb06db..817b6af5cb0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyPutMappingRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyPutMappingRequestBuilderTest.java @@ -33,8 +33,8 @@ import org.sonar.server.search.SearchClient; import java.util.HashMap; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyPutMappingRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyRefreshRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyRefreshRequestBuilderTest.java index b8be869bc0b..0f6cdc487af 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyRefreshRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyRefreshRequestBuilderTest.java @@ -29,8 +29,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxyRefreshRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchRequestBuilderTest.java index 3d3ce021aa6..202c9a60f34 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchRequestBuilderTest.java @@ -28,8 +28,8 @@ import org.sonar.core.profiling.Profiling; import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxySearchRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchScrollRequestBuilderTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchScrollRequestBuilderTest.java index 3192b2ed000..87a83c1adcf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchScrollRequestBuilderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchScrollRequestBuilderTest.java @@ -27,8 +27,8 @@ import org.sonar.api.config.Settings; import org.sonar.core.profiling.Profiling; import org.sonar.server.search.SearchClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class ProxySearchScrollRequestBuilderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/exceptions/BadRequestExceptionTest.java b/server/sonar-server/src/test/java/org/sonar/server/exceptions/BadRequestExceptionTest.java index d9247211061..3708610ccfd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/exceptions/BadRequestExceptionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/exceptions/BadRequestExceptionTest.java @@ -22,7 +22,7 @@ package org.sonar.server.exceptions; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class BadRequestExceptionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/exceptions/ServerExceptionTest.java b/server/sonar-server/src/test/java/org/sonar/server/exceptions/ServerExceptionTest.java index cb780e3383d..a430e294aba 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/exceptions/ServerExceptionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/exceptions/ServerExceptionTest.java @@ -22,7 +22,7 @@ package org.sonar.server.exceptions; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ServerExceptionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/exceptions/VerificationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/exceptions/VerificationsTest.java index 57e2df0d00e..7d5398d215c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/exceptions/VerificationsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/exceptions/VerificationsTest.java @@ -21,8 +21,8 @@ package org.sonar.server.exceptions; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class VerificationsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ActionServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ActionServiceTest.java index b403e5d7f90..06733f80b39 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ActionServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ActionServiceTest.java @@ -46,8 +46,8 @@ import org.sonar.server.user.UserSession; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ActionTest.java index 1255d5fe109..939b355c973 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ActionTest.java @@ -27,7 +27,7 @@ import org.sonar.server.user.UserSession; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/AssignActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/AssignActionTest.java index a14aaa61361..26ac975139a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/AssignActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/AssignActionTest.java @@ -38,7 +38,7 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/CommentActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/CommentActionTest.java index d2a83f13b89..96814ebce70 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/CommentActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/CommentActionTest.java @@ -32,8 +32,8 @@ import org.sonar.server.user.MockUserSession; import java.util.Map; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java index 135abb515ee..10a2efadbcc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java @@ -52,8 +52,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeQueryTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeQueryTest.java index 990384443e6..50bea42997b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeQueryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeQueryTest.java @@ -28,8 +28,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class IssueBulkChangeQueryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceMediumTest.java index ccc3253e947..65fe47c44cf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceMediumTest.java @@ -56,8 +56,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class IssueBulkChangeServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceTest.java index 75bb47d6536..7393260d2e9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceTest.java @@ -53,8 +53,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; import static com.google.common.collect.Sets.newHashSet; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyListOf; import static org.mockito.Matchers.anyMap; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogFormatterTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogFormatterTest.java index d7059917aac..b1bb6353453 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogFormatterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogFormatterTest.java @@ -32,7 +32,7 @@ import org.sonar.api.utils.Durations; import java.util.List; import java.util.Locale; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java index 92565268338..2c56df4a070 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java @@ -35,7 +35,7 @@ import org.sonar.server.user.MockUserSession; import java.util.Arrays; import java.util.Locale; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java index 8736d21262c..ccbd8422d61 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java @@ -53,7 +53,7 @@ import org.sonar.server.user.MockUserSession; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IssueCommentServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java index aef72597a68..90fcbff51b3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java @@ -48,8 +48,8 @@ import org.sonar.server.user.MockUserSession; import java.util.Collections; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java index c4f0b795917..bc1bb2f7fe3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java @@ -42,8 +42,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; import static java.util.Arrays.asList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java index eb1b56d2d0b..379dd6395b9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java @@ -28,7 +28,7 @@ import org.sonar.api.rule.Severity; import java.util.Date; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IssueQueryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java index b1733955afc..405e97b9a7e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java @@ -66,9 +66,10 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; +import static org.junit.Assert.fail; + public class IssueServiceMediumTest { @@ -502,8 +503,8 @@ public class IssueServiceMediumTest { session.commit(); index(); - assertThat(service.listTagsForComponent(project.uuid(), 5)).includes(entry("convention", 3L), entry("bug", 2L), entry("java8", 1L)); - assertThat(service.listTagsForComponent(project.uuid(), 2)).includes(entry("convention", 3L), entry("bug", 2L)).excludes(entry("java8", 1L)); + assertThat(service.listTagsForComponent(project.uuid(), 5)).contains(entry("convention", 3L), entry("bug", 2L), entry("java8", 1L)); + assertThat(service.listTagsForComponent(project.uuid(), 2)).contains(entry("convention", 3L), entry("bug", 2L)).doesNotContainEntry("java8", 1L); assertThat(service.listTagsForComponent("other", 10)).isEmpty(); } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueTesting.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueTesting.java index cef689ede3e..bc23b617107 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueTesting.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueTesting.java @@ -32,7 +32,7 @@ import org.sonar.core.rule.RuleDto; import org.sonar.server.issue.index.IssueDoc; import org.sonar.server.rule.RuleTesting; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IssueTesting { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssuesFinderSortTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssuesFinderSortTest.java index d90ba4bfbfd..eb064aa9232 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssuesFinderSortTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssuesFinderSortTest.java @@ -21,7 +21,7 @@ package org.sonar.server.issue; import org.apache.commons.lang.time.DateUtils; -import org.fest.assertions.Assertions; +import org.assertj.core.api.Assertions; import org.junit.Test; import org.sonar.core.issue.db.IssueDto; @@ -29,7 +29,7 @@ import java.util.Date; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/PlanActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/PlanActionTest.java index e7d1b7ef08e..53ee7d8d03c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/PlanActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/PlanActionTest.java @@ -38,7 +38,7 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ResultTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ResultTest.java index a473fd57e12..624ae5cd799 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ResultTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ResultTest.java @@ -21,7 +21,7 @@ package org.sonar.server.issue; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ResultTest { @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/RulesAggregationTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/RulesAggregationTest.java index 7ae8476846f..9931c01354c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/RulesAggregationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/RulesAggregationTest.java @@ -25,7 +25,7 @@ import org.sonar.api.rule.RuleKey; import org.sonar.core.rule.RuleDto; import org.sonar.server.rule.RuleTesting; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class RulesAggregationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java index d4206b24013..7c8025960e6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java @@ -44,7 +44,7 @@ import org.sonar.server.issue.index.IssueIndexer; import java.util.Collection; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/SetSeverityActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/SetSeverityActionTest.java index 0d8c24078a5..cb2f6cc1deb 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/SetSeverityActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/SetSeverityActionTest.java @@ -35,8 +35,8 @@ import org.sonar.server.user.UserSessionTestUtils; import java.util.Map; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/TransitionActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/TransitionActionTest.java index d7de0cc7686..eece7949291 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/TransitionActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/TransitionActionTest.java @@ -34,8 +34,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanServiceTest.java index 4dc67fe4c8e..be974819dc6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanServiceTest.java @@ -20,7 +20,6 @@ package org.sonar.server.issue.actionplan; -import org.fest.assertions.Fail; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,7 +34,12 @@ import org.sonar.api.web.UserRole; import org.sonar.core.issue.ActionPlanStats; import org.sonar.core.issue.DefaultActionPlan; import org.sonar.core.issue.IssueUpdater; -import org.sonar.core.issue.db.*; +import org.sonar.core.issue.db.ActionPlanDao; +import org.sonar.core.issue.db.ActionPlanDto; +import org.sonar.core.issue.db.ActionPlanStatsDao; +import org.sonar.core.issue.db.ActionPlanStatsDto; +import org.sonar.core.issue.db.IssueDto; +import org.sonar.core.issue.db.IssueStorage; import org.sonar.core.persistence.DbSession; import org.sonar.core.resource.ResourceDao; import org.sonar.core.resource.ResourceDto; @@ -49,7 +53,8 @@ import org.sonar.server.user.UserSession; import java.util.Collection; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; @@ -112,7 +117,7 @@ public class ActionPlanServiceTest { try { actionPlanService.create(actionPlan, unauthorizedUserSession); - Fail.fail(); + fail(); } catch (Exception e) { assertThat(e).isInstanceOf(ForbiddenException.class); } @@ -204,7 +209,7 @@ public class ActionPlanServiceTest { try { actionPlanService.findOpenByProjectKey(projectKey, unauthorizedUserSession); - Fail.fail(); + fail(); } catch (Exception e) { assertThat(e).isInstanceOf(ForbiddenException.class); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanWsTest.java index f01abb4ca51..433c78b1895 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanWsTest.java @@ -25,7 +25,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActionPlanWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueDaoTest.java index 4d4dfa34d10..a42a1287b29 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueDaoTest.java @@ -34,7 +34,7 @@ import org.sonar.server.rule.RuleTesting; import java.util.Arrays; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class IssueDaoTest extends AbstractDaoTestCase { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterServiceTest.java index 5daf70019d2..53441e2b8c0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterServiceTest.java @@ -54,8 +54,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyLong; import static org.mockito.Matchers.anyMap; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterWsTest.java index 82125ccc627..6a6e902af5b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterWsTest.java @@ -27,7 +27,7 @@ import org.mockito.runners.MockitoJUnitRunner; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @RunWith(MockitoJUnitRunner.class) public class IssueFilterWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/ShowActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/ShowActionTest.java index 372ada944ef..9b4fed07449 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/ShowActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/ShowActionTest.java @@ -30,8 +30,8 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java index 59354cc3f03..917378abbb3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java @@ -34,7 +34,7 @@ import org.sonar.test.DbTests; import java.sql.Connection; import java.util.Collection; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class IssueAuthorizationDaoTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java index 1d34bd31693..52f5c381b14 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java @@ -33,7 +33,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class IssueAuthorizationIndexerTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexDefinitionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexDefinitionTest.java index 241479d5751..0e5b70d0d0b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexDefinitionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexDefinitionTest.java @@ -25,7 +25,7 @@ import org.sonar.process.ProcessConstants; import org.sonar.server.es.IndexDefinition; import org.sonar.server.es.NewIndex; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IssueIndexDefinitionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexMediumTest.java index 838e8a8b2ea..ca58e5240bc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexMediumTest.java @@ -62,7 +62,7 @@ import java.util.Date; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IssueIndexMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java index 7c5bef0c5e1..22ca688cf24 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java @@ -32,7 +32,7 @@ import org.sonar.test.DbTests; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class IssueIndexerTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java index 049175aba2d..ca05d7c35d2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java @@ -34,7 +34,7 @@ import org.sonar.test.DbTests; import java.sql.Connection; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class IssueResultSetIteratorTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java index 1dd86e25218..bd0e07d1491 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java @@ -32,7 +32,7 @@ import org.sonar.server.ws.WsTester; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueTagsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueTagsActionTest.java index dda5f3d4f81..fccb68f4ea4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueTagsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueTagsActionTest.java @@ -30,7 +30,7 @@ import org.sonar.api.server.ws.WebService.Param; import org.sonar.server.issue.IssueService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssuesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssuesWsTest.java index 42d276ae99b..4c71a10c75d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssuesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssuesWsTest.java @@ -38,7 +38,7 @@ import org.sonar.server.issue.actionplan.ActionPlanService; import org.sonar.server.rule.RuleService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class IssuesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java index de4c047100f..4c2efa43f02 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java @@ -55,7 +55,7 @@ import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SearchActionMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SetTagsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SetTagsActionTest.java index 5c9c9abcb7c..abaf650afb6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SetTagsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SetTagsActionTest.java @@ -30,7 +30,7 @@ import org.sonar.api.server.ws.WebService.Param; import org.sonar.server.issue.IssueService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterConditionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterConditionTest.java index 5f5ec58c18e..40dc254a62d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterConditionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterConditionTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.sonar.api.measures.Metric; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MeasureFilterConditionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterContextTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterContextTest.java index 0a3edb136a6..25097563b08 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterContextTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterContextTest.java @@ -21,7 +21,7 @@ package org.sonar.server.measure; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MeasureFilterContextTest { @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterEngineTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterEngineTest.java index 285bc40f77f..efba9273d2f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterEngineTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterEngineTest.java @@ -28,7 +28,7 @@ import org.sonar.core.profiling.Profiling; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.argThat; import static org.mockito.Matchers.refEq; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java index d7cfb473f8b..860bf9ef7d1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java @@ -37,7 +37,7 @@ import java.util.Arrays; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class MeasureFilterExecutorTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterFactoryTest.java index cd2b01ea4a9..c6bb445317c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterFactoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterFactoryTest.java @@ -34,7 +34,7 @@ import java.util.List; import java.util.Map; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterTest.java index 89469a18d8b..169e0d4322a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import java.util.Arrays; import java.util.Collections; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MeasureFilterTest { @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MeasureDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MeasureDaoTest.java index c343c550b79..4f1260a0ad8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MeasureDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MeasureDaoTest.java @@ -32,7 +32,7 @@ import org.sonar.core.persistence.DbSession; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MeasureDaoTest extends AbstractDaoTestCase { diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MetricDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MetricDaoTest.java index af2188460e7..81bbd179c4c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MetricDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MetricDaoTest.java @@ -27,7 +27,7 @@ import org.sonar.core.measure.db.MetricDto; import org.sonar.core.persistence.AbstractDaoTestCase; import org.sonar.core.persistence.DbSession; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MetricDaoTest extends AbstractDaoTestCase { diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ManualMeasuresWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ManualMeasuresWsTest.java index aafaab973b6..abc4eda6937 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ManualMeasuresWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ManualMeasuresWsTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ManualMeasuresWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/MetricsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/MetricsWsTest.java index e5005ad332d..86dd7bfc471 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/MetricsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/MetricsWsTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MetricsWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/TimeMachineWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/TimeMachineWsTest.java index 25c29b65132..fd688197b40 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/TimeMachineWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/TimeMachineWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class TimeMachineWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java index 5e786bc8bb3..604efb86d35 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java @@ -26,7 +26,7 @@ import org.mockito.MockitoAnnotations; import org.sonar.api.notifications.NotificationChannel; import org.sonar.api.notifications.NotificationDispatcherMetadata; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class NotificationCenterTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java index 0e65b0deea9..e4647eff872 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java @@ -29,7 +29,7 @@ import org.sonar.api.notifications.NotificationDispatcher; import org.sonar.core.notification.DefaultNotificationManager; import org.sonar.jpa.session.DatabaseSessionFactory; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.same; diff --git a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationTest.java b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationTest.java index 60b08fcf881..00bc619be41 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationTest.java @@ -23,7 +23,7 @@ import org.junit.Before; import org.junit.Test; import org.sonar.api.notifications.Notification; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class NotificationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ApplyPermissionTemplateQueryTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ApplyPermissionTemplateQueryTest.java index 334c46c77db..8bb2bbfb571 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ApplyPermissionTemplateQueryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ApplyPermissionTemplateQueryTest.java @@ -30,7 +30,7 @@ import org.sonar.server.exceptions.BadRequestException; import java.util.Collections; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ApplyPermissionTemplateQueryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionServiceMediumTest.java index f0a6aebb57f..fcd9d1ecd9e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionServiceMediumTest.java @@ -45,7 +45,7 @@ import javax.annotation.Nullable; import java.util.Collection; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * New tests should be added in order to be able to remove InternalPermissionServiceTest diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionTemplateServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionTemplateServiceTest.java index 6175f0d4096..f6938b9172f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionTemplateServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionTemplateServiceTest.java @@ -47,7 +47,7 @@ import org.sonar.server.user.MockUserSession; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; @RunWith(MockitoJUnitRunner.class) @@ -183,11 +183,11 @@ public class InternalPermissionTemplateServiceTest { PermissionTemplate permissionTemplate = service.selectPermissionTemplate("my template"); assertThat(permissionTemplate.getUsersForPermission(GlobalPermissions.DASHBOARD_SHARING)).isEmpty(); - assertThat(permissionTemplate.getUsersForPermission(GlobalPermissions.SCAN_EXECUTION)).onProperty("userName").containsOnly("user_scan", "user_scan_and_dry_run"); - assertThat(permissionTemplate.getUsersForPermission(GlobalPermissions.DRY_RUN_EXECUTION)).onProperty("userName").containsOnly("user_dry_run", "user_scan_and_dry_run"); + assertThat(permissionTemplate.getUsersForPermission(GlobalPermissions.SCAN_EXECUTION)).extracting("userName").containsOnly("user_scan", "user_scan_and_dry_run"); + assertThat(permissionTemplate.getUsersForPermission(GlobalPermissions.DRY_RUN_EXECUTION)).extracting("userName").containsOnly("user_dry_run", "user_scan_and_dry_run"); assertThat(permissionTemplate.getGroupsForPermission(GlobalPermissions.DASHBOARD_SHARING)).isEmpty(); - assertThat(permissionTemplate.getGroupsForPermission(GlobalPermissions.SCAN_EXECUTION)).onProperty("groupName").containsOnly("scan_group"); - assertThat(permissionTemplate.getGroupsForPermission(GlobalPermissions.SYSTEM_ADMIN)).onProperty("groupName").containsOnly("admin_group"); + assertThat(permissionTemplate.getGroupsForPermission(GlobalPermissions.SCAN_EXECUTION)).extracting("groupName").containsOnly("scan_group"); + assertThat(permissionTemplate.getGroupsForPermission(GlobalPermissions.SYSTEM_ADMIN)).extracting("groupName").containsOnly("admin_group"); } @Test @@ -201,9 +201,9 @@ public class InternalPermissionTemplateServiceTest { List<PermissionTemplate> templates = service.selectAllPermissionTemplates(); assertThat(templates).hasSize(2); - assertThat(templates).onProperty("id").containsOnly(1L, 2L); - assertThat(templates).onProperty("name").containsOnly("template1", "template2"); - assertThat(templates).onProperty("description").containsOnly("template1", "template2"); + assertThat(templates).extracting("id").containsOnly(1L, 2L); + assertThat(templates).extracting("name").containsOnly("template1", "template2"); + assertThat(templates).extracting("description").containsOnly("template1", "template2"); } @Test @@ -219,9 +219,9 @@ public class InternalPermissionTemplateServiceTest { List<PermissionTemplate> templates = service.selectAllPermissionTemplates("org.sample.Sample"); assertThat(templates).hasSize(2); - assertThat(templates).onProperty("id").containsOnly(1L, 2L); - assertThat(templates).onProperty("name").containsOnly("template1", "template2"); - assertThat(templates).onProperty("description").containsOnly("template1", "template2"); + assertThat(templates).extracting("id").containsOnly(1L, 2L); + assertThat(templates).extracting("name").containsOnly("template1", "template2"); + assertThat(templates).extracting("description").containsOnly("template1", "template2"); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionChangeTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionChangeTest.java index e2fa99558db..87c437fff3c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionChangeTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionChangeTest.java @@ -29,7 +29,7 @@ import org.sonar.server.exceptions.BadRequestException; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class PermissionChangeTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionFinderTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionFinderTest.java index b540c4492f8..21e311749cf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionFinderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionFinderTest.java @@ -34,8 +34,8 @@ import org.sonar.server.exceptions.NotFoundException; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.*; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryParserTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryParserTest.java index e8f8bdebee1..df43f956656 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryParserTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryParserTest.java @@ -26,7 +26,7 @@ import org.sonar.core.permission.PermissionQuery; import java.util.Map; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class PermissionQueryParserTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryTest.java index cff05ed7eae..f2a57a6c611 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryTest.java @@ -23,8 +23,8 @@ package org.sonar.server.permission; import org.junit.Test; import org.sonar.core.permission.PermissionQuery; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class PermissionQueryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionTemplateTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionTemplateTest.java index 98ac29467b1..20a1e56bd6e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionTemplateTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/PermissionTemplateTest.java @@ -26,7 +26,7 @@ import org.sonar.core.permission.PermissionTemplateDto; import org.sonar.core.permission.PermissionTemplateGroupDto; import org.sonar.core.permission.PermissionTemplateUserDto; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class PermissionTemplateTest { @@ -56,13 +56,13 @@ public class PermissionTemplateTest { assertThat(permissionTemplate.getKey()).isEqualTo("key"); assertThat(permissionTemplate.getDescription()).isEqualTo("description"); assertThat(permissionTemplate.getUsersForPermission("unmatchedPermission")).isEmpty(); - assertThat(permissionTemplate.getUsersForPermission("permission1")).onProperty("userName").containsOnly("user1", "user2"); - assertThat(permissionTemplate.getUsersForPermission("permission1")).onProperty("userId").containsOnly(1L, 2L); - assertThat(permissionTemplate.getUsersForPermission("permission1")).onProperty("userLogin").containsOnly("login1", "login2"); - assertThat(permissionTemplate.getUsersForPermission("permission2")).onProperty("userName").containsOnly("user1"); - assertThat(permissionTemplate.getUsersForPermission("permission2")).onProperty("userId").containsOnly(1L); - assertThat(permissionTemplate.getUsersForPermission("permission2")).onProperty("userLogin").containsOnly("login1"); - assertThat(permissionTemplate.getGroupsForPermission("permission3")).onProperty("groupName").containsOnly("group1", "group2", null); - assertThat(permissionTemplate.getGroupsForPermission("permission3")).onProperty("groupId").containsOnly(1L, 2L, null); + assertThat(permissionTemplate.getUsersForPermission("permission1")).extracting("userName").containsOnly("user1", "user2"); + assertThat(permissionTemplate.getUsersForPermission("permission1")).extracting("userId").containsOnly(1L, 2L); + assertThat(permissionTemplate.getUsersForPermission("permission1")).extracting("userLogin").containsOnly("login1", "login2"); + assertThat(permissionTemplate.getUsersForPermission("permission2")).extracting("userName").containsOnly("user1"); + assertThat(permissionTemplate.getUsersForPermission("permission2")).extracting("userId").containsOnly(1L); + assertThat(permissionTemplate.getUsersForPermission("permission2")).extracting("userLogin").containsOnly("login1"); + assertThat(permissionTemplate.getGroupsForPermission("permission3")).extracting("groupName").containsOnly("group1", "group2", null); + assertThat(permissionTemplate.getGroupsForPermission("permission3")).extracting("groupId").containsOnly(1L, 2L, null); } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java index b7c057dcf5b..0204f65a18b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class PermissionsWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java index d65d6936d41..78e76a05280 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java @@ -48,7 +48,7 @@ import org.sonar.server.rule.index.RuleIndex; import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class BackendCleanupMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/DefaultServerFileSystemTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/DefaultServerFileSystemTest.java index 0aa1be4b8ea..c352047a81e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/DefaultServerFileSystemTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/DefaultServerFileSystemTest.java @@ -26,7 +26,7 @@ import org.sonar.api.platform.ServerFileSystem; import java.io.File; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DefaultServerFileSystemTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/MasterServletFilterTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/MasterServletFilterTest.java index c7ad620c488..b8423116006 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/MasterServletFilterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/MasterServletFilterTest.java @@ -37,7 +37,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collections; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/PersistentSettingsTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/PersistentSettingsTest.java index 920853a8463..a896f815fad 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/PersistentSettingsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/PersistentSettingsTest.java @@ -31,7 +31,7 @@ import java.net.URISyntaxException; import java.util.Arrays; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.argThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerIdGeneratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerIdGeneratorTest.java index 4ac7c640fc1..e0082c5af9d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerIdGeneratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerIdGeneratorTest.java @@ -27,7 +27,7 @@ import org.junit.Test; import java.net.InetAddress; import java.net.UnknownHostException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertThat; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java index 13552476953..1766cb82459 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java @@ -31,7 +31,7 @@ import org.sonar.process.ProcessConstants; import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertThat; public class ServerImplTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerSettingsTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerSettingsTest.java index ca465ee4097..6801327f647 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerSettingsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerSettingsTest.java @@ -27,7 +27,7 @@ import org.sonar.api.config.PropertyDefinitions; import java.util.Map; import java.util.Properties; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ServerSettingsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/SettingsChangeNotifierTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/SettingsChangeNotifierTest.java index 01f76e65968..25570eb271e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/SettingsChangeNotifierTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/SettingsChangeNotifierTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import org.mockito.ArgumentMatcher; import org.sonar.api.config.GlobalPropertyChangeHandler; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.argThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/SwitchLogbackAppenderTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/SwitchLogbackAppenderTest.java index 84b45a5230b..b2c33c4e60a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/SwitchLogbackAppenderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/SwitchLogbackAppenderTest.java @@ -32,7 +32,7 @@ import org.sonar.server.computation.ComputationWorkerLauncher; import java.net.URL; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SwitchLogbackAppenderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/TempFolderProviderTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/TempFolderProviderTest.java index 0c38032d4b8..0f66f406e1d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/TempFolderProviderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/TempFolderProviderTest.java @@ -28,7 +28,7 @@ import org.sonar.api.utils.TempFolder; import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/RestartHandlerTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/RestartHandlerTest.java index 5080f639eec..832f80f2585 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/RestartHandlerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/RestartHandlerTest.java @@ -26,7 +26,7 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.platform.Platform; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Fail.fail; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java index 0fe35a51a2b..2328a9ac435 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ServerWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemWsTest.java index 8c4ad647520..132f77d4f35 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemWsTest.java @@ -25,7 +25,7 @@ import org.sonar.api.server.ws.WebService; import org.sonar.api.utils.System2; import org.sonar.server.platform.Platform; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class SystemWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java index 733bbf01655..40e1ada4f35 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java @@ -25,7 +25,7 @@ import org.sonar.api.platform.PluginRepository; import org.sonar.core.plugins.DefaultPluginMetadata; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java index f0122993eeb..6c5f4412026 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java @@ -21,7 +21,7 @@ package org.sonar.server.plugins; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MimeTypesTest { @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginDownloaderTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginDownloaderTest.java index 093d54c07d5..f98c49dd844 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginDownloaderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginDownloaderTest.java @@ -41,8 +41,8 @@ import java.io.File; import java.net.URI; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyBoolean; import static org.mockito.Matchers.argThat; diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java index 63a27878875..a7cc85c9694 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java @@ -25,7 +25,7 @@ import org.sonar.core.plugins.DefaultPluginMetadata; import org.sonar.updatecenter.common.PluginReferential; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginJarsInstallerTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginJarsInstallerTest.java index ed4932e7166..fea094c3b9a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginJarsInstallerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginJarsInstallerTest.java @@ -34,8 +34,8 @@ import org.sonar.server.platform.DefaultServerFileSystem; import java.io.File; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java index 41a0b4cc6b8..5f1898dae31 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java @@ -28,7 +28,7 @@ import org.sonar.core.plugins.DefaultPluginMetadata; import java.io.File; import java.util.Arrays; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/StaticResourcesServletTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/StaticResourcesServletTest.java index c6f5e13b245..05e4a0855ed 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/StaticResourcesServletTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/StaticResourcesServletTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/UpdateCenterClientTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/UpdateCenterClientTest.java index d8a1f2e7904..9c9e5a5bf6a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/UpdateCenterClientTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/UpdateCenterClientTest.java @@ -31,7 +31,7 @@ import org.sonar.updatecenter.common.Version; import java.net.URI; import java.net.URISyntaxException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsFactoryTest.java index 7a02b665a6c..d894cf48f65 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsFactoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsFactoryTest.java @@ -31,7 +31,7 @@ import org.sonar.core.properties.PropertyDto; import java.util.Map; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class ProjectSettingsFactoryTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsTest.java b/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsTest.java index 144592e6d09..b8f99fcc2a2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsTest.java @@ -27,7 +27,7 @@ import org.sonar.api.config.Settings; import java.util.HashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java index abb27e79fd2..0e7c397ceb4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java @@ -57,7 +57,7 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyLong; import static org.mockito.Matchers.anyString; @@ -301,14 +301,14 @@ public class QualityGatesTest { String operator = "LT"; String warningThreshold = "90"; when(dao.selectById(qGateId)).thenReturn(new QualityGateDto().setId(qGateId)); - Integer metricId = 10; + int metricId = 10; Metric coverage = Mockito.spy(CoreMetrics.COVERAGE); when(coverage.getId()).thenReturn(metricId); when(metricFinder.findByKey(metricKey)).thenReturn(coverage); QualityGateConditionDto newCondition = qGates.createCondition(qGateId, metricKey, operator, warningThreshold, null, null); assertThat(newCondition.getQualityGateId()).isEqualTo(qGateId); - assertThat(newCondition.getMetricId()).isEqualTo(metricId); + assertThat(newCondition.getMetricId()).isEqualTo((long)metricId); assertThat(newCondition.getOperator()).isEqualTo(operator); assertThat(newCondition.getWarningThreshold()).isEqualTo(warningThreshold); assertThat(newCondition.getErrorThreshold()).isNull(); @@ -323,7 +323,7 @@ public class QualityGatesTest { String operator = "LT"; String errorThreshold = "80"; when(dao.selectById(qGateId)).thenReturn(new QualityGateDto().setId(qGateId)); - Integer metricId = 10; + int metricId = 10; Metric newCoverage = Mockito.spy(CoreMetrics.NEW_COVERAGE); when(newCoverage.getId()).thenReturn(metricId); when(metricFinder.findByKey(metricKey)).thenReturn(newCoverage); @@ -331,7 +331,7 @@ public class QualityGatesTest { QualityGateConditionDto newCondition = qGates.createCondition(qGateId, metricKey, operator, null, errorThreshold, period); assertThat(newCondition.getQualityGateId()).isEqualTo(qGateId); - assertThat(newCondition.getMetricId()).isEqualTo(metricId); + assertThat(newCondition.getMetricId()).isEqualTo((long)metricId); assertThat(newCondition.getMetricKey()).isEqualTo(metricKey); assertThat(newCondition.getOperator()).isEqualTo(operator); assertThat(newCondition.getWarningThreshold()).isNull(); @@ -437,7 +437,7 @@ public class QualityGatesTest { final QualityGateConditionDto condition = new QualityGateConditionDto().setId(condId) .setMetricId(666L).setOperator("GT").setWarningThreshold("123"); when(conditionDao.selectById(condId)).thenReturn(condition); - Integer metricId = 10; + int metricId = 10; Metric newCoverage = Mockito.spy(CoreMetrics.NEW_COVERAGE); when(newCoverage.getId()).thenReturn(metricId); when(metricFinder.findByKey(metricKey)).thenReturn(newCoverage); @@ -445,7 +445,7 @@ public class QualityGatesTest { assertThat(qGates.updateCondition(condId, metricKey, operator, null, errorThreshold, period)).isEqualTo(condition); assertThat(condition.getId()).isEqualTo(condId); - assertThat(condition.getMetricId()).isEqualTo(metricId); + assertThat(condition.getMetricId()).isEqualTo((long)metricId); assertThat(condition.getMetricKey()).isEqualTo(metricKey); assertThat(condition.getOperator()).isEqualTo(operator); assertThat(condition.getWarningThreshold()).isNull(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/RegisterQualityGatesTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/RegisterQualityGatesTest.java index 282c1d05635..091c5a6494b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/RegisterQualityGatesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/RegisterQualityGatesTest.java @@ -29,7 +29,7 @@ import org.sonar.core.qualitygate.db.QualityGateDto; import org.sonar.core.template.LoadedTemplateDao; import org.sonar.core.template.LoadedTemplateDto; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyLong; import static org.mockito.Matchers.anyString; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesAppActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesAppActionTest.java index 53e3fac86d2..7cbbb3db16d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesAppActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesAppActionTest.java @@ -40,7 +40,7 @@ import java.util.Collection; import java.util.Locale; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java index f710b51a7b9..d36da7bfd60 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java @@ -43,7 +43,7 @@ import org.sonar.server.ws.WsTester; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleBackendMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleBackendMediumTest.java index eddf30bb67f..8d0d44d89c7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleBackendMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleBackendMediumTest.java @@ -51,7 +51,7 @@ import java.util.List; import java.util.Map; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActiveRuleBackendMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleChangeMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleChangeMediumTest.java index 4027f63930f..c57d29fb178 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleChangeMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleChangeMediumTest.java @@ -33,7 +33,7 @@ import org.sonar.server.activity.index.ActivityIndex; import org.sonar.server.db.DbClient; import org.sonar.server.tester.ServerTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActiveRuleChangeMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInProfilesTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInProfilesTest.java index a3d74116fde..b0769b244e5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInProfilesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInProfilesTest.java @@ -23,7 +23,7 @@ package org.sonar.server.qualityprofile; import org.junit.Before; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class BuiltInProfilesTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileBackuperMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileBackuperMediumTest.java index e27bc2cf9f6..035026141f2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileBackuperMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileBackuperMediumTest.java @@ -43,8 +43,8 @@ import java.io.StringReader; import java.io.StringWriter; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class QProfileBackuperMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileCopierMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileCopierMediumTest.java index bb57205b03b..814d5095bff 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileCopierMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileCopierMediumTest.java @@ -41,8 +41,8 @@ import javax.annotation.Nullable; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class QProfileCopierMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileExportersTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileExportersTest.java index 8c0f19312c8..e9ebde65167 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileExportersTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileExportersTest.java @@ -46,8 +46,8 @@ import java.io.Reader; import java.io.Writer; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class QProfileExportersTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java index 21340c976c1..1028ae79a70 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java @@ -39,8 +39,8 @@ import org.sonar.server.search.IndexClient; import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.sonar.server.qualityprofile.QProfileTesting.XOO_P1_KEY; import static org.sonar.server.qualityprofile.QProfileTesting.XOO_P2_KEY; import static org.sonar.server.qualityprofile.QProfileTesting.XOO_P3_KEY; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java index ad57cc44ad4..d978d3dbac3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java @@ -21,7 +21,7 @@ package org.sonar.server.qualityprofile; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class QProfileNameTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java index 1e3104f3069..37b02397f37 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java @@ -36,7 +36,7 @@ import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; import org.sonar.server.user.UserSession; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class QProfileProjectOperationsMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java index ba027b787d2..aa59c62aacd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java @@ -58,7 +58,7 @@ import java.io.Writer; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.server.qualityprofile.QProfileTesting.XOO_P1_KEY; import static org.sonar.server.qualityprofile.QProfileTesting.XOO_P2_KEY; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTest.java index 042a5dfcb88..b6023693a60 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTest.java @@ -22,7 +22,7 @@ package org.sonar.server.qualityprofile; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class QProfileTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesMediumTest.java index 507e03dcdfa..be46ca7fc9c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesMediumTest.java @@ -46,7 +46,7 @@ import org.sonar.server.tester.ServerTester; import java.util.Map; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class RegisterQualityProfilesMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java index 70555f56880..8df38ef8ef2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java @@ -52,8 +52,8 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.sonar.server.qualityprofile.QProfileTesting.*; public class RuleActivatorMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java index 90ed92a3398..c2093edc7f6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java @@ -28,7 +28,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @RunWith(MockitoJUnitRunner.class) public class ProfilesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java index 6ec7fba2913..7c3371c2f64 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java @@ -48,8 +48,8 @@ import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class QProfilesWsMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsTest.java index 544ec58392d..9b30116c775 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsTest.java @@ -28,7 +28,7 @@ import org.sonar.server.qualityprofile.QProfileService; import org.sonar.server.rule.RuleService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class QProfilesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/DefaultRuleFinderMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/DefaultRuleFinderMediumTest.java index c22538525e4..04bf1ddf430 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/DefaultRuleFinderMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/DefaultRuleFinderMediumTest.java @@ -19,7 +19,7 @@ */ package org.sonar.server.rule; -import org.fest.assertions.Assertions; +import org.assertj.core.api.Assertions; import org.junit.*; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.RuleStatus; @@ -33,7 +33,7 @@ import org.sonar.server.tester.ServerTester; import java.util.Collections; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Deprecated public class DefaultRuleFinderMediumTest { @@ -128,7 +128,7 @@ public class DefaultRuleFinderMediumTest { Assertions.assertThat(finder.findAll(RuleQuery.create().withRepositoryKey("checkstyle"))).hasSize(2); // find_all_enabled - Assertions.assertThat(finder.findAll(RuleQuery.create())).onProperty("id").containsOnly(1, 3, 4, 5); + Assertions.assertThat(finder.findAll(RuleQuery.create())).extracting("id").containsOnly(1, 3, 4, 5); Assertions.assertThat(finder.findAll(RuleQuery.create())).hasSize(4); // do_not_find_disabled_rules @@ -167,7 +167,7 @@ public class DefaultRuleFinderMediumTest { @Test public void find_all_not_include_removed_rule() { // find rule with id 2 is REMOVED - Assertions.assertThat(finder.findAll(RuleQuery.create())).onProperty("id").containsOnly(1, 3, 4, 5); + Assertions.assertThat(finder.findAll(RuleQuery.create())).extracting("id").containsOnly(1, 3, 4, 5); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoaderTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoaderTest.java index aca4a6157a1..2acfab4484d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoaderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoaderTest.java @@ -42,8 +42,8 @@ import java.util.Arrays; import java.util.List; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java index 8e91538ac7c..292b0e3effb 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java @@ -60,8 +60,8 @@ import java.util.List; import java.util.Map; import static com.google.common.collect.Sets.newHashSet; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class RegisterRulesMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java index 226964802b6..930515c1de7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java @@ -45,7 +45,7 @@ import org.sonar.server.rule.db.RuleDao; import java.util.Date; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java index 3be473ffae7..62cb7da516a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java @@ -41,7 +41,7 @@ import java.util.List; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java index b805a2babf4..6ee776eddd0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java @@ -44,7 +44,7 @@ import org.sonar.server.tester.ServerTester; import java.util.Collection; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Test persistence in db and indexation in es (--> integration of DAOs and Indexes) diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java index 9d4fb384ecc..8b013c8e299 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java @@ -43,8 +43,8 @@ import org.sonar.server.tester.ServerTester; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class RuleCreatorMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleDeleterMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleDeleterMediumTest.java index 3a26f766b4c..8043f0838e8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleDeleterMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleDeleterMediumTest.java @@ -44,7 +44,7 @@ import org.sonar.server.tester.ServerTester; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class RuleDeleterMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleOperationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleOperationsTest.java index f7b8b8070ac..8f10df6d4da 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleOperationsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleOperationsTest.java @@ -41,7 +41,7 @@ import org.sonar.server.rule.db.RuleDao; import org.sonar.server.user.MockUserSession; import org.sonar.server.user.UserSession; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleRepositoriesTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleRepositoriesTest.java index be71187ff0e..35c7e0939ab 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleRepositoriesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleRepositoriesTest.java @@ -22,7 +22,7 @@ package org.sonar.server.rule; import org.junit.Test; import org.sonar.api.server.rule.RulesDefinition; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class RuleRepositoriesTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java index 08e16ed42b2..d203f55c21e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java @@ -44,8 +44,8 @@ import java.util.Collections; import java.util.Set; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class RuleServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleTagHelperTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleTagHelperTest.java index 3a216db889e..5d61ed462ea 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleTagHelperTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleTagHelperTest.java @@ -25,8 +25,8 @@ import org.sonar.core.rule.RuleDto; import java.util.Collections; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class RuleTagHelperTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleUpdaterMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleUpdaterMediumTest.java index 3b6470364c1..21c7c613fda 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleUpdaterMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleUpdaterMediumTest.java @@ -54,8 +54,8 @@ import org.sonar.server.user.UserSession; import java.util.Set; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class RuleUpdaterMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RulesDefinitionLoaderTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RulesDefinitionLoaderTest.java index 74fb2b09d35..9eadfbae4a9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RulesDefinitionLoaderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RulesDefinitionLoaderTest.java @@ -22,7 +22,7 @@ package org.sonar.server.rule; import org.junit.Test; import org.sonar.api.server.rule.RulesDefinition; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class RulesDefinitionLoaderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java index 3c2cc8527fa..15ce8518841 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java @@ -39,7 +39,7 @@ import org.sonar.server.rule.RuleTesting; import java.util.Date; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java index 64062056661..b842bad4de9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java @@ -63,8 +63,8 @@ import java.util.Map; import java.util.Set; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class RuleIndexMediumTest { @@ -1003,9 +1003,9 @@ public class RuleIndexMediumTest { // 1 Facet with no filters at all Map<String, Collection<FacetValue>> facets = index.search(new RuleQuery(), new QueryContext().addFacets(Arrays.asList("languages", "repositories", "tags"))).getFacets(); assertThat(facets.keySet()).hasSize(3); - assertThat(facets.get(RuleIndex.FACET_LANGUAGES)).onProperty("key").containsOnly("cpp", "java", "cobol"); - assertThat(facets.get(RuleIndex.FACET_REPOSITORIES)).onProperty("key").containsOnly("xoo", "foo"); - assertThat(facets.get(RuleIndex.FACET_TAGS)).onProperty("key").containsOnly("systag1", "systag2", "T1", "T2", "T3", "T4"); + assertThat(facets.get(RuleIndex.FACET_LANGUAGES)).extracting("key").containsOnly("cpp", "java", "cobol"); + assertThat(facets.get(RuleIndex.FACET_REPOSITORIES)).extracting("key").containsOnly("xoo", "foo"); + assertThat(facets.get(RuleIndex.FACET_TAGS)).extracting("key").containsOnly("systag1", "systag2", "T1", "T2", "T3", "T4"); // 2 Facet with a language filter // -- lang facet should still have all language @@ -1014,7 +1014,7 @@ public class RuleIndexMediumTest { , new QueryContext().addFacets(Arrays.asList("languages", "repositories", "tags"))); assertThat(result.getHits()).hasSize(3); assertThat(result.getFacets()).hasSize(3); - assertThat(result.getFacets().get(RuleIndex.FACET_LANGUAGES)).onProperty("key").containsOnly("cpp", "java", "cobol"); + assertThat(result.getFacets().get(RuleIndex.FACET_LANGUAGES)).extracting("key").containsOnly("cpp", "java", "cobol"); // 3 facet with 2 filters // -- lang facet for tag T2 @@ -1026,9 +1026,9 @@ public class RuleIndexMediumTest { , new QueryContext().addFacets(Arrays.asList("languages", "repositories", "tags"))); assertThat(result.getHits()).hasSize(1); assertThat(result.getFacets().keySet()).hasSize(3); - assertThat(result.getFacets().get(RuleIndex.FACET_LANGUAGES)).onProperty("key").containsOnly("cpp", "java"); - assertThat(result.getFacets().get(RuleIndex.FACET_REPOSITORIES)).onProperty("key").containsOnly("foo"); - assertThat(result.getFacets().get(RuleIndex.FACET_TAGS)).onProperty("key").containsOnly("systag1", "systag2", "T2", "T3"); + assertThat(result.getFacets().get(RuleIndex.FACET_LANGUAGES)).extracting("key").containsOnly("cpp", "java"); + assertThat(result.getFacets().get(RuleIndex.FACET_REPOSITORIES)).extracting("key").containsOnly("foo"); + assertThat(result.getFacets().get(RuleIndex.FACET_TAGS)).extracting("key").containsOnly("systag1", "systag2", "T2", "T3"); // 4 facet with 2 filters // -- lang facet for tag T2 @@ -1040,9 +1040,9 @@ public class RuleIndexMediumTest { , new QueryContext().addFacets(Arrays.asList("languages", "repositories", "tags"))); assertThat(result.getHits()).hasSize(2); assertThat(result.getFacets().keySet()).hasSize(3); - assertThat(result.getFacets().get(RuleIndex.FACET_LANGUAGES)).onProperty("key").containsOnly("cpp", "java"); - assertThat(result.getFacets().get(RuleIndex.FACET_REPOSITORIES)).onProperty("key").containsOnly("foo", "xoo"); - assertThat(result.getFacets().get(RuleIndex.FACET_TAGS)).onProperty("key").containsOnly("systag1", "systag2", "T1", "T2", "T3"); + assertThat(result.getFacets().get(RuleIndex.FACET_LANGUAGES)).extracting("key").containsOnly("cpp", "java"); + assertThat(result.getFacets().get(RuleIndex.FACET_REPOSITORIES)).extracting("key").containsOnly("foo", "xoo"); + assertThat(result.getFacets().get(RuleIndex.FACET_TAGS)).extracting("key").containsOnly("systag1", "systag2", "T1", "T2", "T3"); } private static List<String> ruleKeys(List<Rule> rules) { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/CreateActionMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/CreateActionMediumTest.java index 5b758cce991..8ba84ec7e23 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/CreateActionMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/CreateActionMediumTest.java @@ -41,8 +41,8 @@ import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; @RunWith(MockitoJUnitRunner.class) public class CreateActionMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleMappingTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleMappingTest.java index 1bc90e35cd2..7b6228f4189 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleMappingTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleMappingTest.java @@ -28,7 +28,7 @@ import org.sonar.server.search.QueryContext; import org.sonar.server.search.ws.SearchOptions; import org.sonar.server.text.MacroInterpreter; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class RuleMappingTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceMediumTest.java index dab9d2f7f4d..2144994aaa7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceMediumTest.java @@ -52,7 +52,7 @@ import java.util.Calendar; import java.util.Collections; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class RulesWebServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/UpdateActionMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/UpdateActionMediumTest.java index 39d09b8673f..68b64822c2e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/UpdateActionMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/UpdateActionMediumTest.java @@ -41,8 +41,8 @@ import org.sonar.server.tester.ServerTester; import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class UpdateActionMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java index ecf06853c40..82b6a5e3e74 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java @@ -26,8 +26,8 @@ import java.util.Collections; import java.util.Date; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class BaseDocTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/BaseIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/BaseIndexTest.java index faa6976f211..9eeecef377d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/BaseIndexTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/BaseIndexTest.java @@ -35,7 +35,7 @@ import java.io.Serializable; import java.util.Collections; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class BaseIndexTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/FacetValueTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/FacetValueTest.java index 8ffb58fe109..8b066698e8b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/FacetValueTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/FacetValueTest.java @@ -21,7 +21,7 @@ package org.sonar.server.search; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class FacetValueTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/IndexClientMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/IndexClientMediumTest.java index c3d82cd1d88..d15cc397251 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/IndexClientMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/IndexClientMediumTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.server.rule.index.RuleIndex; import org.sonar.server.tester.ServerTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IndexClientMediumTest{ diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/NodeHealthPerformanceTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/NodeHealthPerformanceTest.java index 0c419fac5c6..3245130257c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/NodeHealthPerformanceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/NodeHealthPerformanceTest.java @@ -21,7 +21,7 @@ package org.sonar.server.search; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class NodeHealthPerformanceTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/QueryContextTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/QueryContextTest.java index 2ac3cdfa51c..bdf59fb6822 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/QueryContextTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/QueryContextTest.java @@ -27,8 +27,8 @@ import org.sonar.server.user.MockUserSession; import java.util.Arrays; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class QueryContextTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/SearchClientMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/SearchClientMediumTest.java index d9d2c510931..038d841cf8f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/SearchClientMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/SearchClientMediumTest.java @@ -25,8 +25,8 @@ import org.junit.ClassRule; import org.junit.Test; import org.sonar.server.tester.ServerTester; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class SearchClientMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java index 0d050d41866..9aee9fe7806 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java @@ -35,7 +35,7 @@ import java.util.Date; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SearchHealthMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/action/DeleteKeyTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/action/DeleteKeyTest.java index 5798b0da109..b7a587f9da2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/action/DeleteKeyTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/action/DeleteKeyTest.java @@ -27,8 +27,8 @@ import org.sonar.server.search.IndexDefinition; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/action/RefreshIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/action/RefreshIndexTest.java index 2776286d77c..b3eb3e785b2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/action/RefreshIndexTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/action/RefreshIndexTest.java @@ -27,8 +27,8 @@ import org.sonar.server.search.IndexDefinition; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/ws/SearchOptionsTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/ws/SearchOptionsTest.java index 0d802c8aa6d..d4bcee11a82 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/ws/SearchOptionsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/ws/SearchOptionsTest.java @@ -31,7 +31,7 @@ import org.sonar.server.search.Result; import java.io.StringWriter; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/DecorationDataHolderTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/DecorationDataHolderTest.java index 44866632f2c..147813f98f1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/DecorationDataHolderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/DecorationDataHolderTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DecorationDataHolderTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/HtmlSourceDecoratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/HtmlSourceDecoratorTest.java index b1c17c20059..6a7b23c8ca1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/HtmlSourceDecoratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/HtmlSourceDecoratorTest.java @@ -23,7 +23,7 @@ package org.sonar.server.source; import org.junit.Before; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class HtmlSourceDecoratorTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/HtmlTextDecoratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/HtmlTextDecoratorTest.java index c02a0e819e3..9f21bfff3fd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/HtmlTextDecoratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/HtmlTextDecoratorTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.server.source.HtmlTextDecorator.CR_END_OF_LINE; import static org.sonar.server.source.HtmlTextDecorator.LF_END_OF_LINE; diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/OpeningHtmlTagTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/OpeningHtmlTagTest.java index a0047cdb233..71b3db5eae5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/OpeningHtmlTagTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/OpeningHtmlTagTest.java @@ -22,7 +22,7 @@ package org.sonar.server.source; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class OpeningHtmlTagTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/SourceServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/SourceServiceTest.java index aac22010b27..77c359e228c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/SourceServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/SourceServiceTest.java @@ -39,8 +39,8 @@ import org.sonar.server.user.MockUserSession; import java.util.Arrays; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexDefinitionTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexDefinitionTest.java index c556e27a039..4c5af2a2567 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexDefinitionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexDefinitionTest.java @@ -25,7 +25,7 @@ import org.sonar.process.ProcessConstants; import org.sonar.server.es.IndexDefinition; import org.sonar.server.es.NewIndex; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SourceLineIndexDefinitionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexTest.java index ced283fc0bb..71044d301ed 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import org.sonar.api.config.Settings; import org.sonar.server.es.EsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SourceLineIndexTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexerTest.java index 8df6fde2940..ed3a5dc49c2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexerTest.java @@ -28,7 +28,6 @@ import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; -import org.fest.assertions.MapAssert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -47,7 +46,8 @@ import java.util.Date; import java.util.List; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; import static org.sonar.server.source.index.SourceLineIndexDefinition.*; @Category(DbTests.class) @@ -107,16 +107,16 @@ public class SourceLineIndexerTest { assertThat(fileSearch.getHits().getTotalHits()).isEqualTo(1L); Map<String, Object> fields = fileSearch.getHits().getHits()[0].sourceAsMap(); assertThat(fields).hasSize(9); - assertThat(fields).includes( - MapAssert.entry(FIELD_PROJECT_UUID, "abcd"), - MapAssert.entry(FIELD_FILE_UUID, "efgh"), - MapAssert.entry(FIELD_LINE, 1), - MapAssert.entry(FIELD_SCM_REVISION, "cafebabe"), - MapAssert.entry(FIELD_SCM_DATE, "2014-01-01T11:34:56.000Z"), - MapAssert.entry(FIELD_SCM_AUTHOR, "polop"), - MapAssert.entry(FIELD_SOURCE, "package org.sonar.server.source;"), - MapAssert.entry(FIELD_DUPLICATIONS, duplications) - ); + assertThat(fields).contains( + entry(FIELD_PROJECT_UUID, "abcd"), + entry(FIELD_FILE_UUID, "efgh"), + entry(FIELD_LINE, 1), + entry(FIELD_SCM_REVISION, "cafebabe"), + entry(FIELD_SCM_DATE, "2014-01-01T11:34:56.000Z"), + entry(FIELD_SCM_AUTHOR, "polop"), + entry(FIELD_SOURCE, "package org.sonar.server.source;"), + entry(FIELD_DUPLICATIONS, duplications) + ); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java index bc1551915c1..5d19f58a2b1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java @@ -31,8 +31,8 @@ import org.sonar.test.DbTests; import java.sql.Connection; import java.sql.PreparedStatement; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; @Category(DbTests.class) public class SourceLineResultSetIteratorTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java index 5ed6696facb..650dcafc901 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java @@ -35,8 +35,8 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/ws/LinesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/ws/LinesActionTest.java index ddbb959010b..0b49bbf16cb 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/ws/LinesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/ws/LinesActionTest.java @@ -48,8 +48,8 @@ import java.util.Date; import java.util.Map; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/ws/RawActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/ws/RawActionTest.java index 5b11c4fb8a1..ed2f15ef01e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/ws/RawActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/ws/RawActionTest.java @@ -37,7 +37,7 @@ import org.sonar.server.user.MockUserSession; import org.sonar.server.ws.WsTester; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/ws/SourcesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/ws/SourcesWsTest.java index db22e8bb0a8..ea2143a9d76 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/ws/SourcesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/ws/SourcesWsTest.java @@ -30,7 +30,7 @@ import org.sonar.server.source.SourceService; import org.sonar.server.source.index.SourceLineIndex; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class SourcesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest.java index 560c66847cd..c5540d8ff9b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest.java @@ -35,7 +35,7 @@ import org.sonar.server.db.DbClient; import org.sonar.server.rule.db.RuleDao; import org.sonar.test.DbTests; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @Category(DbTests.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/JdbcDriverDeployerTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/JdbcDriverDeployerTest.java index b46a06d8a2a..d95498ecb60 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/JdbcDriverDeployerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/JdbcDriverDeployerTest.java @@ -30,7 +30,7 @@ import org.sonar.server.platform.DefaultServerFileSystem; import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -58,7 +58,7 @@ public class JdbcDriverDeployerTest { assertThat(deployedIndex).exists(); assertThat(deployedFile).exists(); - assertThat(deployedFile).hasSize(driver.length()); + assertThat(deployedFile).hasContentEqualTo(driver); assertThat(Files.toString(deployedIndex, Charsets.UTF_8)).isEqualTo("my-driver.jar|02b97f7bc37b2b68fc847fcc3fc1c156"); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java index 6d6e638a71e..64988ba63bd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java @@ -40,7 +40,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.argThat; import static org.mockito.Matchers.eq; diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java index 9e375adfd29..4cb2153786f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java @@ -31,7 +31,7 @@ import org.sonar.jpa.test.AbstractDbUnitTestCase; import java.util.Arrays; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterNewMeasureFiltersTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterNewMeasureFiltersTest.java index 1799b43ef96..ddb9a393b51 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterNewMeasureFiltersTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterNewMeasureFiltersTest.java @@ -30,7 +30,7 @@ import org.sonar.core.measure.db.MeasureFilterDto; import org.sonar.core.template.LoadedTemplateDao; import org.sonar.core.template.LoadedTemplateDto; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/CoverageServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/CoverageServiceTest.java index 7cc65583e1d..7bf569fe196 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/test/CoverageServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/test/CoverageServiceTest.java @@ -38,7 +38,7 @@ import org.sonar.server.user.MockUserSession; import java.util.Collections; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/ws/CoverageWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/ws/CoverageWsTest.java index aa1ad9e8667..4529abf38bf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/test/ws/CoverageWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/test/ws/CoverageWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.WebService; import org.sonar.server.test.CoverageService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class CoverageWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java index 50290be7023..9d3f4ce3b25 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java @@ -27,7 +27,7 @@ import org.sonar.core.component.SnapshotPerspectives; import org.sonar.server.db.DbClient; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class TestsWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java b/server/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java index 3579c90964c..44ec7978d17 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java @@ -24,7 +24,7 @@ import org.junit.Before; import org.junit.Test; import org.sonar.api.platform.Server; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java index 1ccdd6a1709..ef43ebf1a4c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java @@ -21,7 +21,7 @@ package org.sonar.server.text; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyI18nTest.java b/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyI18nTest.java index b3c4a22177c..6697f578d43 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyI18nTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyI18nTest.java @@ -31,7 +31,7 @@ import org.sonar.api.utils.Durations; import java.util.Date; import java.util.Locale; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyProfilingTest.java b/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyProfilingTest.java index ad23d886b05..5682a59eda8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyProfilingTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ui/JRubyProfilingTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import org.sonar.api.config.Settings; import org.sonar.core.profiling.Profiling; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class JRubyProfilingTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/ui/PageDecorationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/ui/PageDecorationsTest.java index a6f761c0d42..cae2dbb7782 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ui/PageDecorationsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ui/PageDecorationsTest.java @@ -24,7 +24,7 @@ import org.sonar.api.web.PageDecoration; import java.util.Arrays; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class PageDecorationsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java b/server/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java index 4bff9fb717f..b1f9351f3c2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java @@ -37,7 +37,7 @@ import org.sonar.api.web.WidgetScope; import java.util.List; import static com.google.common.collect.Iterables.getOnlyElement; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.greaterThan; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java b/server/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java index e10387fb557..7143e4d7b7e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java @@ -30,7 +30,7 @@ import org.sonar.api.web.Widget; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/updatecenter/ws/UpdateCenterWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/updatecenter/ws/UpdateCenterWsTest.java index 913a14308c8..0208a7d859c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/updatecenter/ws/UpdateCenterWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/updatecenter/ws/UpdateCenterWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class UpdateCenterWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/DefaultUserServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/DefaultUserServiceTest.java index 98a8f308a8a..94af4444276 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/DefaultUserServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/DefaultUserServiceTest.java @@ -39,8 +39,8 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.argThat; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java index 75a8bc7a32b..5fbdf07f4b4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java @@ -21,7 +21,7 @@ package org.sonar.server.user; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class DoPrivilegedTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipFinderTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipFinderTest.java index 581eaa863be..090369bb2b2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipFinderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipFinderTest.java @@ -26,7 +26,7 @@ import org.mockito.ArgumentCaptor; import org.sonar.core.user.*; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyLong; import static org.mockito.Matchers.eq; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java index b185ad413ed..55688bfe10e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java @@ -32,8 +32,8 @@ import org.sonar.server.exceptions.NotFoundException; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; /** * Use BbUnit tests because there's no IT on this feature for the moment diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/MockUserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/MockUserSessionTest.java index 2646b845eac..8a2b0acc4f9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/MockUserSessionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/MockUserSessionTest.java @@ -21,7 +21,7 @@ package org.sonar.server.user; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MockUserSessionTest { @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java index 24737aecc3a..6a32744ea58 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import java.util.Locale; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class RubyUserSessionTest { @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/SecurityRealmFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/SecurityRealmFactoryTest.java index 650db3d1447..d97ddbc314e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/SecurityRealmFactoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/SecurityRealmFactoryTest.java @@ -26,7 +26,7 @@ import org.sonar.api.security.LoginPasswordAuthenticator; import org.sonar.api.security.SecurityRealm; import org.sonar.api.utils.SonarException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserServiceMediumTest.java index e24dbb3321b..578bf64518d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/UserServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserServiceMediumTest.java @@ -37,7 +37,7 @@ import org.sonar.server.user.index.UserDoc; import org.sonar.server.user.index.UserIndexDefinition; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class UserServiceMediumTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java index efb3d7f1082..461e0f041a1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java @@ -28,7 +28,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import java.util.Locale; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java index 59a76d1fe9c..e85708125fa 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java @@ -34,7 +34,7 @@ import java.util.Arrays; import java.util.Locale; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java index 91b845e7690..148e47da4cf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java @@ -52,8 +52,8 @@ import org.sonar.server.util.Validation; import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/db/GroupDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/db/GroupDaoTest.java index a422d3b04b0..281f65e00ea 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/db/GroupDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/db/GroupDaoTest.java @@ -29,7 +29,7 @@ import org.sonar.core.persistence.AbstractDaoTestCase; import org.sonar.core.persistence.DbSession; import org.sonar.core.user.GroupDto; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java index 054d320e1e6..4c7ffa0386f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java @@ -30,8 +30,8 @@ import org.sonar.core.persistence.DbTester; import org.sonar.core.user.UserDto; import org.sonar.server.exceptions.NotFoundException; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class UserDaoTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexDefinitionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexDefinitionTest.java index 0030581de4f..3c0c0285248 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexDefinitionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexDefinitionTest.java @@ -25,7 +25,7 @@ import org.sonar.process.ProcessConstants; import org.sonar.server.es.IndexDefinition; import org.sonar.server.es.NewIndex; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class UserIndexDefinitionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexTest.java index 34a9a9415fe..096e4076bae 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexTest.java @@ -27,8 +27,8 @@ import org.sonar.api.config.Settings; import org.sonar.server.es.EsTester; import org.sonar.server.exceptions.NotFoundException; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class UserIndexTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java index 56b3d282b95..405fa782333 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java @@ -30,7 +30,7 @@ import org.sonar.test.DbTests; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class UserIndexerTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java index 939c03c382d..39847370545 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java @@ -34,7 +34,7 @@ import org.sonar.test.DbTests; import java.sql.Connection; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; @Category(DbTests.class) public class UserResultSetIteratorTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java index e9148ecb3c3..bacff868cec 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java @@ -40,7 +40,7 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/FavoritesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/FavoritesWsTest.java index 184414f8a39..d35d5220e43 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/FavoritesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/FavoritesWsTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class FavoritesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java index 7d4c7c2ab0f..c56aeb5d441 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java @@ -38,7 +38,7 @@ import java.util.Map; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; @RunWith(MockitoJUnitRunner.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UserPropertiesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UserPropertiesWsTest.java index bbedb353032..38cf64ef5a3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UserPropertiesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UserPropertiesWsTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.api.server.ws.WebService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class UserPropertiesWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java index 3a3290019a1..ac816d868e1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java @@ -28,7 +28,7 @@ import org.sonar.api.server.ws.WebService; import org.sonar.server.user.UserService; import org.sonar.server.ws.WsTester; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; public class UsersWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/BooleanTypeValidationTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/BooleanTypeValidationTest.java index 031a1e98468..e10d437fe07 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/BooleanTypeValidationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/BooleanTypeValidationTest.java @@ -24,7 +24,7 @@ import org.junit.Before; import org.junit.Test; import org.sonar.server.exceptions.BadRequestException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; public class BooleanTypeValidationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/FloatTypeValidationTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/FloatTypeValidationTest.java index b5830388efb..1863814c486 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/FloatTypeValidationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/FloatTypeValidationTest.java @@ -24,7 +24,7 @@ import org.junit.Before; import org.junit.Test; import org.sonar.server.exceptions.BadRequestException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; public class FloatTypeValidationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/IntegerTypeValidationTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/IntegerTypeValidationTest.java index 4ba7acf9eed..823fae859b1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/IntegerTypeValidationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/IntegerTypeValidationTest.java @@ -24,7 +24,7 @@ import org.junit.Before; import org.junit.Test; import org.sonar.server.exceptions.BadRequestException; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; public class IntegerTypeValidationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/ProgressLoggerTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/ProgressLoggerTest.java index c48af360617..2fde99f4572 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/ProgressLoggerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/ProgressLoggerTest.java @@ -24,7 +24,7 @@ import org.slf4j.Logger; import java.util.concurrent.atomic.AtomicLong; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/RubyUtilsTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/RubyUtilsTest.java index ddf05daa089..59174852d8c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/RubyUtilsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/RubyUtilsTest.java @@ -27,8 +27,8 @@ import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.SonarException; import static java.util.Arrays.asList; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class RubyUtilsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/SlugTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/SlugTest.java index b0345b6f875..f6043d19aad 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/SlugTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/SlugTest.java @@ -21,7 +21,7 @@ package org.sonar.server.util; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class SlugTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/StringListTypeValidationTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/StringListTypeValidationTest.java index 3977228c636..95d56d08eb0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/StringListTypeValidationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/StringListTypeValidationTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import org.sonar.server.exceptions.BadRequestException; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; public class StringListTypeValidationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/StringTypeValidationTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/StringTypeValidationTest.java index b9aae7ec1f1..76460347386 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/StringTypeValidationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/StringTypeValidationTest.java @@ -23,7 +23,7 @@ package org.sonar.server.util; import org.junit.Before; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class StringTypeValidationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/TextTypeValidationTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/TextTypeValidationTest.java index e498f85043f..02ce599aa22 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/TextTypeValidationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/TextTypeValidationTest.java @@ -23,7 +23,7 @@ package org.sonar.server.util; import org.junit.Before; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class TextTypeValidationTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/util/TypeValidationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/util/TypeValidationsTest.java index fc2331d5f86..36696b0adb8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/util/TypeValidationsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/util/TypeValidationsTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.sonar.server.exceptions.BadRequestException; import static com.google.common.collect.Lists.newArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static org.mockito.Mockito.*; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/ListingWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/ws/ListingWsTest.java index 7e1faf62fad..d4e29d785b7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ws/ListingWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ws/ListingWsTest.java @@ -26,7 +26,7 @@ import org.sonar.api.server.ws.RequestHandler; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ListingWsTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java b/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java index f6cdb3c604b..376842ed5da 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java @@ -43,7 +43,7 @@ import java.io.InputStream; import java.util.Locale; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WsTester.java b/server/sonar-server/src/test/java/org/sonar/server/ws/WsTester.java index c4b55bb164f..0ae7b212cc0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ws/WsTester.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ws/WsTester.java @@ -41,7 +41,7 @@ import java.net.HttpURLConnection; import java.net.URL; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * @since 4.2 diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java index fc23e4d7c9e..63889f42730 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java @@ -19,7 +19,6 @@ */ package org.sonar.wsclient; -import org.fest.assertions.MapAssert; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.sonar.wsclient.internal.HttpRequestFactory; @@ -34,8 +33,8 @@ import org.sonar.wsclient.user.internal.DefaultUserClient; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -122,8 +121,8 @@ public class SonarClientTest { verify(requestFactory).get(eq("api/foo"), paramsCapture.capture()); Map params = paramsCapture.getValue(); assertThat(params).hasSize(2); - assertThat(params).includes(MapAssert.entry("key", "the_key")); - assertThat(params).includes(MapAssert.entry("max", 10)); + assertThat(params).containsEntry("key", "the_key"); + assertThat(params).containsEntry("max", 10); } @Test @@ -137,7 +136,7 @@ public class SonarClientTest { verify(requestFactory).post(eq("api/foo"), paramsCapture.capture()); Map params = paramsCapture.getValue(); assertThat(params).hasSize(1); - assertThat(params).includes(MapAssert.entry("max", 10)); + assertThat(params).containsEntry("max", 10); } @Test diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/base/HttpExceptionTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/base/HttpExceptionTest.java index 04e3fc048fe..a45a98f8798 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/base/HttpExceptionTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/base/HttpExceptionTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.base; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class HttpExceptionTest { @Test diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/EncodingUtilsTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/EncodingUtilsTest.java index 169111ac43c..899a81d9c30 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/EncodingUtilsTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/EncodingUtilsTest.java @@ -23,9 +23,9 @@ import org.junit.Test; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; +import static org.junit.Assert.fail; public class EncodingUtilsTest { @Test @@ -37,16 +37,16 @@ public class EncodingUtilsTest { @Test public void test_string_array_param() { - assertThat(EncodingUtils.toQueryParam(new String[]{"foo", "bar"})).isEqualTo("foo,bar"); - assertThat(EncodingUtils.toQueryParam(new String[]{"foo"})).isEqualTo("foo"); - assertThat(EncodingUtils.toQueryParam(new String[]{""})).isEqualTo(""); + assertThat(EncodingUtils.toQueryParam(new String[] {"foo", "bar"})).isEqualTo("foo,bar"); + assertThat(EncodingUtils.toQueryParam(new String[] {"foo"})).isEqualTo("foo"); + assertThat(EncodingUtils.toQueryParam(new String[] {""})).isEqualTo(""); } @Test public void test_toMap() { assertThat(EncodingUtils.toMap()).isEmpty(); - assertThat(EncodingUtils.toMap("foo", "bar")).hasSize(1).includes(entry("foo", "bar")); - assertThat(EncodingUtils.toMap("1", "one", "2", "two")).hasSize(2).includes(entry("1", "one"), entry("2", "two")); + assertThat(EncodingUtils.toMap("foo", "bar")).hasSize(1).containsEntry("foo", "bar"); + assertThat(EncodingUtils.toMap("1", "one", "2", "two")).hasSize(2).contains(entry("1", "one"), entry("2", "two")); assertThat(EncodingUtils.toMap("foo", null)).isEmpty(); } diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java index a4ff84c215a..0e790b07650 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java @@ -32,8 +32,8 @@ import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class HttpRequestFactoryTest { @Rule diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/ActionPlanQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/ActionPlanQueryTest.java index 35a1071cb9f..6a04d8a2227 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/ActionPlanQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/ActionPlanQueryTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ActionPlanQueryTest { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/BulkChangeQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/BulkChangeQueryTest.java index b161ba4d3d2..68dd9003526 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/BulkChangeQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/BulkChangeQueryTest.java @@ -22,8 +22,7 @@ package org.sonar.wsclient.issue; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; public class BulkChangeQueryTest { @@ -42,13 +41,12 @@ public class BulkChangeQueryTest { .comment("My bulk comment") .sendNotifications(false); - assertThat(query.urlParams()).hasSize(5).includes( - entry("issues", "ABCD,EFGH"), - entry("actions", "assign"), - entry("assign.assignee", "geoffrey"), - entry("comment", "My bulk comment"), - entry("sendNotifications", "false") - ); + assertThat(query.urlParams()).hasSize(5) + .containsEntry("issues", "ABCD,EFGH") + .containsEntry("actions", "assign") + .containsEntry("assign.assignee", "geoffrey") + .containsEntry("comment", "My bulk comment") + .containsEntry("sendNotifications", "false"); } @Test diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java index cb19cf35c63..a13ba3d456a 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java @@ -24,8 +24,8 @@ import org.junit.Test; import java.text.ParseException; import java.text.SimpleDateFormat; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; + public class IssueQueryTest { @Test @@ -62,28 +62,28 @@ public class IssueQueryTest { .pageIndex(4); assertThat(query.urlParams()).hasSize(22); - assertThat(query.urlParams()).includes(entry("issues", "ABCDE,FGHIJ")); - assertThat(query.urlParams()).includes(entry("assignees", "arthur,perceval")); - assertThat(query.urlParams()).includes(entry("assigned", true)); - assertThat(query.urlParams()).includes(entry("planned", true)); - assertThat(query.urlParams()).includes(entry("components", "Action.java,Filter.java")); - assertThat(query.urlParams()).includes(entry("onComponentOnly", true)); - assertThat(query.urlParams()).includes(entry("rules", "squid:AvoidCycle")); - assertThat(query.urlParams()).includes(entry("actionPlans", "ABC")); - assertThat(query.urlParams()).includes(entry("resolutions", "FIXED,FALSE-POSITIVE")); - assertThat(query.urlParams()).includes(entry("resolved", true)); - assertThat(query.urlParams()).includes(entry("hideRules", true)); - assertThat(query.urlParams()).includes(entry("statuses", "OPEN,CLOSED")); - assertThat(query.urlParams()).includes(entry("severities", "BLOCKER,INFO")); - assertThat(query.urlParams()).includes(entry("reporters", "login1,login2")); - assertThat(query.urlParams()).includes(entry("languages", "xoo,java")); - assertThat((String)query.urlParams().get("createdBefore")).startsWith("2015-12-13T05:59:50"); - assertThat((String)query.urlParams().get("createdAfter")).startsWith("2012-01-23T13:40:50"); - assertThat((String)query.urlParams().get("createdAt")).startsWith("2015-01-02T05:59:50"); - assertThat(query.urlParams()).includes(entry("sort", "ASSIGNEE")); - assertThat(query.urlParams()).includes(entry("asc", false)); - assertThat(query.urlParams()).includes(entry("pageSize", 5)); - assertThat(query.urlParams()).includes(entry("pageIndex", 4)); + assertThat(query.urlParams()).containsEntry("issues", "ABCDE,FGHIJ"); + assertThat(query.urlParams()).containsEntry("assignees", "arthur,perceval"); + assertThat(query.urlParams()).containsEntry("assigned", true); + assertThat(query.urlParams()).containsEntry("planned", true); + assertThat(query.urlParams()).containsEntry("components", "Action.java,Filter.java"); + assertThat(query.urlParams()).containsEntry("onComponentOnly", true); + assertThat(query.urlParams()).containsEntry("rules", "squid:AvoidCycle"); + assertThat(query.urlParams()).containsEntry("actionPlans", "ABC"); + assertThat(query.urlParams()).containsEntry("resolutions", "FIXED,FALSE-POSITIVE"); + assertThat(query.urlParams()).containsEntry("resolved", true); + assertThat(query.urlParams()).containsEntry("hideRules", true); + assertThat(query.urlParams()).containsEntry("statuses", "OPEN,CLOSED"); + assertThat(query.urlParams()).containsEntry("severities", "BLOCKER,INFO"); + assertThat(query.urlParams()).containsEntry("reporters", "login1,login2"); + assertThat(query.urlParams()).containsEntry("languages", "xoo,java"); + assertThat((String) query.urlParams().get("createdBefore")).startsWith("2015-12-13T05:59:50"); + assertThat((String) query.urlParams().get("createdAfter")).startsWith("2012-01-23T13:40:50"); + assertThat((String) query.urlParams().get("createdAt")).startsWith("2015-01-02T05:59:50"); + assertThat(query.urlParams()).containsEntry("sort", "ASSIGNEE"); + assertThat(query.urlParams()).containsEntry("asc", false); + assertThat(query.urlParams()).containsEntry("pageSize", 5); + assertThat(query.urlParams()).containsEntry("pageIndex", 4); } @Test diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/NewIssueTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/NewIssueTest.java index a695d78c2b8..da23f49cb19 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/NewIssueTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/NewIssueTest.java @@ -21,8 +21,9 @@ package org.sonar.wsclient.issue; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; + public class NewIssueTest { @Test @@ -41,7 +42,7 @@ public class NewIssueTest { .severity("BLOCKER") .attribute("JIRA", "FOO-123"); - assertThat(newIssue.urlParams()).hasSize(7).includes( + assertThat(newIssue.urlParams()).hasSize(7).contains( entry("component", "Action.java"), entry("effortToFix", 4.2), entry("message", "the message"), @@ -58,7 +59,7 @@ public class NewIssueTest { .component("Action.java") .rule("squid:AvoidCycle"); - assertThat(newIssue.urlParams()).hasSize(2).includes( + assertThat(newIssue.urlParams()).containsOnly( entry("component", "Action.java"), entry("rule", "squid:AvoidCycle") ); diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java index 5cdbe5296e5..9621c9878fc 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java @@ -35,9 +35,9 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; +import static org.junit.Assert.fail; public class DefaultActionPlanClientTest { @@ -88,12 +88,12 @@ public class DefaultActionPlanClientTest { NewActionPlan.create().name("Short term").project("org.sonar.Sample").description("Short term issues").deadLine(stringToDate("2014-01-01"))); assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/create"); - assertThat(httpServer.requestParams()).includes( + assertThat(httpServer.requestParams()).contains( entry("project", "org.sonar.Sample"), entry("description", "Short term issues"), entry("name", "Short term"), entry("deadLine", "2014-01-01") - ); + ); assertThat(result).isNotNull(); } @@ -107,12 +107,12 @@ public class DefaultActionPlanClientTest { UpdateActionPlan.create().key("382f6f2e-ad9d-424a-b973-9b065e04348a").name("Short term").description("Short term issues").deadLine(stringToDate("2014-01-01"))); assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/update"); - assertThat(httpServer.requestParams()).includes( + assertThat(httpServer.requestParams()).contains( entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a"), entry("description", "Short term issues"), entry("name", "Short term"), entry("deadLine", "2014-01-01") - ); + ); assertThat(result).isNotNull(); } @@ -124,9 +124,9 @@ public class DefaultActionPlanClientTest { client.delete("382f6f2e-ad9d-424a-b973-9b065e04348a"); assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/delete"); - assertThat(httpServer.requestParams()).includes( + assertThat(httpServer.requestParams()).contains( entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a") - ); + ); } @Test @@ -142,9 +142,9 @@ public class DefaultActionPlanClientTest { assertThat(e.status()).isEqualTo(500); assertThat(e.url()).startsWith("http://localhost"); assertThat(e.url()).endsWith("/api/action_plans/delete"); - assertThat(httpServer.requestParams()).includes( + assertThat(httpServer.requestParams()).contains( entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a") - ); + ); } } @@ -157,9 +157,7 @@ public class DefaultActionPlanClientTest { ActionPlan result = client.open("382f6f2e-ad9d-424a-b973-9b065e04348a"); assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/open"); - assertThat(httpServer.requestParams()).includes( - entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a") - ); + assertThat(httpServer.requestParams()).containsEntry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a"); assertThat(result).isNotNull(); } @@ -172,9 +170,7 @@ public class DefaultActionPlanClientTest { ActionPlan result = client.close("382f6f2e-ad9d-424a-b973-9b065e04348a"); assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/close"); - assertThat(httpServer.requestParams()).includes( - entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a") - ); + assertThat(httpServer.requestParams()).containsEntry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a"); assertThat(result).isNotNull(); } diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultIssueClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultIssueClientTest.java index acfcc508a64..2ec92b57076 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultIssueClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultIssueClientTest.java @@ -25,13 +25,19 @@ import org.junit.Test; import org.sonar.wsclient.MockHttpServerInterceptor; import org.sonar.wsclient.base.HttpException; import org.sonar.wsclient.internal.HttpRequestFactory; -import org.sonar.wsclient.issue.*; +import org.sonar.wsclient.issue.BulkChange; +import org.sonar.wsclient.issue.BulkChangeQuery; +import org.sonar.wsclient.issue.Issue; +import org.sonar.wsclient.issue.IssueClient; +import org.sonar.wsclient.issue.IssueComment; +import org.sonar.wsclient.issue.IssueQuery; +import org.sonar.wsclient.issue.Issues; +import org.sonar.wsclient.issue.NewIssue; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class DefaultIssueClientTest { @@ -77,10 +83,9 @@ public class DefaultIssueClientTest { Issue result = client.setSeverity("ABCDE", "BLOCKER"); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/set_severity"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE"), - entry("severity", "BLOCKER") - ); + assertThat(httpServer.requestParams()) + .containsEntry("issue", "ABCDE") + .containsEntry("severity", "BLOCKER"); assertThat(result).isNotNull(); } @@ -93,10 +98,9 @@ public class DefaultIssueClientTest { Issue result = client.assign("ABCDE", "emmerik"); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/assign"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE"), - entry("assignee", "emmerik") - ); + assertThat(httpServer.requestParams()) + .containsEntry("issue", "ABCDE") + .containsEntry("assignee", "emmerik"); assertThat(result).isNotNull(); } @@ -109,10 +113,9 @@ public class DefaultIssueClientTest { Issue result = client.assignToMe("ABCDE"); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/assign"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE"), - entry("me", "true") - ); + assertThat(httpServer.requestParams()) + .containsEntry("issue", "ABCDE") + .containsEntry("me", "true"); assertThat(result).isNotNull(); } @@ -125,9 +128,7 @@ public class DefaultIssueClientTest { Issue result = client.assign("ABCDE", null); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/assign"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE") - ); + assertThat(httpServer.requestParams()).containsEntry("issue", "ABCDE"); assertThat(result).isNotNull(); } @@ -140,10 +141,9 @@ public class DefaultIssueClientTest { Issue result = client.plan("ABCDE", "DEFGH"); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/plan"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE"), - entry("plan", "DEFGH") - ); + assertThat(httpServer.requestParams()) + .containsEntry("issue", "ABCDE") + .containsEntry("plan", "DEFGH"); assertThat(result).isNotNull(); } @@ -156,9 +156,7 @@ public class DefaultIssueClientTest { Issue result = client.plan("ABCDE", null); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/plan"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE") - ); + assertThat(httpServer.requestParams()).containsEntry("issue", "ABCDE"); assertThat(result).isNotNull(); } @@ -171,10 +169,9 @@ public class DefaultIssueClientTest { Issue result = client.create(NewIssue.create().component("Action.java").rule("squid:AvoidCycle")); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/create"); - assertThat(httpServer.requestParams()).includes( - entry("component", "Action.java"), - entry("rule", "squid:AvoidCycle") - ); + assertThat(httpServer.requestParams()) + .containsEntry("component", "Action.java") + .containsEntry("rule", "squid:AvoidCycle"); assertThat(result).isNotNull(); } @@ -205,10 +202,9 @@ public class DefaultIssueClientTest { Issue result = client.doTransition("ABCDE", "resolve"); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/do_transition"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE"), - entry("transition", "resolve") - ); + assertThat(httpServer.requestParams()) + .containsEntry("issue", "ABCDE") + .containsEntry("transition", "resolve"); assertThat(result).isNotNull(); } @@ -221,10 +217,9 @@ public class DefaultIssueClientTest { IssueComment comment = client.addComment("ISSUE-1", "this is my comment"); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/add_comment"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ISSUE-1"), - entry("text", "this is my comment") - ); + assertThat(httpServer.requestParams()) + .containsEntry("issue", "ISSUE-1") + .containsEntry("text", "this is my comment"); assertThat(comment).isNotNull(); assertThat(comment.key()).isEqualTo("COMMENT-123"); assertThat(comment.htmlText()).isEqualTo("this is my comment"); @@ -259,10 +254,9 @@ public class DefaultIssueClientTest { Issue result = client.doAction("ABCDE", "tweet"); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/do_action"); - assertThat(httpServer.requestParams()).includes( - entry("issue", "ABCDE"), - entry("actionKey", "tweet") - ); + assertThat(httpServer.requestParams()) + .containsEntry("issue", "ABCDE") + .containsEntry("actionKey", "tweet"); assertThat(result).isNotNull(); } @@ -280,11 +274,10 @@ public class DefaultIssueClientTest { BulkChange result = client.bulkChange(query); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/bulk_change"); - assertThat(httpServer.requestParams()).includes( - entry("assign.assignee", "geoffrey"), - entry("issues", "ABCD,EFGH"), - entry("actions", "assign") - ); + assertThat(httpServer.requestParams()) + .containsEntry("assign.assignee", "geoffrey") + .containsEntry("issues", "ABCD,EFGH") + .containsEntry("actions", "assign"); assertThat(result).isNotNull(); } } diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java index b1fc2296da0..c4db8a6f4e5 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java @@ -28,7 +28,7 @@ import org.sonar.wsclient.user.User; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class IssueJsonParserTest { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/permissions/DefaultPermissionClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/permissions/DefaultPermissionClientTest.java index 33a08c7f01d..8b2eee82059 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/permissions/DefaultPermissionClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/permissions/DefaultPermissionClientTest.java @@ -27,8 +27,7 @@ import org.sonar.wsclient.MockHttpServerInterceptor; import org.sonar.wsclient.internal.HttpRequestFactory; import org.sonar.wsclient.permissions.internal.DefaultPermissionClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; public class DefaultPermissionClientTest { @@ -52,10 +51,9 @@ public class DefaultPermissionClientTest { client.addPermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add"); - assertThat(httpServer.requestParams()).includes( - entry("user", "daveloper"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("user", "daveloper") + .containsEntry("permission", "admin"); } @Test @@ -66,11 +64,10 @@ public class DefaultPermissionClientTest { client.addPermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add"); - assertThat(httpServer.requestParams()).includes( - entry("user", "daveloper"), - entry("component", "org.sample.Sample"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("user", "daveloper") + .containsEntry("component", "org.sample.Sample") + .containsEntry("permission", "admin"); } @Test @@ -81,10 +78,9 @@ public class DefaultPermissionClientTest { client.addPermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add"); - assertThat(httpServer.requestParams()).includes( - entry("group", "my_group"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("group", "my_group") + .containsEntry("permission", "admin"); } @Test @@ -95,11 +91,10 @@ public class DefaultPermissionClientTest { client.addPermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/add"); - assertThat(httpServer.requestParams()).includes( - entry("group", "my_group"), - entry("component", "org.sample.Sample"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("group", "my_group") + .containsEntry("component", "org.sample.Sample") + .containsEntry("permission", "admin"); } @Test @@ -110,10 +105,9 @@ public class DefaultPermissionClientTest { client.removePermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove"); - assertThat(httpServer.requestParams()).includes( - entry("user", "daveloper"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("user", "daveloper") + .containsEntry("permission", "admin"); } @Test @@ -124,11 +118,10 @@ public class DefaultPermissionClientTest { client.removePermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove"); - assertThat(httpServer.requestParams()).includes( - entry("user", "daveloper"), - entry("component", "org.sample.Sample"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("user", "daveloper") + .containsEntry("component", "org.sample.Sample") + .containsEntry("permission", "admin"); } @Test @@ -139,10 +132,9 @@ public class DefaultPermissionClientTest { client.removePermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove"); - assertThat(httpServer.requestParams()).includes( - entry("group", "my_group"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("group", "my_group") + .containsEntry("permission", "admin"); } @Test @@ -153,10 +145,9 @@ public class DefaultPermissionClientTest { client.removePermission(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/permissions/remove"); - assertThat(httpServer.requestParams()).includes( - entry("group", "my_group"), - entry("component", "org.sample.Sample"), - entry("permission", "admin") - ); + assertThat(httpServer.requestParams()) + .containsEntry("group", "my_group") + .containsEntry("component", "org.sample.Sample") + .containsEntry("permission", "admin"); } } diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/NewProjectTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/NewProjectTest.java index bdac8beddb7..eb01a0b8b9a 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/NewProjectTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/NewProjectTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class NewProjectTest { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/internal/DefaultProjectClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/internal/DefaultProjectClientTest.java index 3dc9dc5754b..2ee276378dd 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/internal/DefaultProjectClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/project/internal/DefaultProjectClientTest.java @@ -27,8 +27,8 @@ import org.sonar.wsclient.project.NewProject; import org.sonar.wsclient.project.Project; import org.sonar.wsclient.project.ProjectClient; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; public class DefaultProjectClientTest { @@ -45,10 +45,10 @@ public class DefaultProjectClientTest { Project result = client.create(NewProject.create().key("polop").name("Polop")); assertThat(httpServer.requestedPath()).isEqualTo("/api/projects/create"); - assertThat(httpServer.requestParams()).includes( + assertThat(httpServer.requestParams()).contains( entry("key", "polop"), entry("name", "Polop") - ); + ); assertThat(result).isNotNull(); } diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClientTest.java index 9ee9ed21d4a..c3b987e1e6c 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qprofile/internal/DefaultQProfileClientTest.java @@ -26,8 +26,7 @@ import org.sonar.wsclient.MockHttpServerInterceptor; import org.sonar.wsclient.internal.HttpRequestFactory; import org.sonar.wsclient.qprofile.QProfileResult; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; public class DefaultQProfileClientTest { @@ -44,9 +43,7 @@ public class DefaultQProfileClientTest { QProfileResult result = client.restoreDefault("java"); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualityprofiles/restore_default"); - assertThat(httpServer.requestParams()).includes( - entry("language", "java") - ); + assertThat(httpServer.requestParams()).containsEntry("language", "java"); assertThat(result).isNotNull(); assertThat(result.infos()).containsOnly("Some info"); assertThat(result.warnings()).containsOnly("Some warnings"); diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClientTest.java index f6cb803a6a9..ea4d796edd9 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/qualitygate/internal/DefaultQualityGateClientTest.java @@ -23,14 +23,20 @@ import org.junit.Rule; import org.junit.Test; import org.sonar.wsclient.MockHttpServerInterceptor; import org.sonar.wsclient.internal.HttpRequestFactory; -import org.sonar.wsclient.qualitygate.*; +import org.sonar.wsclient.qualitygate.NewCondition; +import org.sonar.wsclient.qualitygate.QualityGate; +import org.sonar.wsclient.qualitygate.QualityGateClient; +import org.sonar.wsclient.qualitygate.QualityGateCondition; +import org.sonar.wsclient.qualitygate.QualityGateDetails; +import org.sonar.wsclient.qualitygate.QualityGates; +import org.sonar.wsclient.qualitygate.UpdateCondition; import java.net.HttpURLConnection; import java.util.Collection; import java.util.Iterator; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; public class DefaultQualityGateClientTest { @@ -47,9 +53,7 @@ public class DefaultQualityGateClientTest { QualityGate result = client.create("Ninth"); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/create"); - assertThat(httpServer.requestParams()).includes( - entry("name", "Ninth") - ); + assertThat(httpServer.requestParams()).containsEntry("name", "Ninth"); assertThat(result).isNotNull(); assertThat(result.id()).isEqualTo(666L); assertThat(result.name()).isEqualTo("Ninth"); @@ -60,7 +64,7 @@ public class DefaultQualityGateClientTest { HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url()); httpServer.stubResponseBody( - "{\"qualitygates\":[{\"id\":666,\"name\":\"Ninth\"},{\"id\":42,\"name\":\"Golden\"},{\"id\":43,\"name\":\"Star\"}],\"default\":42}"); + "{\"qualitygates\":[{\"id\":666,\"name\":\"Ninth\"},{\"id\":42,\"name\":\"Golden\"},{\"id\":43,\"name\":\"Star\"}],\"default\":42}"); QualityGateClient client = new DefaultQualityGateClient(requestFactory); QualityGates qGates = client.list(); @@ -76,7 +80,7 @@ public class DefaultQualityGateClientTest { HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url()); httpServer.stubResponseBody( - "{}"); + "{}"); QualityGateClient client = new DefaultQualityGateClient(requestFactory); QualityGates qGates = client.list(); @@ -97,10 +101,10 @@ public class DefaultQualityGateClientTest { QualityGate result = client.rename(666L, "Hell"); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/rename"); - assertThat(httpServer.requestParams()).includes( - entry("id", "666"), - entry("name", "Hell") - ); + assertThat(httpServer.requestParams()).contains( + entry("id", "666"), + entry("name", "Hell") + ); assertThat(result).isNotNull(); } @@ -211,9 +215,7 @@ public class DefaultQualityGateClientTest { client.destroy(666L); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/destroy"); - assertThat(httpServer.requestParams()).includes( - entry("id", "666") - ); + assertThat(httpServer.requestParams()).containsEntry("id", "666"); } @Test @@ -226,9 +228,7 @@ public class DefaultQualityGateClientTest { client.setDefault(666L); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/set_as_default"); - assertThat(httpServer.requestParams()).includes( - entry("id", "666") - ); + assertThat(httpServer.requestParams()).containsEntry("id", "666"); } @Test @@ -255,14 +255,14 @@ public class DefaultQualityGateClientTest { .metricKey("new_coverage").operator("LT").warningThreshold("90").errorThreshold("80").period(3)); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/create_condition"); - assertThat(httpServer.requestParams()).includes( - entry("gateId", "12345"), - entry("metric", "new_coverage"), - entry("op", "LT"), - entry("warning", "90"), - entry("error", "80"), - entry("period", "3") - ); + assertThat(httpServer.requestParams()).contains( + entry("gateId", "12345"), + entry("metric", "new_coverage"), + entry("op", "LT"), + entry("warning", "90"), + entry("error", "80"), + entry("period", "3") + ); assertThat(result).isNotNull(); assertThat(result.id()).isEqualTo(42L); } @@ -278,14 +278,14 @@ public class DefaultQualityGateClientTest { .metricKey("ncloc").operator("GT").warningThreshold("1000").errorThreshold("2000").period(1)); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/update_condition"); - assertThat(httpServer.requestParams()).includes( - entry("id", "12345"), - entry("metric", "ncloc"), - entry("op", "GT"), - entry("warning", "1000"), - entry("error", "2000"), - entry("period", "1") - ); + assertThat(httpServer.requestParams()).contains( + entry("id", "12345"), + entry("metric", "ncloc"), + entry("op", "GT"), + entry("warning", "1000"), + entry("error", "2000"), + entry("period", "1") + ); assertThat(result).isNotNull(); assertThat(result.id()).isEqualTo(12345L); } @@ -297,12 +297,10 @@ public class DefaultQualityGateClientTest { httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT); QualityGateClient client = new DefaultQualityGateClient(requestFactory); - client.deleteCondition(666L);; + client.deleteCondition(666L); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/delete_condition"); - assertThat(httpServer.requestParams()).includes( - entry("id", "666") - ); + assertThat(httpServer.requestParams()).containsEntry("id", "666"); } @Test @@ -315,10 +313,10 @@ public class DefaultQualityGateClientTest { client.selectProject(666L, 999L); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/select"); - assertThat(httpServer.requestParams()).includes( - entry("gateId", "666"), - entry("projectId", "999") - ); + assertThat(httpServer.requestParams()).contains( + entry("gateId", "666"), + entry("projectId", "999") + ); } @Test @@ -331,9 +329,9 @@ public class DefaultQualityGateClientTest { client.deselectProject(666L, 999L); assertThat(httpServer.requestedPath()).isEqualTo("/api/qualitygates/deselect"); - assertThat(httpServer.requestParams()).includes( - entry("gateId", "666"), - entry("projectId", "999") - ); + assertThat(httpServer.requestParams()).contains( + entry("gateId", "666"), + entry("projectId", "999") + ); } } diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AbstractQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AbstractQueryTest.java index e759a5f61cc..f77016df44b 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AbstractQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AbstractQueryTest.java @@ -29,7 +29,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import static junit.framework.Assert.assertEquals; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class AbstractQueryTest { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationQueryTest.java index 69963f2a95f..d667080dccf 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationQueryTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.services; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class AuthenticationQueryTest extends QueryTestCase { @Test diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationTest.java index 2557933ef64..cfd9df67935 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/AuthenticationTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.services; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class AuthenticationTest { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricCreateQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricCreateQueryTest.java index 5b74b164dda..227f313bad4 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricCreateQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricCreateQueryTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.services; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MetricCreateQueryTest extends QueryTestCase { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricDeleteQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricDeleteQueryTest.java index a65f2cfc7a8..4c7af3bd1de 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricDeleteQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricDeleteQueryTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.services; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MetricDeleteQueryTest extends QueryTestCase { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricUpdateQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricUpdateQueryTest.java index 09f0bce3a70..f5baf38b934 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricUpdateQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/MetricUpdateQueryTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.services; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class MetricUpdateQueryTest extends QueryTestCase { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceQueryTest.java index 54cec20583b..c9ca8401391 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceQueryTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.services; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ResourceQueryTest extends QueryTestCase { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerSetupQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerSetupQueryTest.java index e7f899a06c7..1863a7f7881 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerSetupQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ServerSetupQueryTest.java @@ -21,7 +21,7 @@ package org.sonar.wsclient.services; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class ServerSetupQueryTest extends QueryTestCase { @Test diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/TimeMachineQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/TimeMachineQueryTest.java index a23e3a14871..70ab0e1cbf7 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/TimeMachineQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/services/TimeMachineQueryTest.java @@ -29,7 +29,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class TimeMachineQueryTest extends QueryTestCase { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java index 7d550852fda..79c869e5c25 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java @@ -27,8 +27,8 @@ import org.sonar.wsclient.system.Migration; import java.util.Collections; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Matchers.anyMap; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshallerTest.java index 0cbdc303d83..c0742aeab1c 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshallerTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/AuthenticationUnmarshallerTest.java @@ -22,8 +22,8 @@ package org.sonar.wsclient.unmarshallers; import org.junit.Test; import org.sonar.wsclient.services.Authentication; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; public class AuthenticationUnmarshallerTest extends UnmarshallerTestCase { @Test diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java index a6221b4c2eb..60d1f1223e6 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java @@ -25,7 +25,7 @@ import org.sonar.wsclient.services.TimeMachine; import java.util.Calendar; import java.util.Date; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class TimeMachineUnmarshallerTest extends UnmarshallerTestCase { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/DefaultUserClientTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/DefaultUserClientTest.java index 47a4361423d..e59927c5dde 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/DefaultUserClientTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/DefaultUserClientTest.java @@ -29,8 +29,8 @@ import org.sonar.wsclient.user.internal.DefaultUserClient; import java.util.Arrays; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; public class DefaultUserClientTest { @@ -61,7 +61,7 @@ public class DefaultUserClientTest { assertThat(simon.email()).isNull(); assertThat(simon.active()).isTrue(); } - + @Test public void should_create_user() throws Exception { httpServer.stubResponseBody("{\"user\":{\"login\":\"daveloper\",\"name\":\"daveloper\",\"email\":null}}"); @@ -70,17 +70,17 @@ public class DefaultUserClientTest { User createdUser = client.create(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/users/create"); - assertThat(httpServer.requestParams()).includes( + assertThat(httpServer.requestParams()).contains( entry("login", "daveloper"), entry("password", "pass1"), entry("password_confirmation", "pass1") - ); + ); assertThat(createdUser).isNotNull(); assertThat(createdUser.login()).isEqualTo("daveloper"); assertThat(createdUser.name()).isEqualTo("daveloper"); assertThat(createdUser.email()).isNull(); } - + @Test public void should_update_user() throws Exception { httpServer.stubResponseBody("{\"user\":{\"login\":\"daveloper\",\"name\":\"daveloper\",\"email\":\"new_email\"}}"); @@ -89,16 +89,16 @@ public class DefaultUserClientTest { User updatedUser = client.update(params); assertThat(httpServer.requestedPath()).isEqualTo("/api/users/update"); - assertThat(httpServer.requestParams()).includes( + assertThat(httpServer.requestParams()).contains( entry("login", "daveloper"), entry("email", "new_email") - ); + ); assertThat(updatedUser).isNotNull(); assertThat(updatedUser.login()).isEqualTo("daveloper"); assertThat(updatedUser.name()).isEqualTo("daveloper"); assertThat(updatedUser.email()).isEqualTo("new_email"); } - + @Test public void should_deactivate_user() throws Exception { httpServer.stubStatusCode(200); @@ -106,9 +106,7 @@ public class DefaultUserClientTest { client.deactivate("daveloper"); assertThat(httpServer.requestedPath()).isEqualTo("/api/users/deactivate"); - assertThat(httpServer.requestParams()).includes( - entry("login", "daveloper") - ); + assertThat(httpServer.requestParams()).containsEntry("login", "daveloper"); } private void assertThatGetRequestUrlContains(String baseUrl, String... parameters) { diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java index 46ce726f59f..20f4b9893d4 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class UserQueryTest { @Test |