<commit_before>package se.kits.gakusei.controller;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import se.kits.gakusei.content.model.Lesson;
import se.kits.gakusei.content.model.Nugget;
import se.kits.gakusei.content.repository.LessonRepository;
import se.kits.gakusei.content.repository.UserLessonRepository;
import se.kits.gakusei.test_tools.TestTools;
import se.kits.gakusei.util.QuestionHandler;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;

@RunWith(MockitoJUnitRunner.class)
public class QuestionControllerTest {

    @InjectMocks
    private QuestionController questionController;

    @Mock
    private QuestionHandler questionHandler;

    @Mock
    private LessonRepository lessonRepository;

    @Mock
    private UserLessonRepository userLessonRepository;

    @Value("${gakusei.questions-quantity}")
    private int quantity;

    private String questionType;
    private String answerType;
    private String lessonName;
    private String userName;
    private List<Nugget> nuggets;
    private Lesson lesson;
    private List<HashMap<String, Object>> questionList;

    @Before
    public void setUp() throws Exception {
        questionController = new QuestionController(lessonRepository, questionHandler, userLessonRepository);
        MockitoAnnotations.initMocks(this);
        questionType = "reading";
        answerType = "swedish";
        lessonName = "Verbs";
        userName = "testUser";
        nuggets = TestTools.generateNuggets();
        lesson = new Lesson();
        lesson.setName(lessonName);
        lesson.setNuggets(nuggets);
        questionList = Collections.singletonList(TestTools.generateQuestion());
    }

<commit_msg>Stop forgetting to run the tests just because it works<commit_after>package se.kits.gakusei.controller;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import se.kits.gakusei.content.model.Lesson;
import se.kits.gakusei.content.model.Nugget;
import se.kits.gakusei.content.repository.LessonRepository;
import se.kits.gakusei.content.repository.UserLessonRepository;
import se.kits.gakusei.test_tools.TestTools;
import se.kits.gakusei.util.ProgressHandler;
import se.kits.gakusei.util.QuestionHandler;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;

@RunWith(MockitoJUnitRunner.class)
public class QuestionControllerTest {

    @InjectMocks
    private QuestionController questionController;

    @Mock
    private QuestionHandler questionHandler;

    @Mock
    private LessonRepository lessonRepository;

    @Mock
    private UserLessonRepository userLessonRepository;

    @Mock
    private ProgressHandler progressHandler;

    @Value("${gakusei.questions-quantity}")
    private int quantity;

    private String questionType;
    private String answerType;
    private String lessonName;
    private String userName;
    private List<Nugget> nuggets;
    private Lesson lesson;
    private List<HashMap<String, Object>> questionList;

    @Before
    public void setUp() throws Exception {
        questionController = new QuestionController(lessonRepository, questionHandler, userLessonRepository, progressHandler);
        MockitoAnnotations.initMocks(this);
        questionType = "reading";
        answerType = "swedish";
        lessonName = "Verbs";
        userName = "testUser";
        nuggets = TestTools.generateNuggets();
        lesson = new Lesson();
        lesson.setName(lessonName);
        lesson.setNuggets(nuggets);
        questionList = Collections.singletonList(TestTools.generateQuestion());
    }


{'fraction_non_alphanumeric': 0.08879687140556705, 'fraction_numerical': 0.0, 'mean_word_length': 4.381188118811881, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '17054', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1266, 'n_words': 256}