diff options
Diffstat (limited to 'server/src/test/java/com/vaadin/data/BeanPropertySetTest.java')
-rw-r--r-- | server/src/test/java/com/vaadin/data/BeanPropertySetTest.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java b/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java index c577db6067..7b492ad012 100644 --- a/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java +++ b/server/src/test/java/com/vaadin/data/BeanPropertySetTest.java @@ -15,6 +15,10 @@ */ package com.vaadin.data; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; @@ -26,7 +30,6 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import org.junit.Assert; import org.junit.Test; import com.vaadin.data.provider.bov.Person; @@ -45,8 +48,7 @@ public class BeanPropertySetTest { PropertySet<Person> deserializedPropertySet = ClassesSerializableTest .serializeAndDeserialize(originalPropertySet); - Assert.assertSame( - "Deserialized instance should be the same as the original", + assertSame("Deserialized instance should be the same as the original", originalPropertySet, deserializedPropertySet); } @@ -74,10 +76,9 @@ public class BeanPropertySetTest { PropertySet<Person> deserializedPropertySet = (PropertySet<Person>) in .readObject(); - Assert.assertSame( - "Deserialized instance should be the same as in the cache", + assertSame("Deserialized instance should be the same as in the cache", BeanPropertySet.get(Person.class), deserializedPropertySet); - Assert.assertNotSame( + assertNotSame( "Deserialized instance should not be the same as the original", originalPropertySet, deserializedPropertySet); } @@ -95,11 +96,10 @@ public class BeanPropertySetTest { Person person = new Person("Milennial", 2000); Integer age = (Integer) getter.apply(person); - Assert.assertEquals("Deserialized definition should be functional", + assertEquals("Deserialized definition should be functional", Integer.valueOf(2000), age); - Assert.assertSame( - "Deserialized instance should be the same as in the cache", + assertSame("Deserialized instance should be the same as in the cache", BeanPropertySet.get(Person.class).getProperty("born") .orElseThrow(RuntimeException::new), deserializedDefinition); @@ -125,11 +125,10 @@ public class BeanPropertySetTest { Integer postalCode = (Integer) getter.apply(person); - Assert.assertEquals("Deserialized definition should be functional", + assertEquals("Deserialized definition should be functional", address.getPostalCode(), postalCode); - Assert.assertSame( - "Deserialized instance should be the same as in the cache", + assertSame("Deserialized instance should be the same as in the cache", BeanPropertySet.get(com.vaadin.tests.data.bean.Person.class) .getProperty("address.postalCode").orElseThrow( RuntimeException::new), @@ -153,7 +152,7 @@ public class BeanPropertySetTest { String firstName = (String) getter.apply(son); - Assert.assertEquals(grandFather.getFirstName(), firstName); + assertEquals(grandFather.getFirstName(), firstName); } @Test(expected = NullPointerException.class) @@ -188,7 +187,7 @@ public class BeanPropertySetTest { Set<String> propertyNames = propertySet.getProperties() .map(PropertyDefinition::getName).collect(Collectors.toSet()); - Assert.assertEquals(new HashSet<>(Arrays.asList("name", "born")), + assertEquals(new HashSet<>(Arrays.asList("name", "born")), propertyNames); } } |