Petals-BC-REST 1.1.0+

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (6)

View Page History
...

public class GetMetadataByJsonOpTest {

@ClassRule
public static final ServiceOperationUnderTest OPERATION_UNDER_TEST = new ServiceOperationUnderTest(
OP_GET_METADATA_BY_JSON);

/**
* Check the JBI response of operation {@value OP_GET_METADATA_BY_JSON} when a REST response is returned with HTTP
* status 200 and contains metadatas.
*/
@Test
public void nominal() throws Exception {
assertJBIOutResponse("get-metadata-expected-nominal-response.xml", OPERATION_UNDER_TEST,
HttpStatus.OK_200, HttpStatus.getCode(HttpStatus.OK_200).getMessage(), HttpStatus.SC_OK, null, "get-metadata-nominal-http-body.json",
MediaType.APPLICATION_JSON_TYPE, null);
}

/**
* Check the JBI response of operation {@value OP_GET_METADATA_BY_JSON} when a REST response is returned with HTTP
* status 404 (unexisting document)
*/
@Test
public void nometadata() throws Exception {
assertJBIOutResponse("get-metadata-expected-no-metadata-response.xml", OPERATION_UNDER_TEST,
HttpStatus.SC_OK, null, "get-metadata-no-metadata-http-body.json",
MediaType.APPLICATION_JSON_TYPE, null);
}

@Test
public void unexistingDocument() throws Exception {

assertJBIFault("get-metadata-expected-fault-unexisting-document.xml", OPERATION_UNDER_TEST,
HttpStatus.NOT_FOUND_404, HttpStatus.getCode(HttpStatus.NOT_FOUND_404).getMessage(), HttpStatus.SC_NOT_FOUND, null, null, null, "get-metadata-by-json-request.xml", null);
}
}