Search in sources :

Example 6 with ContentIs

use of com.artipie.asto.test.ContentIs in project maven-adapter by artipie.

the class UploadSliceTest method savesDataToTempUpload.

@Test
void savesDataToTempUpload() {
    final byte[] data = "jar content".getBytes();
    MatcherAssert.assertThat("Wrong response status, CREATED is expected", this.ums, new SliceHasResponse(new RsHasStatus(RsStatus.CREATED), new RequestLine(RqMethod.PUT, "/com/artipie/asto/0.1/asto-0.1.jar"), new Headers.From(new ContentLength(data.length)), new Content.From(data)));
    MatcherAssert.assertThat("Uploaded data were not saved to storage", this.asto.value(new Key.From(".upload/com/artipie/asto/0.1/asto-0.1.jar")).join(), new ContentIs(data));
}
Also used : RequestLine(com.artipie.http.rq.RequestLine) SliceHasResponse(com.artipie.http.hm.SliceHasResponse) RsHasStatus(com.artipie.http.hm.RsHasStatus) ContentLength(com.artipie.http.headers.ContentLength) ContentIs(com.artipie.asto.test.ContentIs) Key(com.artipie.asto.Key) Test(org.junit.jupiter.api.Test)

Aggregations

Key (com.artipie.asto.Key)6 ContentIs (com.artipie.asto.test.ContentIs)6 RsHasStatus (com.artipie.http.hm.RsHasStatus)6 SliceHasResponse (com.artipie.http.hm.SliceHasResponse)6 RequestLine (com.artipie.http.rq.RequestLine)6 Content (com.artipie.asto.Content)5 MetadataXml (com.artipie.maven.MetadataXml)5 Test (org.junit.jupiter.api.Test)5 ContentLength (com.artipie.http.headers.ContentLength)4 ContentDigest (com.artipie.asto.ext.ContentDigest)2 Maven (com.artipie.maven.Maven)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 ValueSource (org.junit.jupiter.params.provider.ValueSource)1