@Test public void testToDtoWithParameters() { CommandDoc commandDoc = new CommandDocMapper().toDto(qavCommand2); CommandDoc expected = new CommandDoc(); expected.setName("cmd2"); expected.setDescription("desc2"); expected.setResult("result2"); ParameterDoc param1 = new ParameterDoc(); param1.setName("param1"); param1.setDescription("param1 description"); ParameterDoc param2 = new ParameterDoc(); param2.setName("param2"); param2.setDescription("param2 description"); expected.setParameters(Lists.newArrayList(param1, param2)); assertThat(commandDoc, notNullValue()); assertThat(commandDoc, is(expected)); }
public CommandDoc toDto(QavCommand qavCommand) { CommandDoc result = new CommandDoc(); result.setName(qavCommand.name()); result.setDescription(qavCommand.description()); result.setResult(qavCommand.result()); result.setParameters(getParameterDocs(qavCommand.parameters())); return result; }
CommandDocMapper { public CommandDoc toDto(QavCommand qavCommand) { CommandDoc result = new CommandDoc(); result.setName(qavCommand.name()); result.setDescription(qavCommand.description()); result.setResult(qavCommand.result()); result.setParameters(getParameterDocs(qavCommand.parameters())); return result; } }
CommandDocMapper { public CommandDoc toDto(QavCommand qavCommand) { CommandDoc result = new CommandDoc(); result.setName(qavCommand.name()); result.setDescription(qavCommand.description()); result.setResult(qavCommand.result()); result.setParameters(getParameterDocs(qavCommand.parameters())); return result; }  }
CommandDocMapper { public CommandDoc toDto(QavCommand qavCommand) { CommandDoc result = new CommandDoc(); result.setName(qavCommand.name()); result.setDescription(qavCommand.description()); result.setResult(qavCommand.result()); result.setParameters(getParameterDocs(qavCommand.parameters())); return result; }  CommandDoc toDto(QavCommand qavCommand); }
CommandDocMapper { public CommandDoc toDto(QavCommand qavCommand) { CommandDoc result = new CommandDoc(); result.setName(qavCommand.name()); result.setDescription(qavCommand.description()); result.setResult(qavCommand.result()); result.setParameters(getParameterDocs(qavCommand.parameters())); return result; }  CommandDoc toDto(QavCommand qavCommand);  }