In this “Creating Jira report tutorial” there’s this line of code that gets date parameter from UI:
Date startDate = ParameterUtils.getDateParam(params, "startDate", i18nBean.getLocale());
But getDateParam
method is deprecated and the documentation recommends using DateTimeFormatterFactory
instead. But I can’t understand how to use it to get date param? I suspect it’s something like getting a date string and using DateTimeFormatterFactory
to get a date object. What is the preferred way of doing this?
BTW, it’s a bane to unit test the generateReportHtml
method as we need to mock static ParameterUtils.getblablaParam method. I ended up using PowerMock which screwed the test.