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