<commit_before>package com.neoteric.starter.mongo.request;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.neoteric.starter.mongo.MongoConvertersAutoConfiguration;
import com.neoteric.starter.mongo.MongoCriteriaBuilderAutoConfiguration;
import com.neoteric.starter.mongo.model.FooModel;
import com.neoteric.starter.mongo.model.FooModelMother;
import com.neoteric.starter.mongo.sort.RequestParamsSortBuilder;
import com.neoteric.starter.request.FiltersParser;
import com.neoteric.starter.request.RequestObject;
import com.neoteric.starter.request.sort.RequestSort;
import com.neoteric.starter.request.sort.SortParser;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = {MongoConvertersAutoConfiguration.class,
        EmbeddedMongoAutoConfiguration.class,
        MongoAutoConfiguration.class,
        MongoDataAutoConfiguration.class,
        MongoCriteriaBuilderAutoConfiguration.class,
        DateTimeFormatterAutoConfiguration.class})
public class MongoCriteriaIntegrationTest {

    @Autowired
    private MongoTemplate mongoTemplate;

    @Autowired
    private RequestParamsCriteriaBuilder requestParamsCriteriaBuilder;

    @Before
    public void initCriteriaTest() {<commit_msg>Add random Embedded Mongo DB Port for testing<commit_after>package com.neoteric.starter.mongo.request;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.neoteric.starter.mongo.MongoConvertersAutoConfiguration;
import com.neoteric.starter.mongo.MongoCriteriaBuilderAutoConfiguration;
import com.neoteric.starter.mongo.model.FooModel;
import com.neoteric.starter.mongo.model.FooModelMother;
import com.neoteric.starter.mongo.sort.RequestParamsSortBuilder;
import com.neoteric.starter.request.FiltersParser;
import com.neoteric.starter.request.RequestObject;
import com.neoteric.starter.request.sort.RequestSort;
import com.neoteric.starter.request.sort.SortParser;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

@RunWith(SpringRunner.class)
@TestPropertySource(properties = "spring.data.mongodb.port=0")
@ContextConfiguration(classes = {MongoConvertersAutoConfiguration.class,
        EmbeddedMongoAutoConfiguration.class,
        MongoAutoConfiguration.class,
        MongoDataAutoConfiguration.class,
        MongoCriteriaBuilderAutoConfiguration.class,
        DateTimeFormatterAutoConfiguration.class})
public class MongoCriteriaIntegrationTest {

    @Autowired
    private MongoTemplate mongoTemplate;

    @Autowired
    private RequestParamsCriteriaBuilder requestParamsCriteriaBuilder;

    @BeforeClass
    public static void initCriteriaTest() {
{'fraction_non_alphanumeric': 0.08918753817959682, 'fraction_numerical': 0.0006108735491753207, 'mean_word_length': 6.453717754172989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3756621', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1382, 'n_words': 206}