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