Both the assertCreatedWithServerId and assertCreatedWithClientId expect the Location header to be present. However, if there is a resource that is not retrievable via its ID, then it would be legitimate to not have a Location header. The assertion therefore needs to accept null for the expected location.
This fits with the spec, that states that the Location header SHOULD be included... i.e. it is legitimate not to have the header.
Both the
assertCreatedWithServerIdandassertCreatedWithClientIdexpect theLocationheader to be present. However, if there is a resource that is not retrievable via its ID, then it would be legitimate to not have aLocationheader. The assertion therefore needs to acceptnullfor the expected location.This fits with the spec, that states that the Location header SHOULD be included... i.e. it is legitimate not to have the header.