@@ -0,0 +1,2140 @@
+/*%0A * WordGridController.java%0A *%0A * Copyright (C) 2018 %5B A Legge Up %5D%0A *%0A * This software may be modified and distributed under the terms%0A * of the MIT license.  See the LICENSE file for details.%0A */%0A%0Apackage com.aleggeup.confagrid.controller;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0A%0Aimport com.aleggeup.confagrid.model.WordGrid;%0Aimport com.aleggeup.confagrid.repository.WordGridRepository;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class WordGridControllerTest %7B%0A%0A    @Mock%0A    private WordGridRepository mockWordGridRepository;%0A%0A    private WordGridController wordGridController;%0A%0A    @Before%0A    public void setUp() %7B%0A        wordGridController = new WordGridController(mockWordGridRepository);%0A    %7D%0A%0A    @After%0A    public void tearDown() %7B%0A        Mockito.verifyNoMoreInteractions(mockWordGridRepository);%0A    %7D%0A%0A    @Test%0A    public void testGetAllEmpty() %7B%0A        final Iterable%3CWordGrid%3E iterable = new ArrayList%3C%3E();%0A        Mockito.when(mockWordGridRepository.findAll()).thenReturn(iterable);%0A        final List%3CWordGrid%3E allwordGrids = wordGridController.allWordGrids();%0A        assertEquals(0, allwordGrids.size());%0A        Mockito.verify(mockWordGridRepository).findAll();%0A    %7D%0A%0A    @Test%0A    public void testGetAll() %7B%0A        final List%3CWordGrid%3E iterable = new ArrayList%3C%3E();%0A        iterable.add(new WordGrid());%0A        Mockito.when(mockWordGridRepository.findAll()).thenReturn(iterable);%0A        final List%3CWordGrid%3E allwordGrids = wordGridController.allWordGrids();%0A        assertEquals(1, allwordGrids.size());%0A        Mockito.verify(mockWordGridRepository).findAll();%0A    %7D%0A%0A    @Test%0A    public void testCreate() %7B%0A        final WordGrid wordGrid = new WordGrid();%0A        final List%3CWordGrid%3E result = wordGridController.create(wordGrid);%0A        assertEquals(1, result.size());%0A        Mockito.verify(mockWordGridRepository).save(wordGrid);%0A    %7D%0A%7D%0A

Add test for WordGridController