@Test public void testFromDMNString() { final String value = "P2DT4H8M16S"; final MomentDurationObject duration = mock(MomentDurationObject.class); final Integer expectedDays = 2; final Integer expectedHours = 4; final Integer expectedMinutes = 8; final Integer expectedSeconds = 16; when(moment.duration(value)).thenReturn(duration); when(duration.days()).thenReturn(expectedDays); when(duration.hours()).thenReturn(expectedHours); when(duration.minutes()).thenReturn(expectedMinutes); when(duration.seconds()).thenReturn(expectedSeconds); final DayTimeValue actual = converter.fromDMNString(value); assertEquals(expectedDays, actual.getDays()); assertEquals(expectedHours, actual.getHours()); assertEquals(expectedMinutes, actual.getMinutes()); assertEquals(expectedSeconds, actual.getSeconds()); }
DayTimeValue fromDMNString(final String dmnString) { final MomentDurationObject duration = moment.duration(getFunctionParameter(dmnString)); return new DayTimeValue(duration.days(), duration.hours(), duration.minutes(), duration.seconds()); }
DayTimeValueConverter { DayTimeValue fromDMNString(final String dmnString) { final MomentDurationObject duration = moment.duration(getFunctionParameter(dmnString)); return new DayTimeValue(duration.days(), duration.hours(), duration.minutes(), duration.seconds()); } }
DayTimeValueConverter { DayTimeValue fromDMNString(final String dmnString) { final MomentDurationObject duration = moment.duration(getFunctionParameter(dmnString)); return new DayTimeValue(duration.days(), duration.hours(), duration.minutes(), duration.seconds()); } @Inject  DayTimeValueConverter(final TranslationService translationService); }
DayTimeValueConverter { DayTimeValue fromDMNString(final String dmnString) { final MomentDurationObject duration = moment.duration(getFunctionParameter(dmnString)); return new DayTimeValue(duration.days(), duration.hours(), duration.minutes(), duration.seconds()); } @Inject  DayTimeValueConverter(final TranslationService translationService);  }
DayTimeValueConverter { DayTimeValue fromDMNString(final String dmnString) { final MomentDurationObject duration = moment.duration(getFunctionParameter(dmnString)); return new DayTimeValue(duration.days(), duration.hours(), duration.minutes(), duration.seconds()); } @Inject  DayTimeValueConverter(final TranslationService translationService);   }