<commit_before>package algolia

import algolia.AlgoliaDsl._
import algolia.responses.{Indexes, Search}
import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.time.{Seconds, Span}
import org.json4s._
import org.json4s.native.JsonMethods._

import scala.concurrent.Future

class IntegrationTest extends AlgoliaTest {

  val client = new AlgoliaClient(applicationId, apiKey)

  describe("indexes") {

    it("should get a response") {
      val indices: Future[Indexes] = client.execute {
        indexes
      }

      whenReady(indices) { result =>
        result.nbPages should equal(1)
        result.items should have size 1
        result.items.head.name should be("test")
      }
    }
  }

  describe("search") {

//    case class Test(name: String,
//                   age: Int,
//                   alien: Boolean)

    it("should search with a query") {
      val s: Future[Search] = client.execute {
        search into Index("test") query "a"
      }

      whenReady(s) { result =>
        result.hits should have length 1
        result.hits.head.values should be(Map("name" -> "algolia", "age" -> 10, "alien" -> false))
      }

    }
  }

}<commit_msg>Fix tests<commit_after>package algolia

import algolia.AlgoliaDsl._
import algolia.responses.{Indexes, Search}

import scala.concurrent.Future

class IntegrationTest extends AlgoliaTest {

  val client = new AlgoliaClient(applicationId, apiKey)

  describe("indexes") {

    it("should get a response") {
      val indices: Future[Indexes] = client.execute {
        indexes
      }

      whenReady(indices) { result =>
        result.nbPages should equal(1)
        result.items should have size 1
        result.items.head.name should be("test")
      }
    }
  }

  describe("search") {

    //    case class Test(name: String,
    //                   age: Int,
    //                   alien: Boolean)

    it("should search with a query") {
      val s: Future[Search] = client.execute {
        search into Index("test") query "a"
      }

      whenReady(s) { result =>
        result.hits should have length 1
        result.hits.head.values should be(Map(
          "name" -> "algolia",
          "age" -> 10,
          "alien" -> false,
          "_highlightResult" -> Map(
            "name" -> Map(
              "value" -> "<em>a</em>lgolia",
              "matchLevel" -> "full",
              "matchedWords" -> List("a")
            )
          ),
          "objectID" -> "563481290"
        ))
      }

    }
  }

}
{'fraction_non_alphanumeric': 0.12143987341772151, 'fraction_numerical': 0.008306962025316455, 'mean_word_length': 2.0506634499396865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '1360121', 'n_tokens_mistral': 790, 'n_tokens_neox': 753, 'n_words': 181}