Package org.jbehave.core.steps.ParameterConverters

Examples of org.jbehave.core.steps.ParameterConverters.EnumListConverter.accept()


    @SuppressWarnings("unchecked")
    @Test
    public void shouldConvertEnumList() throws IntrospectionException {
        ParameterConverter converter = new EnumListConverter();
        Type type = SomeSteps.methodFor("aMethodWithEnumList").getGenericParameterTypes()[0];
        assertThat(converter.accept(type), equalTo(true));
        List<SomeEnum> list = (List<SomeEnum>)converter.convertValue("ONE,TWO,THREE", type);
        assertThat(list.get(0), equalTo(SomeEnum.ONE));
        assertThat(list.get(1), equalTo(SomeEnum.TWO));
        assertThat(list.get(2), equalTo(SomeEnum.THREE));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.