UpdateNamePayloadConverter implements PayloadConverter<UpdateName> { @Override public BytesValue convertToPayload(final UpdateName updateName) { logger.debug("Convert to payload from {}", updateName); final List<Object> args = new ArrayList<>(); args.add(updateName.getName().getValue()); args.add(updateName.getNextOwner().getValue()); final Map<String, Object> map = new HashMap<>(); map.put("Name", updateName.getOperationName()); map.put("Args", args); return mapper.marshal(map); }  @Override BytesValue convertToPayload(final UpdateName updateName); @Override UpdateName parseToModel(final BytesValue payload);  }
@Test public void testConvertToPayload() { final PayloadConverter<UpdateName> converter = new UpdateNamePayloadConverter(); final UpdateName updateName = UpdateName.newBuilder() .name(Name.of(randomUUID().toString())) .nextOwner(new AergoKeyGenerator().create().getAddress()) .build(); final BytesValue payload = converter.convertToPayload(updateName); assertNotNull(payload); }