verify community of heirs to be the new holder of the partnerRel - currently failing
This commit is contained in:
parent
781fcef1d3
commit
e4e509a23a
@ -76,9 +76,10 @@ public class ReplaceDeceasedPartnerWithCommunityOfHeirs extends UseCase<ReplaceD
|
||||
@Override
|
||||
protected void verify(final UseCase<ReplaceDeceasedPartnerWithCommunityOfHeirs>.HttpResponse response) {
|
||||
verify(
|
||||
"Verify the New Partner Relation",
|
||||
() -> httpGet("/api/hs/office/relations?relationType=PARTNER&contactData=Erbengemeinschaft%20&{nameOfDeceasedPerson}")
|
||||
.expecting(OK).expecting(JSON).expectArrayElements(1)
|
||||
"Verify the Updated Partner",
|
||||
() -> httpGet("/api/hs/office/partners/%{partnerNumber}")
|
||||
.expecting(OK).expecting(JSON).expectObject(),
|
||||
path("partnerRel.holder.tradeName").contains("Erbengemeinschaft %{nameOfDeceasedPerson}")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -335,6 +335,13 @@ public abstract class UseCase<T extends UseCase<?>> {
|
||||
return this;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public HttpResponse expectObject() {
|
||||
final var rootNode = objectMapper.readTree(response.body());
|
||||
assertThat(rootNode.isArray()).as("object expected, but got array: " + response.body()).isFalse();
|
||||
return this;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public <V> V getFromBody(final String path) {
|
||||
final var body = response.body();
|
||||
|
Loading…
Reference in New Issue
Block a user