Skip to content

Commit

Permalink
[Java] Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Jan 15, 2024
1 parent 6f99a92 commit 341d57c
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
import static io.aeron.protocol.DataHeaderFlyweight.HEADER_LENGTH;
import static java.nio.charset.StandardCharsets.US_ASCII;
import static org.agrona.BitUtil.SIZE_OF_LONG;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

Expand Down Expand Up @@ -555,6 +557,16 @@ void concludeUsesAeronClientIdIfSystemPropertyIsSetToNullValue()
}
}

@ParameterizedTest
@ValueSource(longs = { 119, 0, -5 })
void shouldPrintArchiveId(final long archiveId)
{
context.archiveId(archiveId);
context.conclude();

assertThat(context.toString(), containsString("archiveId=" + archiveId));
}

@ParameterizedTest
@ValueSource(ints = { -31, HEADER_LENGTH, MAX_UDP_PAYLOAD_LENGTH + 1, 69 })
void shouldValidateControlMtuLength(final int controlMtuLength)
Expand Down

0 comments on commit 341d57c

Please sign in to comment.