Mocking an enum using Mockito?
<p>I need to mock the following enum:</p>

<pre><code>public enum PersonStatus
{
    WORKING,
    HOLIDAY,
    SICK      
}
</code></pre>

<p>This is because it is used in the following class that I am testing:</p>

<p><strong>Class under test:</strong></p>

<pre><code>public interface PersonRepository extends CrudRepository&lt;Person, Integer&gt;
{
    List&lt;Person&gt; findByStatus(PersonStatus personStatus);
}
</code></pre>

<p>Here is my current test attempt:</p>

<p><strong>Current test:</strong></p>

<pre><code>public class PersonRepositoryTest {

    private final Logger LOGGER = LoggerFactory.getLogger(PersonRepositoryTest.class);

    //Mock the PersonRepository class
    @Mock
    private PersonRepository PersonRepository;

    @Mock
    private PersonStatus personStatus;

    @Before
    public void setUp() throws Exception {

        MockitoAnnotations.initMocks(this);
        assertThat(PersonRepository, notNullValue());
        assertThat(PersonStatus, notNullValue());
    }

    @Test
    public void testFindByStatus() throws ParseException {

        List&lt;Person&gt; personlist = PersonRepository.findByStatus(personStatus);
        assertThat(personlist, notNullValue());
    }
}
</code></pre>

<p>Which Gives following error:</p>

<p><strong>error:</strong></p>

<pre><code>org.mockito.exceptions.base.MockitoException: 
Cannot mock/spy class PersonStatus
Mockito cannot mock/spy following:
  - final classes
  - anonymous classes
  - primitive types
</code></pre>

<p>How can I solve this?</p>