@Test public void shouldConvert() throws Exception { RequestMap expectedMap = new RequestMap(); expectedMap.putMap(new HashMap<String, String>() {{ put("sender.email", "email@email.com"); put("sender.name", "name"); put("sender.areaCode", "16"); put("sender.phone", "123456789"); put("sender.address.country", "BRA"); put("sender.address.state", "PA"); put("sender.address.city", "city"); put("sender.address.postalCode", "99999999"); put("sender.address.district", "district"); put("sender.address.street", "street"); put("sender.address.number", "999"); put("sender.address.complement", "complement"); put("sender.CPF", "99999999999"); put("sender.hash", "hash"); }}); RequestMap map = mapConverter.convert(sender); assertEquals(expectedMap, map); }
@Override protected void convert(RequestMap requestMap, Sender sender) { requestMap.putString("sender.email", sender.getEmail()); requestMap.putString("sender.name", sender.getName()); requestMap.putString("sender.CPF", sender.getCpf()); requestMap.putString("sender.CNPJ", sender.getCnpj()); requestMap.putString("sender.hash", sender.getHash()); requestMap.putMap(SENDER_PHONE_MC.convert(sender.getPhone())); requestMap.putMap(SENDER_ADDRESS_MC.convert(sender.getAddress())); }
SenderV3MapConverter extends AbstractMapConverter<Sender> { @Override protected void convert(RequestMap requestMap, Sender sender) { requestMap.putString("sender.email", sender.getEmail()); requestMap.putString("sender.name", sender.getName()); requestMap.putString("sender.CPF", sender.getCpf()); requestMap.putString("sender.CNPJ", sender.getCnpj()); requestMap.putString("sender.hash", sender.getHash()); requestMap.putMap(SENDER_PHONE_MC.convert(sender.getPhone())); requestMap.putMap(SENDER_ADDRESS_MC.convert(sender.getAddress())); } }
SenderV3MapConverter extends AbstractMapConverter<Sender> { @Override protected void convert(RequestMap requestMap, Sender sender) { requestMap.putString("sender.email", sender.getEmail()); requestMap.putString("sender.name", sender.getName()); requestMap.putString("sender.CPF", sender.getCpf()); requestMap.putString("sender.CNPJ", sender.getCnpj()); requestMap.putString("sender.hash", sender.getHash()); requestMap.putMap(SENDER_PHONE_MC.convert(sender.getPhone())); requestMap.putMap(SENDER_ADDRESS_MC.convert(sender.getAddress())); }  }
SenderV3MapConverter extends AbstractMapConverter<Sender> { @Override protected void convert(RequestMap requestMap, Sender sender) { requestMap.putString("sender.email", sender.getEmail()); requestMap.putString("sender.name", sender.getName()); requestMap.putString("sender.CPF", sender.getCpf()); requestMap.putString("sender.CNPJ", sender.getCnpj()); requestMap.putString("sender.hash", sender.getHash()); requestMap.putMap(SENDER_PHONE_MC.convert(sender.getPhone())); requestMap.putMap(SENDER_ADDRESS_MC.convert(sender.getAddress())); }   }
SenderV3MapConverter extends AbstractMapConverter<Sender> { @Override protected void convert(RequestMap requestMap, Sender sender) { requestMap.putString("sender.email", sender.getEmail()); requestMap.putString("sender.name", sender.getName()); requestMap.putString("sender.CPF", sender.getCpf()); requestMap.putString("sender.CNPJ", sender.getCnpj()); requestMap.putString("sender.hash", sender.getHash()); requestMap.putMap(SENDER_PHONE_MC.convert(sender.getPhone())); requestMap.putMap(SENDER_ADDRESS_MC.convert(sender.getAddress())); }    }