<commit_before>package se.jaitco.queueticketapi.controller;

import org.junit.Before;
import org.junit.Test;
import org.mockito.*;
import se.jaitco.queueticketapi.model.Ticket;
import se.jaitco.queueticketapi.model.TicketStatus;
import se.jaitco.queueticketapi.service.TicketService;

import java.util.Optional;

public class TicketControllerTest {

    @InjectMocks
    private final TicketController classUnderTest = new TicketController();

    @Mock
    private TicketService ticketService;

    @Before
    public void setup() {
        MockitoAnnotations.initMocks(this);
    }

    @Test
    public void testNewTicket() {
        classUnderTest.newTicket();

        Mockito.verify(ticketService, Mockito.times(1)).newTicket();
    }

    @Test
    public void testResetTickets() {
        classUnderTest.newTicket();

        Mockito.verify(ticketService, Mockito.times(1)).newTicket();
    }

    @Test
    public void testNextTicket() {
        classUnderTest.nextTicket();

        Mockito.verify(ticketService, Mockito.times(1)).nextTicket();
    }

    @Test
    public void testCurrentTicket() {
        Mockito.when(ticketService.currentTicket()).thenReturn(Optional.of(new Ticket()));
        classUnderTest.currentTicket();

        Mockito.verify(ticketService, Mockito.times(1)).currentTicket();
    }

    @Test(expected = TicketController.NotFoundException.class)
    public void testCurrentTicketNotFound() {
        Mockito.when(ticketService.currentTicket()).thenReturn(Optional.empty());
        classUnderTest.currentTicket();
    }

    @Test
    public void testTicketStatus() {
        Mockito.when(ticketService.ticketStatus(Matchers.anyLong()))
                .thenReturn(Optional.of(TicketStatus.builder().build()));

        final long ticketNumber = 10L;
        classUnderTest.ticketStatus(ticketNumber);<commit_msg>resettickets in unittests<commit_after>package se.jaitco.queueticketapi.controller;

import org.junit.Before;
import org.junit.Test;
import org.mockito.*;
import se.jaitco.queueticketapi.model.Ticket;
import se.jaitco.queueticketapi.model.TicketStatus;
import se.jaitco.queueticketapi.service.TicketService;

import java.util.Optional;

public class TicketControllerTest {

    @InjectMocks
    private final TicketController classUnderTest = new TicketController();

    @Mock
    private TicketService ticketService;

    @Before
    public void setup() {
        MockitoAnnotations.initMocks(this);
    }

    @Test
    public void testNewTicket() {
        classUnderTest.newTicket();

        Mockito.verify(ticketService, Mockito.times(1)).newTicket();
    }

    @Test
    public void testResetTickets() {
        classUnderTest.resetTickets();

        Mockito.verify(ticketService, Mockito.times(1)).resetTickets();
    }

    @Test
    public void testNextTicket() {
        classUnderTest.nextTicket();

        Mockito.verify(ticketService, Mockito.times(1)).nextTicket();
    }

    @Test
    public void testCurrentTicket() {
        Mockito.when(ticketService.currentTicket()).thenReturn(Optional.of(new Ticket()));
        classUnderTest.currentTicket();

        Mockito.verify(ticketService, Mockito.times(1)).currentTicket();
    }

    @Test(expected = TicketController.NotFoundException.class)
    public void testCurrentTicketNotFound() {
        Mockito.when(ticketService.currentTicket()).thenReturn(Optional.empty());
        classUnderTest.currentTicket();
    }

    @Test
    public void testTicketStatus() {
        Mockito.when(ticketService.ticketStatus(Matchers.anyLong()))
                .thenReturn(Optional.of(TicketStatus.builder().build()));

        final long ticketNumber = 10L;
        classUnderTest.ticketStatus(ticketNumber);
{'fraction_non_alphanumeric': 0.11069317571198281, 'fraction_numerical': 0.0032240730789897904, 'mean_word_length': 3.5569155446756424, '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': '6746162', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1074, 'n_words': 167}