Search in sources :

Example 6 with YearMonth

use of org.joda.time.YearMonth in project serenity-jbehave by serenity-bdd.

the class MonthYearConversionSteps method thenTheParameterShouldBeConvertedToAYearMonthWithAValueOf.

@Then("the parameter should be converted to a YearMonth with a value of <expectedValue>")
public void thenTheParameterShouldBeConvertedToAYearMonthWithAValueOf(String expectedValue) {
    YearMonth expectedYearMonthValue = new YearMonth(expectedValue);
    assertThat(yearMonthParameter).isEqualTo(expectedYearMonthValue);
}
Also used : YearMonth(org.joda.time.YearMonth) Then(org.jbehave.core.annotations.Then)

Example 7 with YearMonth

use of org.joda.time.YearMonth in project serenity-jbehave by serenity-bdd.

the class YearMonthListConverter method convertValue.

public Object convertValue(String value, Type type) {
    System.out.println(type);
    Type argumentType = argumentType(type);
    List<String> values = trim(asList(value.split(valueSeparator)));
    List<YearMonth> times = new ArrayList<>();
    for (String string : values) {
        times.add((YearMonth) yearMonthConverter.convertValue(string, argumentType));
    }
    return times;
}
Also used : ParameterizedType(java.lang.reflect.ParameterizedType) Type(java.lang.reflect.Type) YearMonth(org.joda.time.YearMonth) ArrayList(java.util.ArrayList)

Aggregations

YearMonth (org.joda.time.YearMonth)7 Test (org.junit.Test)4 ParameterizedType (java.lang.reflect.ParameterizedType)1 Type (java.lang.reflect.Type)1 ArrayList (java.util.ArrayList)1 Then (org.jbehave.core.annotations.Then)1 DateTime (org.joda.time.DateTime)1 LocalDate (org.joda.time.LocalDate)1 LocalDateTime (org.joda.time.LocalDateTime)1 MonthDay (org.joda.time.MonthDay)1