<commit_before>package org.devgateway.ocds.web.rest.controller;

import com.mongodb.DBObject;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.aggregation.Fields;

import java.util.List;

/**
 * @author idobre
 * @since 9/15/16
 *
 * @see {@link AbstractEndPointControllerTest}
 */
public class TendersAwardsYearsTest extends AbstractEndPointControllerTest {
    @Autowired
    private TendersAwardsYears tendersAwardsYears;

    @Test
    public void tendersAwardsYears() throws Exception {
        final List<DBObject> response = tendersAwardsYears.tendersAwardsYears();

        final DBObject first = response.get(0);
        int year = (int) first.get(Fields.UNDERSCORE_ID);
        Assert.assertEquals(2014, year);

        final DBObject second = response.get(0);
        year = (int) second.get(Fields.UNDERSCORE_ID);
        Assert.assertEquals(2015, year);

        final DBObject third = response.get(0);
        year = (int) third.get(Fields.UNDERSCORE_ID);
        Assert.assertEquals(2016, year);
    }
}<commit_msg>fixed test for TendersAwardsYearsTest controller.<commit_after>package org.devgateway.ocds.web.rest.controller;

import com.mongodb.DBObject;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.aggregation.Fields;

import java.util.List;

/**
 * @author idobre
 * @since 9/15/16
 *
 * @see {@link AbstractEndPointControllerTest}
 */
public class TendersAwardsYearsTest extends AbstractEndPointControllerTest {
    @Autowired
    private TendersAwardsYears tendersAwardsYears;

    @Test
    public void tendersAwardsYears() throws Exception {
        final List<DBObject> response = tendersAwardsYears.tendersAwardsYears();

        final DBObject first = response.get(0);
        int year = (int) first.get(Fields.UNDERSCORE_ID);
        Assert.assertEquals(2014, year);

        final DBObject second = response.get(1);
        year = (int) second.get(Fields.UNDERSCORE_ID);
        Assert.assertEquals(2015, year);

        final DBObject third = response.get(2);
        year = (int) third.get(Fields.UNDERSCORE_ID);
        Assert.assertEquals(2016, year);
    }
}
{'fraction_non_alphanumeric': 0.10519480519480519, 'fraction_numerical': 0.017316017316017316, 'mean_word_length': 3.814583333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5329554', 'n_tokens_mistral': 721, 'n_tokens_neox': 686, 'n_words': 140}