aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-19 13:07:11 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-19 13:07:11 +0100
commit4dcf22377c7823584f0d9d7dbb85641980245fd8 (patch)
tree28594d8d59c4f64deb7e3aa6f06f48b0e737cdb1 /server/sonar-server
parentc3ae1aa643eb9edb168016bfadfbab3af9024962 (diff)
downloadsonarqube-4dcf22377c7823584f0d9d7dbb85641980245fd8.tar.gz
sonarqube-4dcf22377c7823584f0d9d7dbb85641980245fd8.zip
Clean-up sonar-testing-harness dependencies
and decrease usages of Hamcrest
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/pom.xml31
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/notification/NotificationChannelTest.java11
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/CompatibilityRealmTest.java7
3 files changed, 39 insertions, 10 deletions
diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml
index 69f66f0a1c7..bb1b64f3053 100644
--- a/server/sonar-server/pom.xml
+++ b/server/sonar-server/pom.xml
@@ -187,6 +187,32 @@
<!-- unit tests -->
<dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-guava</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <!-- TODO to be removed -->
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-db-testing</artifactId>
<type>pom</type>
@@ -203,6 +229,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>com.tngtech.java</groupId>
+ <artifactId>junit-dataprovider</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>com.github.kevinsawicki</groupId>
<artifactId>http-request</artifactId>
<scope>test</scope>
diff --git a/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationChannelTest.java b/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationChannelTest.java
index d1f466711ec..6e426d7042c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationChannelTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationChannelTest.java
@@ -19,23 +19,22 @@
*/
package org.sonar.server.notification;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
import org.junit.Test;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class NotificationChannelTest {
@Test
public void defaultMethods() {
NotificationChannel channel = new FakeNotificationChannel();
- assertThat(channel.getKey(), is("FakeNotificationChannel"));
- assertThat(channel.toString(), is("FakeNotificationChannel"));
+ assertThat(channel.getKey()).isEqualTo("FakeNotificationChannel");
+ assertThat(channel.toString()).isEqualTo("FakeNotificationChannel");
}
- class FakeNotificationChannel extends NotificationChannel {
+ private class FakeNotificationChannel extends NotificationChannel {
@Override
public void deliver(Notification notification, String username) {
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/CompatibilityRealmTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/CompatibilityRealmTest.java
index eb8ed87820b..95f0dc4e54d 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/CompatibilityRealmTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/CompatibilityRealmTest.java
@@ -22,8 +22,7 @@ package org.sonar.server.user;
import org.junit.Test;
import org.sonar.api.security.LoginPasswordAuthenticator;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -35,8 +34,8 @@ public class CompatibilityRealmTest {
CompatibilityRealm realm = new CompatibilityRealm(authenticator);
realm.init();
verify(authenticator).init();
- assertThat(realm.getLoginPasswordAuthenticator(), is(authenticator));
- assertThat(realm.getName(), is("CompatibilityRealm[" + authenticator.getClass().getName() + "]"));
+ assertThat(realm.getLoginPasswordAuthenticator()).isSameAs(authenticator);
+ assertThat(realm.getName()).isEqualTo("CompatibilityRealm[" + authenticator.getClass().getName() + "]");
}
}