<commit_before>package com.cruftlab.words.service;

import com.cruftlab.words.model.CombinedWord;
import com.cruftlab.words.model.Word;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;

@RunWith(SpringRunner.class)
@SpringBootTest
public class WordCombinatorServiceTest {
    @Mock
    private WordService wordService;

    private WordCombinatorService wordCombinatorService;

    @Before
    public void setupMocks() {
        Mockito.when(wordService.findRandom(2))
            .thenReturn(new ArrayList<Word>() {{
                add(new Word("gebiss"));
                add(new Word("sevje"));
            }});
        wordCombinatorService = new WordCombinatorService(wordService);
    }

    @Test
    public void assertWordsAreProperlyCombined() {
        final CombinedWord combinedWord = wordCombinatorService.combineRandom(2);
        Assert.assertEquals("gebissevje", combinedWord.getCombinedForm());
    }

    @After
    public void verifyMocks() {
        Mockito.verify(wordService);<commit_msg>mock repository instead of service<commit_after>package com.cruftlab.words.service;

import com.cruftlab.words.model.CombinedWord;
import com.cruftlab.words.model.Word;
import com.cruftlab.words.repository.WordRepository;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;

@RunWith(SpringRunner.class)
@SpringBootTest
public class WordCombinatorServiceTest {
    @Mock
    private WordRepository wordRepository;

    private WordCombinatorService wordCombinatorService;

    @Before
    public void setupMocks() {
        Mockito.when(wordRepository.findRandom(2))
            .thenReturn(new ArrayList<Word>() {{
                add(new Word("gebiss"));
                add(new Word("sevje"));
            }});
        wordCombinatorService = new WordCombinatorService(new WordService(wordRepository));
    }

    @Test
    public void assertWordsAreProperlyCombined() {
        final CombinedWord combinedWord = wordCombinatorService.combineRandom(2);
        Assert.assertEquals("gebissevje", combinedWord.getCombinedForm());
    }

    @After
    public void verifyMocks() {
        Mockito.verify(wordRepository);
{'fraction_non_alphanumeric': 0.10044477390659748, 'fraction_numerical': 0.002223869532987398, 'mean_word_length': 3.9072727272727272, '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': '7251318', 'n_tokens_mistral': 795, 'n_tokens_neox': 769, 'n_words': 140}