JAMES-2387 Fix a bunch of IntelliJ warnings

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ccb8c071
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ccb8c071
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ccb8c071

Branch: refs/heads/master
Commit: ccb8c071be9d6e29abb29bb8d8c4a27109a9e55a
Parents: e2ea112
Author: benwa <[email protected]>
Authored: Fri May 4 10:19:37 2018 +0700
Committer: benwa <[email protected]>
Committed: Fri May 4 17:53:17 2018 +0700

----------------------------------------------------------------------
 .../CassandraMigrationServiceTest.java          | 24 ++++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ccb8c071/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
----------------------------------------------------------------------
diff --git 
a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
 
b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
index c9a184f..18c60dc 100644
--- 
a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
+++ 
b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
@@ -83,19 +83,19 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void getCurrentVersionShouldReturnCurrentVersion() throws Exception 
{
+    public void getCurrentVersionShouldReturnCurrentVersion() {
         
when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(CompletableFuture.completedFuture(Optional.of(CURRENT_VERSION)));
 
-        
assertThat(testee.getCurrentVersion().get()).isEqualTo(CURRENT_VERSION);
+        assertThat(testee.getCurrentVersion()).contains(CURRENT_VERSION);
     }
 
     @Test
-    public void getLatestVersionShouldReturnTheLatestVersion() throws 
Exception {
-        assertThat(testee.getLatestVersion().get()).isEqualTo(LATEST_VERSION);
+    public void getLatestVersionShouldReturnTheLatestVersion() {
+        assertThat(testee.getLatestVersion()).contains(LATEST_VERSION);
     }
 
     @Test
-    public void upgradeToVersionShouldNotThrowWhenCurrentVersionIsUpToDate() 
throws Exception {
+    public void upgradeToVersionShouldNotThrowWhenCurrentVersionIsUpToDate() {
         
when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(CompletableFuture.completedFuture(Optional.of(CURRENT_VERSION)));
 
         assertThat(testee.upgradeToVersion(OLDER_VERSION).run())
@@ -103,7 +103,7 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void upgradeToVersionShouldUpdateToVersion() throws Exception {
+    public void upgradeToVersionShouldUpdateToVersion() {
         
when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(CompletableFuture.completedFuture(Optional.of(OLDER_VERSION)));
 
         testee.upgradeToVersion(CURRENT_VERSION).run();
@@ -112,7 +112,7 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void upgradeToLastVersionShouldNotThrowWhenVersionIsUpToDate() 
throws Exception {
+    public void upgradeToLastVersionShouldNotThrowWhenVersionIsUpToDate() {
 
         
when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(CompletableFuture.completedFuture(Optional.of(LATEST_VERSION)));
 
@@ -121,7 +121,7 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void upgradeToLastVersionShouldUpdateToLatestVersion() throws 
Exception {
+    public void upgradeToLastVersionShouldUpdateToLatestVersion() {
         
when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(CompletableFuture.completedFuture(Optional.of(OLDER_VERSION)));
 
         testee.upgradeToLastVersion().run();
@@ -130,7 +130,7 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void upgradeToVersionShouldThrowOnMissingVersion() throws Exception 
{
+    public void upgradeToVersionShouldThrowOnMissingVersion() {
         Map<SchemaVersion, Migration> allMigrationClazz = 
ImmutableMap.<SchemaVersion, Migration>builder()
             .put(OLDER_VERSION, successfulMigration)
             .put(LATEST_VERSION, successfulMigration)
@@ -144,7 +144,7 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void 
upgradeToVersionShouldUpdateIntermediarySuccessfulMigrationsInCaseOfError() 
throws Exception {
+    public void 
upgradeToVersionShouldUpdateIntermediarySuccessfulMigrationsInCaseOfError() {
         try {
             Map<SchemaVersion, Migration> allMigrationClazz = 
ImmutableMap.<SchemaVersion, Migration>builder()
                 .put(OLDER_VERSION, successfulMigration)
@@ -163,7 +163,7 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void partialMigrationShouldThrow() throws Exception {
+    public void partialMigrationShouldThrow() {
         Migration migration1 = mock(Migration.class);
         when(migration1.run()).thenReturn(Migration.Result.PARTIAL);
         Migration migration2 = successfulMigration;
@@ -180,7 +180,7 @@ public class CassandraMigrationServiceTest {
     }
 
     @Test
-    public void partialMigrationShouldAbortMigrations() throws Exception {
+    public void partialMigrationShouldAbortMigrations() {
         Migration migration1 = mock(Migration.class);
         when(migration1.run()).thenReturn(Migration.Result.PARTIAL);
         Migration migration2 = mock(Migration.class);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to