// Path: src/main/java/io/chucknorris/lib/exception/EntityNotFoundException.java
// @ResponseStatus(value = HttpStatus.NOT_FOUND)
// public class EntityNotFoundException extends RuntimeException {
// 
//   public EntityNotFoundException(String message) {
//     super(message);
//   }
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import io.chucknorris.lib.exception.EntityNotFoundException;
import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
    assertEquals("dev", categories[0]);
    assertEquals("animal", categories[1]);
    assertEquals(2, categories.length);

    verify(jokeRepository, times(1)).findAllCategories();
    verifyNoMoreInteractions(jokeRepository);
  }

  @Test
  public void testGetCategoryValues() {
    when(jokeRepository.findAllCategories()).thenReturn(new String[]{"dev", "animal"});

    String categoryValues = jokeController.getCategoryValues();
    assertEquals("dev\nanimal\n", categoryValues);

    verify(jokeRepository, times(1)).findAllCategories();
    verifyNoMoreInteractions(jokeRepository);
  }

  @Test
  public void testGetJokeReturnsJoke() {
    when(jokeRepository.findById(jokeId)).thenReturn(Optional.of(joke));

    Joke joke = jokeController.getJoke(jokeId);
    assertEquals(JokeControllerTest.joke, joke);

    verify(jokeRepository, times(1)).findById(jokeId);
    verifyNoMoreInteractions(jokeRepository);
  }

// Path: src/main/java/io/chucknorris/lib/exception/EntityNotFoundException.java
// @ResponseStatus(value = HttpStatus.NOT_FOUND)
// public class EntityNotFoundException extends RuntimeException {
// 
//   public EntityNotFoundException(String message) {
//     super(message);
//   }
// }


// Path: src/test/java/io/chucknorris/api/joke/JokeControllerTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import io.chucknorris.lib.exception.EntityNotFoundException;
import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.web.servlet.ModelAndView;

    assertEquals("dev", categories[0]);
    assertEquals("animal", categories[1]);
    assertEquals(2, categories.length);

    verify(jokeRepository, times(1)).findAllCategories();
    verifyNoMoreInteractions(jokeRepository);
  }

  @Test
  public void testGetCategoryValues() {
    when(jokeRepository.findAllCategories()).thenReturn(new String[]{"dev", "animal"});

    String categoryValues = jokeController.getCategoryValues();
    assertEquals("dev\nanimal\n", categoryValues);

    verify(jokeRepository, times(1)).findAllCategories();
    verifyNoMoreInteractions(jokeRepository);
  }

  @Test
  public void testGetJokeReturnsJoke() {
    when(jokeRepository.findById(jokeId)).thenReturn(Optional.of(joke));

    Joke joke = jokeController.getJoke(jokeId);
    assertEquals(JokeControllerTest.joke, joke);

    verify(jokeRepository, times(1)).findById(jokeId);
    verifyNoMoreInteractions(jokeRepository);
  }

  @Test(expected = EntityNotFoundException.class)