Java 类org.springframework.boot.test.OutputCapture 实例源码

项目:mojito    文件:DropImportCommandTest.java   
public static Long getLastDropIdFromOutput(OutputCapture outputCapture) {
    Pattern compile = Pattern.compile("Drop id: ([\\d]+)");
    Matcher matcher = compile.matcher(outputCapture.toString());
    String dropId = null;
    while (matcher.find()) {
        dropId = matcher.group(1);
    }
    return Long.valueOf(dropId);
}