Update tests change AssertJ StrictAssertions to Assertions

This commit is contained in:
rob bygrave
2019-10-06 16:34:44 +13:00
parent e58a85f0af
commit 1c6c812d4d
61 changed files with 89 additions and 97 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ package io.ebean;
import io.ebeaninternal.server.rawsql.SpiRawSql;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class ColumnTest {
@@ -11,7 +11,7 @@ import org.junit.Test;
import org.tests.model.basic.EBasicVer;
import org.tests.model.draftable.BasicDraftableBean;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class PlatformNoGeneratedKeysTest {
@@ -6,7 +6,7 @@ import org.tests.model.basic.Customer;
import org.tests.model.basic.Order;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
/**
*/
@@ -14,7 +14,7 @@ import java.io.StringWriter;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
@@ -15,7 +15,7 @@ import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.StrictAssertions.assertThatThrownBy;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
@@ -3,7 +3,7 @@ package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.DbConstraintNormalise;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class DbNameNormaliseTest {
@@ -11,7 +11,7 @@ import io.ebeaninternal.api.SpiEbeanServer;
import io.ebeaninternal.server.core.PlatformDdlBuilder;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class H2HistoryDdlTest {
@@ -5,7 +5,7 @@ import io.ebeaninternal.dbmigration.migration.ChangeSet;
import io.ebeaninternal.dbmigration.migration.DropColumn;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class EntryTest {
@@ -8,7 +8,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
// FIXME: this test should be moved to ebean-migration artifact
public class MigrationVersionTest {
@@ -8,7 +8,7 @@ import org.junit.Test;
import org.tests.model.basic.Contact;
import org.tests.model.basic.Customer;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;
public class DefaultServerCacheManagerTest {
@@ -10,7 +10,7 @@ import org.junit.Test;
import java.io.StringWriter;
import java.util.List;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class ChangeJsonBuilderTest extends BaseTestCase {
@@ -5,7 +5,7 @@ import org.junit.Test;
import java.util.LinkedHashMap;
import java.util.Map;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class AllEqualsExpressionTest extends BaseExpressionTest {
@@ -10,7 +10,7 @@ import io.ebeaninternal.server.deploy.BeanDescriptor;
import org.tests.model.basic.Customer;
import org.tests.model.basic.Order;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public abstract class BaseExpressionTest extends BaseTestCase {
@@ -3,7 +3,7 @@ package io.ebeaninternal.server.expression;
import io.ebeaninternal.api.SpiExpression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class BetweenExpressionTest extends BaseExpressionTest {
@@ -2,7 +2,7 @@ package io.ebeaninternal.server.expression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class BetweenPropertyExpressionTest extends BaseExpressionTest {
@@ -3,7 +3,7 @@ package io.ebeaninternal.server.expression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class CaseInsensitiveEqualExpressionTest extends BaseExpressionTest {
@@ -4,7 +4,7 @@ import io.ebean.Expression;
import io.ebeaninternal.api.SpiExpression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class DefaultExpressionFactoryTest {
@@ -3,7 +3,7 @@ package io.ebeaninternal.server.expression;
import io.ebean.ExpressionList;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class DefaultExpressionListTest extends BaseExpressionTest {
@@ -4,7 +4,7 @@ import org.junit.Test;
import java.util.Arrays;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class ExistsQueryExpressionTest extends BaseExpressionTest {
@@ -3,7 +3,7 @@ package io.ebeaninternal.server.expression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class IdExpressionTest extends BaseExpressionTest {
@@ -4,7 +4,7 @@ import org.junit.Test;
import java.util.Arrays;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class IdInExpressionTest extends BaseExpressionTest {
@@ -6,7 +6,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class InExpressionTest extends BaseExpressionTest {
@@ -4,7 +4,7 @@ import org.junit.Test;
import java.util.Arrays;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class InQueryExpressionTest extends BaseExpressionTest {
@@ -3,7 +3,7 @@ package io.ebeaninternal.server.expression;
import io.ebeaninternal.api.SpiExpression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class InRangeExpressionTest extends BaseExpressionTest {
@@ -2,7 +2,7 @@ package io.ebeaninternal.server.expression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class JsonPathExpressionTest extends BaseExpressionTest {
@@ -3,7 +3,7 @@ package io.ebeaninternal.server.expression;
import io.ebean.LikeType;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class LikeExpressionTest extends BaseExpressionTest {
@@ -5,7 +5,7 @@ import io.ebean.Expression;
import org.junit.Test;
import static io.ebean.Expr.eq;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class NotExpressionTest extends BaseExpressionTest {
@@ -2,7 +2,7 @@ package io.ebeaninternal.server.expression;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class RawExpressionTest extends BaseExpressionTest {
@@ -4,7 +4,7 @@ import org.junit.Test;
import java.util.Arrays;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class ColumnMappingTest {
@@ -10,7 +10,6 @@ import io.ebean.SqlRow;
import io.ebean.annotation.ForPlatform;
import io.ebean.annotation.Platform;
import io.ebeaninternal.server.rawsql.SpiRawSql.Sql;
import org.assertj.core.api.StrictAssertions;
import org.junit.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
@@ -30,7 +29,7 @@ public class TestRawSqlBuilder extends BaseTestCase {
@Test
public void testDeriveProperty() {
StrictAssertions.assertThat(SpiRawSql.ColumnMapping.Column.derivePropertyName("item_total", "some_other")).isEqualTo("itemTotal");
assertThat(SpiRawSql.ColumnMapping.Column.derivePropertyName("item_total", "some_other")).isEqualTo("itemTotal");
assertThat(SpiRawSql.ColumnMapping.Column.derivePropertyName(null, "some_other")).isEqualTo("someOther");
assertThat(SpiRawSql.ColumnMapping.Column.derivePropertyName(null, "alias.some_other")).isEqualTo("someOther");
assertThat(SpiRawSql.ColumnMapping.Column.derivePropertyName(null, "alias.someOther")).isEqualTo("someOther");
@@ -7,7 +7,7 @@ import org.tests.model.basic.Customer;
import org.tests.model.basic.Vehicle;
import org.junit.Test;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class DefaultPersistenceContextTest {
@@ -15,7 +15,7 @@ import org.tests.model.basic.EBasicVer;
import org.tests.model.basic.UTDetail;
import org.tests.model.basic.UTMaster;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
@@ -5,7 +5,7 @@ import org.junit.Test;
import java.time.Instant;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class IsoJsonDateTimeParserTest {
@@ -11,7 +11,6 @@ import java.io.ObjectOutputStream;
import java.util.HashMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.StrictAssertions.assertThat;
public class ModifyAwareMapTest {
@@ -12,7 +12,6 @@ import java.util.Arrays;
import java.util.HashSet;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.StrictAssertions.assertThat;
public class ModifyAwareSetTest {
@@ -6,7 +6,7 @@ import org.junit.Test;
import java.io.IOException;
import java.sql.Date;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
public class ScalarTypeDateTest {
@@ -7,7 +7,7 @@ import java.io.IOException;
import java.sql.Date;
import java.time.LocalDate;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -6,7 +6,7 @@ import org.junit.Test;
import java.sql.Timestamp;
import java.time.OffsetDateTime;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -5,7 +5,7 @@ import org.junit.Test;
import java.sql.Timestamp;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class ScalarTypeTimestampTest {
@@ -6,7 +6,7 @@ import org.junit.Test;
import java.io.IOException;
import java.util.Date;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
public class ScalarTypeUtilDateTest {
@@ -6,7 +6,7 @@ import org.junit.Test;
import java.sql.Timestamp;
import java.time.ZonedDateTime;
import static org.assertj.core.api.StrictAssertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.*;
public class ScalarTypeZonedDateTimeTest {
@@ -6,15 +6,16 @@ import io.ebean.EbeanServer;
import io.ebean.plugin.BeanDocType;
import io.ebean.plugin.BeanType;
import io.ebeanservice.docstore.api.DocStoreUpdates;
import org.tests.model.basic.Order;
import org.assertj.core.api.StrictAssertions;
import org.junit.Test;
import org.mockito.Mockito;
import org.tests.model.basic.Order;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class DocStoreDeleteEventTest {
@@ -44,7 +45,7 @@ public class DocStoreDeleteEventTest {
}
@Test
public void addToQueue() throws Exception {
public void addToQueue() {
DocStoreDeleteEvent event = new DocStoreDeleteEvent(orderType(), 42);
@@ -55,9 +56,9 @@ public class DocStoreDeleteEventTest {
assertThat(queueEntries).hasSize(1);
DocStoreQueueEntry entry = queueEntries.get(0);
StrictAssertions.assertThat(entry.getBeanId()).isEqualTo(42);
StrictAssertions.assertThat(entry.getQueueId()).isEqualTo("order");
StrictAssertions.assertThat(entry.getPath()).isNull();
assertThat(entry.getBeanId()).isEqualTo(42);
assertThat(entry.getQueueId()).isEqualTo("order");
assertThat(entry.getPath()).isNull();
assertThat(entry.getType()).isEqualTo(DocStoreQueueEntry.Action.DELETE);
}
}