Search in sources :

Example 1 with Limited

use of org.cactoos.iterable.Limited in project cactoos by yegor256.

the class BytesOfTest method readsLargeInMemoryContent.

@Test
public void readsLargeInMemoryContent() throws IOException {
    final int multiplier = 5_000;
    final String body = "1234567890";
    MatcherAssert.assertThat("Can't read large content from in-memory Input", new BytesOf(new InputOf(new JoinedText("", new Limited<>(multiplier, new Endless<>(body))))).asBytes().length, Matchers.equalTo(body.length() * multiplier));
}
Also used : JoinedText(org.cactoos.text.JoinedText) TextHasString(org.cactoos.matchers.TextHasString) Limited(org.cactoos.iterable.Limited) Test(org.junit.Test)

Aggregations

Limited (org.cactoos.iterable.Limited)1 TextHasString (org.cactoos.matchers.TextHasString)1 JoinedText (org.cactoos.text.JoinedText)1 Test (org.junit.Test)1