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

下面列出了怎么用org.springframework.boot.test.OutputCapture的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: 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);
}
 
 类所在包
 类方法
 同包方法