<commit_before>package io.sylvanlibrary.api.handlers

import io.sylvanlibrary.api.models.RequestPagination
import org.junit.Before
import org.junit.Test
import org.hamcrest.CoreMatchers.equalTo
import org.junit.Assert.assertThat
import org.junit.runner.Request

import ratpack.test.handling.RequestFixture

class PaginationHandlerTest {
  lateinit var classUnderTest: PaginationHandler
  lateinit var fixture: RequestFixture

  companion object {
    val TEST_VALUE = 10
  }

  @Before
  fun before() {
    classUnderTest = PaginationHandler()
    fixture = RequestFixture.requestFixture()
  }

  @Test
  fun itParsesPaginationValuesFromQueryString() {
    val result = fixture
        .uri("http://example.com/example?limit=$TEST_VALUE&from=$TEST_VALUE")
        .handle(classUnderTest)

    val pagination = result.registry.get(RequestPagination::class.java)

    assertThat(pagination.limit, equalTo(TEST_VALUE))
    assertThat(pagination.from, equalTo(TEST_VALUE))
  }
<commit_msg>Clean up imports<commit_after>package io.sylvanlibrary.api.handlers

import io.sylvanlibrary.api.models.RequestPagination
import org.hamcrest.CoreMatchers.equalTo
import org.junit.Assert.assertThat
import org.junit.Before
import org.junit.Test
import ratpack.test.handling.RequestFixture

class PaginationHandlerTest {
  lateinit var classUnderTest: PaginationHandler
  lateinit var fixture: RequestFixture

  companion object {
    val TEST_VALUE = 10
  }

  @Before
  fun before() {
    classUnderTest = PaginationHandler()
    fixture = RequestFixture.requestFixture()
  }

  @Test
  fun itParsesPaginationValuesFromQueryString() {
    val result = fixture
        .uri("http://example.com/example?limit=$TEST_VALUE&from=$TEST_VALUE")
        .handle(classUnderTest)

    val pagination = result.registry.get(RequestPagination::class.java)

    assertThat(pagination.limit, equalTo(TEST_VALUE))
    assertThat(pagination.from, equalTo(TEST_VALUE))
  }

{'fraction_non_alphanumeric': 0.09020618556701031, 'fraction_numerical': 0.002061855670103093, 'mean_word_length': 4.69208211143695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5045360', 'n_tokens_mistral': 599, 'n_tokens_neox': 586, 'n_words': 106}