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

import org.devgateway.ocds.persistence.mongo.FlaggedRelease;
import org.devgateway.ocds.persistence.mongo.repository.FlaggedReleaseRepository;
import org.devgateway.ocds.persistence.mongo.spring.ReleaseFlaggingService;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author mpostelnicu
 *
 */
public class ReleaseFlaggingServiceTest extends AbstractEndPointControllerTest {

    @Autowired
    private ReleaseFlaggingService releaseFlaggingService;
    

    @Autowired
    private FlaggedReleaseRepository flaggedReleaseRepository;;
    
    
    public static void logMessage(String message) {
        logger.info(message);
    }

    @Before
    public final void setUp() throws Exception {
        super.setUp();
        releaseFlaggingService.processAndSaveFlagsForAllReleases(ReleaseFlaggingServiceTest::logMessage);
    }

    @Test
    public void testI038() {
        FlaggedRelease release1 = flaggedReleaseRepository.findByOcid("ocds-endpoint-001");
        Assert.assertNotNull(release1);
        Assert.assertEquals(false, release1.getFlags().getI038().getValue());

        FlaggedRelease release2 = flaggedReleaseRepository.findByOcid("ocds-endpoint-002");
        Assert.assertNotNull(release2);
        Assert.assertEquals(null, release2.getFlags().getI038().getValue());
    }


    
}<commit_msg>OCE-162 flags i019 and i007 tests<commit_after>/**
 * 
 */
package org.devgateway.ocds.web.rest.controller;

import org.devgateway.ocds.persistence.mongo.FlaggedRelease;
import org.devgateway.ocds.persistence.mongo.repository.FlaggedReleaseRepository;
import org.devgateway.ocds.persistence.mongo.spring.ReleaseFlaggingService;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author mpostelnicu
 *
 */
public class ReleaseFlaggingServiceTest extends AbstractEndPointControllerTest {

    @Autowired
    private ReleaseFlaggingService releaseFlaggingService;
    

    @Autowired
    private FlaggedReleaseRepository flaggedReleaseRepository;;
    
    
    public static void logMessage(String message) {
        logger.info(message);
    }

    @Before
    public final void setUp() throws Exception {
        super.setUp();
        releaseFlaggingService.processAndSaveFlagsForAllReleases(ReleaseFlaggingServiceTest::logMessage);
    }

    @Test
    public void testI038() {
        FlaggedRelease release1 = flaggedReleaseRepository.findByOcid("ocds-endpoint-001");
        Assert.assertNotNull(release1);
        Assert.assertEquals(false, release1.getFlags().getI038().getValue());

        FlaggedRelease release2 = flaggedReleaseRepository.findByOcid("ocds-endpoint-002");
        Assert.assertNotNull(release2);
        Assert.assertEquals(null, release2.getFlags().getI038().getValue());
    }

    @Test
    public void testI019() {
        FlaggedRelease release1 = flaggedReleaseRepository.findByOcid("ocds-endpoint-001");
        Assert.assertNotNull(release1);
        Assert.assertEquals(true, release1.getFlags().getI019().getValue());

        FlaggedRelease release2 = flaggedReleaseRepository.findByOcid("ocds-endpoint-002");
        Assert.assertNotNull(release2);
        Assert.assertEquals(null, release2.getFlags().getI019().getValue());
    }

    @Test
    public void testI007() {
        FlaggedRelease release1 = flaggedReleaseRepository.findByOcid("ocds-endpoint-001");
        Assert.assertNotNull(release1);
        Assert.assertEquals(true, release1.getFlags().getI007().getValue());

        FlaggedRelease release2 = flaggedReleaseRepository.findByOcid("ocds-endpoint-002");
        Assert.assertNotNull(release2);
        Assert.assertEquals(null, release2.getFlags().getI007().getValue());
    }



}
{'fraction_non_alphanumeric': 0.10524974515800203, 'fraction_numerical': 0.023700305810397553, 'mean_word_length': 4.051480051480051, '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': '5715365', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1100, 'n_words': 163}