@Test public void shouldConvert() throws Exception { RequestMap expectedMap = new RequestMap(); expectedMap.putMap(new HashMap<String, String>() {{ put("page", "7"); put("maxPageResults", "23"); put("initialDate", "2016-11-09T00:00"); put("finalDate", "2016-11-09T23:59"); put("reference", "reference"); }}); RequestMap map = mapConverter.convert(authorizationSearch); assertEquals(expectedMap, map); }
@Override protected void convert(RequestMap requestMap, AuthorizationSearch authorizationSearch) { final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); requestMap.putInteger("page", authorizationSearch.getPage()); requestMap.putInteger("maxPageResults", authorizationSearch.getMaxResults()); requestMap.putDate("initialDate", authorizationSearch.getDateRange().getFrom(), sdf); requestMap.putDate("finalDate", authorizationSearch.getDateRange().getTo(), sdf); requestMap.putString("reference", authorizationSearch.getReference()); }
AuthorizationSearchV2MapConverter extends AbstractMapConverter<AuthorizationSearch> { @Override protected void convert(RequestMap requestMap, AuthorizationSearch authorizationSearch) { final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); requestMap.putInteger("page", authorizationSearch.getPage()); requestMap.putInteger("maxPageResults", authorizationSearch.getMaxResults()); requestMap.putDate("initialDate", authorizationSearch.getDateRange().getFrom(), sdf); requestMap.putDate("finalDate", authorizationSearch.getDateRange().getTo(), sdf); requestMap.putString("reference", authorizationSearch.getReference()); } }
AuthorizationSearchV2MapConverter extends AbstractMapConverter<AuthorizationSearch> { @Override protected void convert(RequestMap requestMap, AuthorizationSearch authorizationSearch) { final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); requestMap.putInteger("page", authorizationSearch.getPage()); requestMap.putInteger("maxPageResults", authorizationSearch.getMaxResults()); requestMap.putDate("initialDate", authorizationSearch.getDateRange().getFrom(), sdf); requestMap.putDate("finalDate", authorizationSearch.getDateRange().getTo(), sdf); requestMap.putString("reference", authorizationSearch.getReference()); } AuthorizationSearchV2MapConverter(); }
AuthorizationSearchV2MapConverter extends AbstractMapConverter<AuthorizationSearch> { @Override protected void convert(RequestMap requestMap, AuthorizationSearch authorizationSearch) { final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); requestMap.putInteger("page", authorizationSearch.getPage()); requestMap.putInteger("maxPageResults", authorizationSearch.getMaxResults()); requestMap.putDate("initialDate", authorizationSearch.getDateRange().getFrom(), sdf); requestMap.putDate("finalDate", authorizationSearch.getDateRange().getTo(), sdf); requestMap.putString("reference", authorizationSearch.getReference()); } AuthorizationSearchV2MapConverter();  }
AuthorizationSearchV2MapConverter extends AbstractMapConverter<AuthorizationSearch> { @Override protected void convert(RequestMap requestMap, AuthorizationSearch authorizationSearch) { final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); requestMap.putInteger("page", authorizationSearch.getPage()); requestMap.putInteger("maxPageResults", authorizationSearch.getMaxResults()); requestMap.putDate("initialDate", authorizationSearch.getDateRange().getFrom(), sdf); requestMap.putDate("finalDate", authorizationSearch.getDateRange().getTo(), sdf); requestMap.putString("reference", authorizationSearch.getReference()); } AuthorizationSearchV2MapConverter();   }