@Test public void getResultMessageFromChildrenTwoChildren() { ApiCommandList level1 = getApiCommandList("name0", "message0", "serviceName0"); ApiCommand level1Ch1 = getFailedApiCommand("name1", "message1", "serviceName1"); ApiCommand level1Ch2 = getFailedApiCommand("name2", "message2", "serviceName2"); level1.addItemsItem(level1Ch1); level1.addItemsItem(level1Ch2); List<String> actual = ApiCommandUtil.getFailedCommandMessages(level1); Assertions.assertEquals(actual.size(), 3); Assertions.assertEquals(actual.get(0), "name0(serviceName0): message0"); Assertions.assertEquals(actual.get(1), "name1(serviceName1): message1"); Assertions.assertEquals(actual.get(2), "name2(serviceName2): message2"); }
public static List<String> getFailedCommandMessages(ApiCommandList apiCommandList) { List<ApiCommand> failedCommands = getFailedCommands(apiCommandList); LOGGER.debug("Failed commands: {}", failedCommands); return failedCommands.stream().map(ApiCommandUtil::formatToLine).collect(toList()); }
ApiCommandUtil { public static List<String> getFailedCommandMessages(ApiCommandList apiCommandList) { List<ApiCommand> failedCommands = getFailedCommands(apiCommandList); LOGGER.debug("Failed commands: {}", failedCommands); return failedCommands.stream().map(ApiCommandUtil::formatToLine).collect(toList()); } }
ApiCommandUtil { public static List<String> getFailedCommandMessages(ApiCommandList apiCommandList) { List<ApiCommand> failedCommands = getFailedCommands(apiCommandList); LOGGER.debug("Failed commands: {}", failedCommands); return failedCommands.stream().map(ApiCommandUtil::formatToLine).collect(toList()); } private  ApiCommandUtil(); }
ApiCommandUtil { public static List<String> getFailedCommandMessages(ApiCommandList apiCommandList) { List<ApiCommand> failedCommands = getFailedCommands(apiCommandList); LOGGER.debug("Failed commands: {}", failedCommands); return failedCommands.stream().map(ApiCommandUtil::formatToLine).collect(toList()); } private  ApiCommandUtil(); static List<String> getFailedCommandMessages(ApiCommandList apiCommandList); }
ApiCommandUtil { public static List<String> getFailedCommandMessages(ApiCommandList apiCommandList) { List<ApiCommand> failedCommands = getFailedCommands(apiCommandList); LOGGER.debug("Failed commands: {}", failedCommands); return failedCommands.stream().map(ApiCommandUtil::formatToLine).collect(toList()); } private  ApiCommandUtil(); static List<String> getFailedCommandMessages(ApiCommandList apiCommandList);  }