org.fest.assertions.Assertions.assertThat-sorg.assertj.core.api.Assertions.assertThat-s



Project SonarSource/sonarqube in file ...rg.sonar.plugins.core.widgets.CoreWidgetsTest.java (2015-01-10)
@@ -34,7 +34,7 @@ import java.util.Collection;
 import java.util.Set;
 
 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 CoreWidgetsTest {
 
@@ -83,7 +83,7 @@ public class CoreWidgetsTest {
   @Test
   public void should_be_registered_as_an_extension() {
     for (CoreWidget widget : widgets()) {
-      assertThat(new CorePlugin().getExtensions()).as("Widget not registered: " + widget.getClass()).contains(widget.getClass());
+      assertThat(new CorePlugin().getExtensions()).contains(widget.getClass());
     }
   }
 
Project SonarSource/sonarqube in file ...g.sonar.server.startup.JdbcDriverDeployerTest.java (2015-01-10)
@@ -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");
   }
Project SonarSource/sonarqube in file ...putation.dbcleaner.period.DeleteAllFilterTest.java (2015-01-10)
@@ -28,7 +28,7 @@ import org.sonar.core.purge.PurgeableSnapshotDto;
 import java.util.Arrays;
 import java.util.List;
 
-import static org.fest.assertions.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
 
 public class DeleteAllFilterTest {
 
@@ -42,6 +42,6 @@ public class DeleteAllFilterTest {
       DbCleanerTestUtils.createSnapshotWithDate(3L, "2012-01-01")
       ));
 
-    assertThat(toDelete).onProperty("snapshotId").containsOnly(1L, 2L);
+    assertThat(toDelete).extracting("snapshotId").containsOnly(1L, 2L);
   }
 }
Project SonarSource/sonarqube in file ...core.notification.db.NotificationQueueDaoTest.java (2015-01-10)
@@ -28,7 +28,7 @@ import org.sonar.core.persistence.AbstractDaoTestCase;
 import java.util.Arrays;
 import java.util.Collection;
 
-import static org.fest.assertions.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
 
 public class NotificationQueueDaoTest extends AbstractDaoTestCase {
 
@@ -78,7 +78,7 @@ public class NotificationQueueDaoTest extends AbstractDaoTestCase {
 
     Collection<NotificationQueueDto> result = dao.findOldest(3);
     assertThat(result).hasSize(3);
-    assertThat(result).onProperty("id").containsOnly(1L, 2L, 3L);
+    assertThat(result).extracting("id").containsOnly(1L, 2L, 3L);
 
     result = dao.findOldest(6);
     assertThat(result).hasSize(4);
Project SonarSource/sonarqube in file ....sonar.core.plugins.DefaultPluginMetadataTest.java (2015-01-10)
@@ -28,7 +28,7 @@ import java.util.List;
 
 import static com.google.common.collect.Lists.newArrayList;
 import static com.google.common.collect.Ordering.natural;
-import static org.fest.assertions.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
 
 public class DefaultPluginMetadataTest {
 
@@ -106,7 +106,7 @@ public class DefaultPluginMetadataTest {
       .setName("PMD");
     List<DefaultPluginMetadata> plugins = Arrays.asList(pmd, checkstyle);
 
-    assertThat(natural().sortedCopy(plugins)).onProperty("key").containsExactly("checkstyle", "pmd");
+    assertThat(natural().sortedCopy(plugins)).extracting("key").containsExactly("checkstyle", "pmd");
   }
 
   @Test