use of org.cactoos.iterable.Endless in project cactoos by yegor256.
the class BytesOfTest method readsLargeInMemoryContent.
@Test
void readsLargeInMemoryContent() throws Exception {
final int multiplier = 5_000;
final String body = "1234567890";
new Assertion<>("must read large content from in-memory Input", new BytesOf(new InputOf(new Concatenated(new HeadOf<>(multiplier, new Endless<>(new TextOf(body)))))).asBytes().length, new IsEqual<>(body.length() * multiplier)).affirm();
}
use of org.cactoos.iterable.Endless in project cactoos by yegor256.
the class InputAsBytesTest method readsLargeInMemoryContent.
@Test
void readsLargeInMemoryContent() throws Exception {
final int multiplier = 5_000;
final String body = "1234567890";
new Assertion<>("must read large content from in-memory Input", new InputAsBytes(new InputOf(String.join("", new HeadOf<>(multiplier, new Endless<>(body))))).asBytes().length, new IsEqual<>(body.length() * multiplier)).affirm();
}