@Override public byte[] modifyContent(byte[] originalContent, MediaType contentType) { return this.contentModifier.modifyContent(originalContent, contentType); }
@Override public OperationRequest preprocess(OperationRequest request) { byte[] modifiedContent = this.contentModifier.modifyContent(request.getContent(), request.getHeaders().getContentType()); return this.requestFactory.createFrom(request, modifiedContent); }
@Override public OperationResponse preprocess(OperationResponse response) { byte[] modifiedContent = this.contentModifier.modifyContent(response.getContent(), response.getHeaders().getContentType()); return this.responseFactory.createFrom(response, modifiedContent); }
@Test public void atomLinksAreMasked() throws Exception { assertThat(this.contentModifier.modifyContent(atomPayloadWithLinks(this.links), null)).isEqualTo(atomPayloadWithLinks(this.maskedLinks)); }
@Test public void formattedHalLinksAreMasked() throws Exception { assertThat(this.contentModifier .modifyContent(formattedHalPayloadWithLinks(this.links), null)) .isEqualTo(formattedHalPayloadWithLinks(this.maskedLinks)); }
@Test public void halLinksAreMasked() throws Exception { assertThat( this.contentModifier.modifyContent(halPayloadWithLinks(this.links), null)) .isEqualTo(halPayloadWithLinks(this.maskedLinks)); }
@Test public void formattedAtomLinksAreMasked() throws Exception { assertThat(this.contentModifier .modifyContent(formattedAtomPayloadWithLinks(this.links), null)) .isEqualTo(formattedAtomPayloadWithLinks(this.maskedLinks)); }