package com.justjournal.repository;

import com.justjournal.ApplicationTest;
import com.justjournal.model.EntryTag;
import com.justjournal.model.Journal;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import static org.junit.Assert.assertNotNull;

/**
 * @author Lucas Holt
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ApplicationTest.class)
@WebAppConfiguration
public class JournalRepositoryTests {
    @Autowired
    private JournalRepository journalRepository;

    @Test
       public void list() throws Exception {
           final Iterable<Journal> list = journalRepository.findAll();
           assertNotNull(list);
       }

       @Test
       public void findByUsername() {
           final Iterable<Journal> list = journalRepository.findByUsername("testuser");
           assertNotNull(list);
       }
}

@@ -74,47 +74,8 @@
 st;%0A
-import com.justjournal.model.EntryTag;%0A
 impo
@@ -746,35 +746,32 @@
 %0A%0A    @Test%0A    
-   
 public void list
@@ -792,19 +792,16 @@
 ption %7B%0A
-   
         
@@ -860,35 +860,32 @@
 dAll();%0A        
-   
 assertNotNull(li
@@ -885,27 +885,24 @@
 Null(list);%0A
-   
     %7D%0A%0A     
@@ -900,28 +900,22 @@
  %7D%0A%0A    
-   
 @Test%0A
-   
     publ
@@ -941,19 +941,16 @@
 ame() %7B%0A
-   
         
@@ -1030,27 +1030,24 @@
 %22);%0A        
-  
- 
 assertNotNul
@@ -1054,20 +1054,174 @@
 l(list);%0A   
+ %7D%0A%0A    @Test%0A    public void findBySlug() %7B%0A        final Journal journal = journalRepository.findOneBySlug(%22testuser%22);%0A        assertNotNull(journal);%0A
     %7D%0A%7D%0A

add more tests