diff --git a/src/test/java/com/google/gcloud/datastore/BaseEntityTest.java b/src/test/java/com/google/gcloud/datastore/BaseEntityTest.java index 8a2ffb26d68e..567e795a66e7 100644 --- a/src/test/java/com/google/gcloud/datastore/BaseEntityTest.java +++ b/src/test/java/com/google/gcloud/datastore/BaseEntityTest.java @@ -1 +1 @@ -/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gcloud.datastore; import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import org.junit.Before; import org.junit.Test; import java.util.Calendar; import java.util.Collections; import java.util.List; import java.util.Set; public class BaseEntityTest { private static final Blob BLOB = Blob.copyFrom(new byte[]{1, 2}); private static final DateTime DATE_TIME = DateTime.now(); private static final Key KEY = Key.builder("ds1", "k1", "n1").build(); private static final Entity ENTITY = Entity.builder(KEY).set("name", "foo").build(); private static final IncompleteKey INCOMPLETE_KEY = IncompleteKey.builder("ds1", "k1").build(); private static final FullEntity PARTIAL_ENTITY = Entity.builder(INCOMPLETE_KEY).build(); private Builder builder; private class Builder extends BaseEntity.Builder { @Override public BaseEntity build() { return new BaseEntity(this) { @Override protected Builder emptyBuilder() { return new BaseEntityTest.Builder(); } }; } } @Before public void setUp() { builder = new Builder(); builder.set("blob", BLOB).set("boolean", true).set("dateTime", DATE_TIME); builder.set("double", 1.25).set("key", KEY).set("string", "hello world"); builder.set("long", 125).setNull("null").set("entity", ENTITY); builder.set("partialEntity", PARTIAL_ENTITY).set("stringValue", StringValue.of("bla")); builder.set("list1", NullValue.of(), StringValue.of("foo")); builder.set("list2", ImmutableList.of(LongValue.of(10), DoubleValue.of(2))); builder.set("list3", Collections.singletonList(BooleanValue.of(true))); } @Test public void testContains() throws Exception { BaseEntity entity = builder.build(); assertTrue(entity.contains("list1")); assertFalse(entity.contains("bla")); entity = builder.clear().build(); assertFalse(entity.contains("list1")); } @Test public void testGetValue() throws Exception { BaseEntity entity = builder.build(); assertEquals(BlobValue.of(BLOB), entity.getValue("blob")); } @Test(expected = DatastoreServiceException.class) public void testGetValueNotFound() throws Exception { BaseEntity entity = builder.clear().build(); entity.getValue("blob"); } @Test public void testIsNull() throws Exception { BaseEntity entity = builder.build(); assertTrue(entity.isNull("null")); assertFalse(entity.isNull("blob")); entity = builder.setNull("blob").build(); assertTrue(entity.isNull("blob")); } @Test(expected = DatastoreServiceException.class) public void testIsNullNotFound() throws Exception { BaseEntity entity = builder.clear().build(); entity.isNull("null"); } @Test public void testGetString() throws Exception { BaseEntity entity = builder.build(); assertEquals("hello world", entity.getString("string")); assertEquals("bla", entity.getString("stringValue")); entity = builder.set("string", "foo").build(); assertEquals("foo", entity.getString("string")); } @Test public void testGetLong() throws Exception { BaseEntity entity = builder.build(); assertEquals(125, entity.getLong("long")); entity = builder.set("long", LongValue.of(10)).build(); assertEquals(10, entity.getLong("long")); } @Test public void testGetDouble() throws Exception { BaseEntity entity = builder.build(); assertEquals(1.25, entity.getDouble("double"), 0); entity = builder.set("double", DoubleValue.of(10)).build(); assertEquals(10, entity.getDouble("double"), 0); } @Test public void testGetBoolean() throws Exception { BaseEntity entity = builder.build(); assertTrue(entity.getBoolean("boolean")); entity = builder.set("boolean", BooleanValue.of(false)).build(); assertFalse(entity.getBoolean("boolean")); } @Test public void testGetDateTime() throws Exception { BaseEntity entity = builder.build(); assertEquals(DATE_TIME, entity.getDateTime("dateTime")); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -1); DateTime dateTime = DateTime.copyFrom(cal); entity = builder.set("dateTime", DateTimeValue.of(dateTime)).build(); assertEquals(dateTime, entity.getDateTime("dateTime")); } @Test public void testGetKey() throws Exception { BaseEntity entity = builder.build(); assertEquals(KEY, entity.getKey("key")); Key key = Key.builder(KEY).name("BLA").build(); entity = builder.set("key", key).build(); assertEquals(key, entity.getKey("key")); } @Test public void testGetEntity() throws Exception { BaseEntity entity = builder.build(); assertEquals(ENTITY, entity.getEntity("entity")); assertEquals(PARTIAL_ENTITY, entity.getEntity("partialEntity")); entity = builder.set("entity", EntityValue.of(PARTIAL_ENTITY)).build(); assertEquals(PARTIAL_ENTITY, entity.getEntity("entity")); } @Test public void testGetList() throws Exception { BaseEntity entity = builder.build(); List> list = entity.getList("list1"); assertEquals(2, list.size()); assertEquals(NullValue.of(), list.get(0)); assertEquals("foo", list.get(1).get()); list = entity.getList("list2"); assertEquals(2, list.size()); assertEquals(Long.valueOf(10), list.get(0).get()); assertEquals(Double.valueOf(2), list.get(1).get()); list = entity.getList("list3"); assertEquals(1, list.size()); assertEquals(Boolean.TRUE, list.get(0).get()); entity = builder.set("list1", ListValue.of(list)).build(); assertEquals(list, entity.getList("list1")); } @Test public void testGetBlob() throws Exception { BaseEntity entity = builder.build(); assertEquals(BLOB, entity.getBlob("blob")); Blob blob = Blob.copyFrom(new byte[] {}); entity = builder.set("blob", BlobValue.of(blob)).build(); assertEquals(blob, entity.getBlob("blob")); } @Test public void testNames() throws Exception { Set names = ImmutableSet.builder() .add("string", "stringValue", "boolean", "double", "long", "list1", "list2", "list3") .add("entity", "partialEntity", "null", "dateTime", "blob", "key") .build(); BaseEntity entity = builder.build(); assertEquals(names, entity.names()); } } \ No newline at end of file +/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gcloud.datastore; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import org.junit.Before; import org.junit.Test; import java.util.Calendar; import java.util.Collections; import java.util.List; import java.util.Set; public class BaseEntityTest { private static final Blob BLOB = Blob.copyFrom(new byte[]{1, 2}); private static final DateTime DATE_TIME = DateTime.now(); private static final Key KEY = Key.builder("ds1", "k1", "n1").build(); private static final Entity ENTITY = Entity.builder(KEY).set("name", "foo").build(); private static final IncompleteKey INCOMPLETE_KEY = IncompleteKey.builder("ds1", "k1").build(); private static final FullEntity PARTIAL_ENTITY = Entity.builder(INCOMPLETE_KEY).build(); private Builder builder; private class Builder extends BaseEntity.Builder { @Override public BaseEntity build() { return new BaseEntity(this) { @Override protected Builder emptyBuilder() { return new BaseEntityTest.Builder(); } }; } } @Before public void setUp() { builder = new Builder(); builder.set("blob", BLOB).set("boolean", true).set("dateTime", DATE_TIME); builder.set("double", 1.25).set("key", KEY).set("string", "hello world"); builder.set("long", 125).setNull("null").set("entity", ENTITY); builder.set("partialEntity", PARTIAL_ENTITY).set("stringValue", StringValue.of("bla")); builder.set("list1", NullValue.of(), StringValue.of("foo")); builder.set("list2", ImmutableList.of(LongValue.of(10), DoubleValue.of(2))); builder.set("list3", Collections.singletonList(BooleanValue.of(true))); } @Test public void testContains() throws Exception { BaseEntity entity = builder.build(); assertTrue(entity.contains("list1")); assertFalse(entity.contains("bla")); entity = builder.clear().build(); assertFalse(entity.contains("list1")); } @Test public void testGetValue() throws Exception { BaseEntity entity = builder.build(); assertEquals(BlobValue.of(BLOB), entity.getValue("blob")); } @Test(expected = DatastoreServiceException.class) public void testGetValueNotFound() throws Exception { BaseEntity entity = builder.clear().build(); entity.getValue("blob"); } @Test public void testIsNull() throws Exception { BaseEntity entity = builder.build(); assertTrue(entity.isNull("null")); assertFalse(entity.isNull("blob")); entity = builder.setNull("blob").build(); assertTrue(entity.isNull("blob")); } @Test(expected = DatastoreServiceException.class) public void testIsNullNotFound() throws Exception { BaseEntity entity = builder.clear().build(); entity.isNull("null"); } @Test public void testGetString() throws Exception { BaseEntity entity = builder.build(); assertEquals("hello world", entity.getString("string")); assertEquals("bla", entity.getString("stringValue")); entity = builder.set("string", "foo").build(); assertEquals("foo", entity.getString("string")); } @Test public void testGetLong() throws Exception { BaseEntity entity = builder.build(); assertEquals(125, entity.getLong("long")); entity = builder.set("long", LongValue.of(10)).build(); assertEquals(10, entity.getLong("long")); } @Test public void testGetDouble() throws Exception { BaseEntity entity = builder.build(); assertEquals(1.25, entity.getDouble("double"), 0); entity = builder.set("double", DoubleValue.of(10)).build(); assertEquals(10, entity.getDouble("double"), 0); } @Test public void testGetBoolean() throws Exception { BaseEntity entity = builder.build(); assertTrue(entity.getBoolean("boolean")); entity = builder.set("boolean", BooleanValue.of(false)).build(); assertFalse(entity.getBoolean("boolean")); } @Test public void testGetDateTime() throws Exception { BaseEntity entity = builder.build(); assertEquals(DATE_TIME, entity.getDateTime("dateTime")); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -1); DateTime dateTime = DateTime.copyFrom(cal); entity = builder.set("dateTime", DateTimeValue.of(dateTime)).build(); assertEquals(dateTime, entity.getDateTime("dateTime")); } @Test public void testGetKey() throws Exception { BaseEntity entity = builder.build(); assertEquals(KEY, entity.getKey("key")); Key key = Key.builder(KEY).name("BLA").build(); entity = builder.set("key", key).build(); assertEquals(key, entity.getKey("key")); } @Test public void testGetEntity() throws Exception { BaseEntity entity = builder.build(); assertEquals(ENTITY, entity.getEntity("entity")); assertEquals(PARTIAL_ENTITY, entity.getEntity("partialEntity")); entity = builder.set("entity", EntityValue.of(PARTIAL_ENTITY)).build(); assertEquals(PARTIAL_ENTITY, entity.getEntity("entity")); } @Test public void testGetList() throws Exception { BaseEntity entity = builder.build(); List> list = entity.getList("list1"); assertEquals(2, list.size()); assertEquals(NullValue.of(), list.get(0)); assertEquals("foo", list.get(1).get()); list = entity.getList("list2"); assertEquals(2, list.size()); assertEquals(Long.valueOf(10), list.get(0).get()); assertEquals(Double.valueOf(2), list.get(1).get()); list = entity.getList("list3"); assertEquals(1, list.size()); assertEquals(Boolean.TRUE, list.get(0).get()); entity = builder.set("list1", ListValue.of(list)).build(); assertEquals(list, entity.getList("list1")); } @Test public void testGetBlob() throws Exception { BaseEntity entity = builder.build(); assertEquals(BLOB, entity.getBlob("blob")); Blob blob = Blob.copyFrom(new byte[] {}); entity = builder.set("blob", BlobValue.of(blob)).build(); assertEquals(blob, entity.getBlob("blob")); } @Test public void testNames() throws Exception { Set names = ImmutableSet.builder() .add("string", "stringValue", "boolean", "double", "long", "list1", "list2", "list3") .add("entity", "partialEntity", "null", "dateTime", "blob", "key") .build(); BaseEntity entity = builder.build(); assertEquals(names, entity.names()); } } \ No newline at end of file diff --git a/src/test/java/com/google/gcloud/datastore/BlobValueTest.java b/src/test/java/com/google/gcloud/datastore/BlobValueTest.java index 56ef03ac278e..40d0299d8fb3 100644 --- a/src/test/java/com/google/gcloud/datastore/BlobValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/BlobValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/BooleanValueTest.java b/src/test/java/com/google/gcloud/datastore/BooleanValueTest.java index fb3e62e6e27d..16bbe9cbf518 100644 --- a/src/test/java/com/google/gcloud/datastore/BooleanValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/BooleanValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/DatastoreHelperTest.java b/src/test/java/com/google/gcloud/datastore/DatastoreHelperTest.java index 25c0e8b2e691..8a31ece583ff 100644 --- a/src/test/java/com/google/gcloud/datastore/DatastoreHelperTest.java +++ b/src/test/java/com/google/gcloud/datastore/DatastoreHelperTest.java @@ -16,13 +16,20 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertTrue; -import static junit.framework.TestCase.fail; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.*; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import com.google.common.collect.Iterators; import com.google.gcloud.datastore.DatastoreService.TransactionCallable; + import org.easymock.EasyMock; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/DatastoreServiceExceptionTest.java b/src/test/java/com/google/gcloud/datastore/DatastoreServiceExceptionTest.java index 2700d277b9a3..1a06de833cf2 100644 --- a/src/test/java/com/google/gcloud/datastore/DatastoreServiceExceptionTest.java +++ b/src/test/java/com/google/gcloud/datastore/DatastoreServiceExceptionTest.java @@ -1 +1 @@ -/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gcloud.datastore; import static junit.framework.TestCase.fail; import static org.junit.Assert.assertEquals; import com.google.gcloud.spi.DatastoreRpc.DatastoreRpcException; import com.google.gcloud.spi.DatastoreRpc.DatastoreRpcException.Reason; import com.google.gcloud.datastore.DatastoreServiceException.Code; import org.junit.Test; public class DatastoreServiceExceptionTest { @Test public void testCode() throws Exception { for (Reason reason : Reason.values()) { Code code = Code.valueOf(reason.name()); assertEquals(reason.retryable(), code.retryable()); assertEquals(reason.description(), code.description()); assertEquals(reason.httpStatus(), code.httpStatus()); } DatastoreServiceException exception = new DatastoreServiceException(Code.ABORTED, "bla"); assertEquals(Code.ABORTED, exception.code()); } @Test public void testTranslateAndThrow() throws Exception { for (Reason reason : Reason.values()) { try { DatastoreServiceException.translateAndThrow(new DatastoreRpcException(reason)); fail("Exception expected"); } catch (DatastoreServiceException ex) { assertEquals(reason.name(), ex.code().name()); } } } @Test public void testThrowInvalidRequest() throws Exception { try { DatastoreServiceException.throwInvalidRequest("message %s %d", "a", 1); fail("Exception expected"); } catch (DatastoreServiceException ex) { assertEquals(Code.FAILED_PRECONDITION, ex.code()); assertEquals("message a 1", ex.getMessage()); } } } \ No newline at end of file +/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gcloud.datastore; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import com.google.gcloud.datastore.DatastoreServiceException.Code; import com.google.gcloud.spi.DatastoreRpc.DatastoreRpcException; import com.google.gcloud.spi.DatastoreRpc.DatastoreRpcException.Reason; import org.junit.Test; public class DatastoreServiceExceptionTest { @Test public void testCode() throws Exception { for (Reason reason : Reason.values()) { Code code = Code.valueOf(reason.name()); assertEquals(reason.retryable(), code.retryable()); assertEquals(reason.description(), code.description()); assertEquals(reason.httpStatus(), code.httpStatus()); } DatastoreServiceException exception = new DatastoreServiceException(Code.ABORTED, "bla"); assertEquals(Code.ABORTED, exception.code()); } @Test public void testTranslateAndThrow() throws Exception { for (Reason reason : Reason.values()) { try { DatastoreServiceException.translateAndThrow(new DatastoreRpcException(reason)); fail("Exception expected"); } catch (DatastoreServiceException ex) { assertEquals(reason.name(), ex.code().name()); } } } @Test public void testThrowInvalidRequest() throws Exception { try { DatastoreServiceException.throwInvalidRequest("message %s %d", "a", 1); fail("Exception expected"); } catch (DatastoreServiceException ex) { assertEquals(Code.FAILED_PRECONDITION, ex.code()); assertEquals("message a 1", ex.getMessage()); } } } \ No newline at end of file diff --git a/src/test/java/com/google/gcloud/datastore/DatastoreServiceOptionsTest.java b/src/test/java/com/google/gcloud/datastore/DatastoreServiceOptionsTest.java index a533f4ddc15e..59468be58129 100644 --- a/src/test/java/com/google/gcloud/datastore/DatastoreServiceOptionsTest.java +++ b/src/test/java/com/google/gcloud/datastore/DatastoreServiceOptionsTest.java @@ -16,10 +16,10 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertNull; -import static junit.framework.TestCase.assertSame; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import com.google.gcloud.spi.DatastoreRpc; diff --git a/src/test/java/com/google/gcloud/datastore/DatastoreServiceTest.java b/src/test/java/com/google/gcloud/datastore/DatastoreServiceTest.java index 0423cfe2d494..535fcb5f13e1 100644 --- a/src/test/java/com/google/gcloud/datastore/DatastoreServiceTest.java +++ b/src/test/java/com/google/gcloud/datastore/DatastoreServiceTest.java @@ -16,10 +16,10 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; diff --git a/src/test/java/com/google/gcloud/datastore/DateTimeValueTest.java b/src/test/java/com/google/gcloud/datastore/DateTimeValueTest.java index 39e0d1ca3f01..d7fef2ca69b9 100644 --- a/src/test/java/com/google/gcloud/datastore/DateTimeValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/DateTimeValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/DoubleValueTest.java b/src/test/java/com/google/gcloud/datastore/DoubleValueTest.java index 012f9bbf4de9..fa39511a45de 100644 --- a/src/test/java/com/google/gcloud/datastore/DoubleValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/DoubleValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/EntityValueTest.java b/src/test/java/com/google/gcloud/datastore/EntityValueTest.java index dfacfb0b67a6..cd1f7af38067 100644 --- a/src/test/java/com/google/gcloud/datastore/EntityValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/EntityValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/KeyFactoryTest.java b/src/test/java/com/google/gcloud/datastore/KeyFactoryTest.java index ca9ea08294f4..92851bd87efe 100644 --- a/src/test/java/com/google/gcloud/datastore/KeyFactoryTest.java +++ b/src/test/java/com/google/gcloud/datastore/KeyFactoryTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertNull; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.junit.Before; diff --git a/src/test/java/com/google/gcloud/datastore/KeyValueTest.java b/src/test/java/com/google/gcloud/datastore/KeyValueTest.java index ea6b77ed97da..131a80462a62 100644 --- a/src/test/java/com/google/gcloud/datastore/KeyValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/KeyValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/ListValueTest.java b/src/test/java/com/google/gcloud/datastore/ListValueTest.java index ae07f0c4fa51..04fdbec54727 100644 --- a/src/test/java/com/google/gcloud/datastore/ListValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/ListValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.google.common.collect.ImmutableList; diff --git a/src/test/java/com/google/gcloud/datastore/LongValueTest.java b/src/test/java/com/google/gcloud/datastore/LongValueTest.java index d93dfaf331a8..c4c899785d68 100644 --- a/src/test/java/com/google/gcloud/datastore/LongValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/LongValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/NullValueTest.java b/src/test/java/com/google/gcloud/datastore/NullValueTest.java index 15fe78dd1a4f..a42fdaf0229f 100644 --- a/src/test/java/com/google/gcloud/datastore/NullValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/NullValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; diff --git a/src/test/java/com/google/gcloud/datastore/ProjectionEntityTest.java b/src/test/java/com/google/gcloud/datastore/ProjectionEntityTest.java index f67d719af265..0262fb04b89d 100644 --- a/src/test/java/com/google/gcloud/datastore/ProjectionEntityTest.java +++ b/src/test/java/com/google/gcloud/datastore/ProjectionEntityTest.java @@ -16,10 +16,10 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertNull; import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/RawValueTest.java b/src/test/java/com/google/gcloud/datastore/RawValueTest.java index 26854ff9d22b..4d63bc89bacb 100644 --- a/src/test/java/com/google/gcloud/datastore/RawValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/RawValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.google.api.services.datastore.DatastoreV1; diff --git a/src/test/java/com/google/gcloud/datastore/StringValueTest.java b/src/test/java/com/google/gcloud/datastore/StringValueTest.java index aa53cea22d3a..a2cacd6574aa 100644 --- a/src/test/java/com/google/gcloud/datastore/StringValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/StringValueTest.java @@ -16,8 +16,8 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/src/test/java/com/google/gcloud/datastore/ValueTest.java b/src/test/java/com/google/gcloud/datastore/ValueTest.java index 51304e9f1cac..bbfb790b69a2 100644 --- a/src/test/java/com/google/gcloud/datastore/ValueTest.java +++ b/src/test/java/com/google/gcloud/datastore/ValueTest.java @@ -16,10 +16,10 @@ package com.google.gcloud.datastore; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/src/test/java/com/google/gcloud/storage/BatchRequestTest.java b/src/test/java/com/google/gcloud/storage/BatchRequestTest.java index 445e65dc6c35..dbe0eaa19411 100644 --- a/src/test/java/com/google/gcloud/storage/BatchRequestTest.java +++ b/src/test/java/com/google/gcloud/storage/BatchRequestTest.java @@ -17,8 +17,8 @@ package com.google.gcloud.storage; import static com.google.gcloud.storage.StorageService.PredefinedAcl.PUBLIC_READ; -import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.google.common.collect.Iterables; diff --git a/src/test/java/com/google/gcloud/storage/BatchResponseTest.java b/src/test/java/com/google/gcloud/storage/BatchResponseTest.java index 8e6e850fca61..277c46860ef1 100644 --- a/src/test/java/com/google/gcloud/storage/BatchResponseTest.java +++ b/src/test/java/com/google/gcloud/storage/BatchResponseTest.java @@ -16,7 +16,7 @@ package com.google.gcloud.storage; -import static junit.framework.TestCase.assertEquals; +import static org.junit.Assert.assertEquals; import com.google.common.collect.ImmutableList; import com.google.gcloud.storage.BatchResponse.Result; diff --git a/src/test/java/com/google/gcloud/storage/CorsTest.java b/src/test/java/com/google/gcloud/storage/CorsTest.java index fcb343cd56f6..8b0379f03583 100644 --- a/src/test/java/com/google/gcloud/storage/CorsTest.java +++ b/src/test/java/com/google/gcloud/storage/CorsTest.java @@ -16,7 +16,7 @@ package com.google.gcloud.storage; -import static junit.framework.TestCase.assertEquals; +import static org.junit.Assert.assertEquals; import com.google.common.collect.ImmutableList; import com.google.gcloud.storage.Cors.Method; diff --git a/src/test/java/com/google/gcloud/storage/ListResultTest.java b/src/test/java/com/google/gcloud/storage/ListResultTest.java index 3295e86d01ec..1345b0ced240 100644 --- a/src/test/java/com/google/gcloud/storage/ListResultTest.java +++ b/src/test/java/com/google/gcloud/storage/ListResultTest.java @@ -16,7 +16,7 @@ package com.google.gcloud.storage; -import static junit.framework.TestCase.assertEquals; +import static org.junit.Assert.assertEquals; import com.google.common.collect.ImmutableList; diff --git a/src/test/java/com/google/gcloud/storage/OptionTest.java b/src/test/java/com/google/gcloud/storage/OptionTest.java index b900ce2fc293..4665d04b2d82 100644 --- a/src/test/java/com/google/gcloud/storage/OptionTest.java +++ b/src/test/java/com/google/gcloud/storage/OptionTest.java @@ -16,7 +16,7 @@ package com.google.gcloud.storage; -import static junit.framework.TestCase.assertEquals; +import static org.junit.Assert.assertEquals; import com.google.gcloud.spi.StorageRpc;