From 62d3977c3bd2f63146eaf009db46d74a236e6214 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Sun, 17 Jan 2016 14:03:53 +0200 Subject: Propertly handle null in StringToCollectionConverter (#19481) Change-Id: I9a01528910c5f9ec830e236fd8acd78dda763f24 --- .../data/converter/StringToCollectionConverterTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'server/tests/src') diff --git a/server/tests/src/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java b/server/tests/src/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java index bcd0dc15bd..4f2dc1df81 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java +++ b/server/tests/src/com/vaadin/tests/data/converter/StringToCollectionConverterTest.java @@ -22,6 +22,7 @@ import java.util.EnumSet; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Set; import java.util.Vector; @@ -151,6 +152,20 @@ public class StringToCollectionConverterTest { iterator.hasNext()); } + @Test + public void convertToModel_null() { + StringToCollectionConverter converter = new StringToCollectionConverter(); + Assert.assertNull(converter.convertToModel(null, ArrayList.class, + Locale.ENGLISH)); + } + + @Test + public void convertToPresentation_null() { + StringToCollectionConverter converter = new StringToCollectionConverter(); + Assert.assertNull(converter.convertToPresentation(null, String.class, + Locale.ENGLISH)); + } + public enum TestEnum { X, Y, Z; } -- cgit v1.2.3