summaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-04-23 15:17:38 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2014-04-23 15:17:48 +0200
commitb131f3d7faae41ae931f522b4ae208c69aab5dee (patch)
tree86c3d1276686bfd3e3c003d004895b72842824cc /sonar-server
parent78768f07309629c4ade43ba5124cb5e076438add (diff)
downloadsonarqube-b131f3d7faae41ae931f522b4ae208c69aab5dee.tar.gz
sonarqube-b131f3d7faae41ae931f522b4ae208c69aab5dee.zip
Remove the class MoreConditions from sonar-testing-harness
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java b/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java
index 2a38d59274a..33ea65d13ef 100644
--- a/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/startup/RegisterDashboardsTest.java
@@ -37,6 +37,7 @@ import org.sonar.core.template.LoadedTemplateDao;
import org.sonar.core.template.LoadedTemplateDto;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import static org.fest.assertions.Assertions.assertThat;
@@ -47,7 +48,6 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.sonar.test.MoreConditions.contains;
public class RegisterDashboardsTest {
private RegisterDashboards task;
@@ -63,8 +63,8 @@ public class RegisterDashboardsTest {
loadedTemplateDao = mock(LoadedTemplateDao.class);
fakeDashboardTemplate = mock(DashboardTemplate.class);
- task = new RegisterDashboards(new DashboardTemplate[] {fakeDashboardTemplate}, dashboardDao,
- activeDashboardDao, loadedTemplateDao);
+ task = new RegisterDashboards(new DashboardTemplate[]{fakeDashboardTemplate}, dashboardDao,
+ activeDashboardDao, loadedTemplateDao);
}
@Test
@@ -128,8 +128,8 @@ public class RegisterDashboardsTest {
@Test
public void shouldCreateDtoFromExtension() {
Dashboard dashboard = Dashboard.create()
- .setGlobal(true)
- .setLayout(DashboardLayout.TWO_COLUMNS_30_70);
+ .setGlobal(true)
+ .setLayout(DashboardLayout.TWO_COLUMNS_30_70);
Dashboard.Widget widget = dashboard.addWidget("fake-widget", 1);
widget.setProperty("fake-property", "fake_metric");
when(fakeDashboardTemplate.createDashboard()).thenReturn(dashboard);
@@ -153,7 +153,11 @@ public class RegisterDashboardsTest {
assertThat(widgetDto.getCreatedAt()).isNotNull();
assertThat(widgetDto.getUpdatedAt()).isNotNull();
- assertThat(widgetDto.getWidgetProperties()).satisfies(contains(new WidgetPropertyDto().setKey("fake-property").setValue("fake_metric")));
+ Collection<WidgetPropertyDto> props = widgetDto.getWidgetProperties();
+ assertThat(props).hasSize(1);
+ WidgetPropertyDto prop = Iterables.getFirst(props, null);
+ assertThat(prop.getKey()).isEqualTo("fake-property");
+ assertThat(prop.getValue()).isEqualTo("fake_metric");
}
@Test