In below two methods I would like to extract common methods, the problem I have is that aisleID in one of it is optional - is it any way to put optional argument in java method ?
private void putPageUnderAisleId(String aisleId) {
given()
.spec(prepareApplicationJsonHeaders())
.header(HttpHeaders.AUTHORIZATION, verifiableToken(Roles.WRITE_MERCHANDISING))
.body(readResource(NAMED_PAGE_CONTENT_FILE, String.format("%s.html", TEST_PAGE.value()), AISLE_TEST_LOCATION))
.put(AISLE_HTML_URL, aisleId)
.then()
.statusCode(200)
.body(not(isEmptyOrNullString()))
.body(JSON_RESPONSE_MESSAGE, not(isEmptyOrNullString()));
}
private void putPageUnderRootAisleId() {
given()
.spec(prepareApplicationJsonHeaders())
.header(HttpHeaders.AUTHORIZATION, verifiableToken(Roles.WRITE_MERCHANDISING))
.body(readResource(NAMED_PAGE_CONTENT_FILE, String.format("%s.html", TEST_PAGE.value()), AISLE_TEST_LOCATION))
.put(ROOT_AISLE_HTML_URL)
.then()
.statusCode(200)
.body(not(isEmptyOrNullString()))
.body(JSON_RESPONSE_MESSAGE, not(isEmptyOrNullString()));
}