@Test public void test_toString() { List<String> selectedCountries = new ArrayList<String>(); selectedCountries.add("Canada"); when(evaluator.label(any(LabelSupport.class))).thenReturn("label"); when(evaluator.selectedValues(any(DropDown.class))).thenReturn(selectedCountries); when(evaluator.values(any(DropDown.class))).thenReturn(countries); DropDown dropDown = new DropDown(evaluator, id); assertThat(dropDown.toString(), is("class org.testatoo.core.component.DropDown with state : enabled:true, visible:true, values:[France, Canada, Germany, Italy, Spain], selectedValues:[Canada], label:label")); } }