推奨事項のタイプ: アクセスできないフィールドのアサーション
設定可能: はい
フィルター カテゴリアサーション
この推奨事項は、[トラック] オプションを使用してコードを実行した場合に表示されます。アクセスできないフィールドが実行中に変更されたのを UTA が検出すると、関連情報を表示し、手動での変更が必要なアサーション テンプレートを生成します。詳細は「オブジェクトの変更の追跡とアサーションの作成」を参照してください。
[トラック] オプションで次のコードを実行した場合、UTA はこの推奨事項を表示します。
public class Example {
private boolean flag = false;
void setFlag(boolean flag) {
this.flag = flag;
}
}
@Test
public void testSetFlag()
{
Example example = new Example();
boolean flag = true;
example.setFlag(flag);
} |
[アサーション テンプレートの作成] アクション リンクをクリックすると、アサーション テンプレートが生成されます。
// Then - assertion templates for this instance of ExampleTest.Example boolean example_flag = false; // UTA: default value assertTrue(example_flag); |