0
RestAssuredを使用するいくつかのJavaテストがあります。多くのテストでは、given()とwhen()のパラメータは異なりますが、then()セクションは同じで、複数のassertThat()文で構成されています。 then()ブロックを何度も繰り返し使用できる新しいメソッドに移動するにはどうすればよいですか?RestAssuredで共通のアサートを再利用する方法
@Test
public void test_inAppMsgEmptyResponse() {
given().
contentType("application/json").
when().
get("inapp/messages.json").
then().assertThat().
statusCode(HttpStatus.SC_OK).
assertThat().
body("pollInterval", equalTo(defaultPollInterval)).
assertThat().
body("notifications", hasSize(0));
}