public interface CapturedOutput extends CharSequenceSE
OutputCaptureExtension または OutputCaptureRule によってキャプチャーされた System.outSE および System.errSE 出力へのアクセスを提供します。AssertJ または標準の JUnit アサーションを使用してアサーションを適用するために使用できます。例:
assertThat(output).contains("started"); // Checks all output
assertThat(output.getErr()).contains("failed"); // Only checks System.err
assertThat(output.getOut()).contains("ok"); // Only checks System.out
OutputCaptureExtension| 修飾子と型 | メソッドと説明 |
|---|---|
default char | charAt(int index) |
StringSE | getAll() すべてのコンテンツ( System.outSE および System.errSE の両方)がキャプチャーされた順序で返されます。 |
StringSE | getErr()System.errSE コンテンツをキャプチャーした順に返します。 |
StringSE | getOut()System.outSE コンテンツをキャプチャーした順に返します。 |
default int | length() |
default CharSequenceSE | subSequence(int start, int end) |
charsSE, codePointsSE, toStringSEdefault int length()
CharSequenceSE 内の lengthSE default char charAt(int index)
CharSequenceSE 内の charAtSE default CharSequenceSE subSequence(int start, int end)
CharSequenceSE 内の subSequenceSE StringSE getAll()
System.outSE および System.errSE の両方)がキャプチャーされた順序で返されます。StringSE getOut()
System.outSE コンテンツをキャプチャーした順に返します。System.outSE キャプチャー出力 StringSE getErr()
System.errSE コンテンツをキャプチャーした順に返します。System.errSE キャプチャー出力 Copyright © 2019 Pivotal Software, Inc.. All rights reserved.