package org.xcolab.service.members.domain.member;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDatabaseConnection;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.xcolab.model.tables.pojos.User;
import org.xcolab.service.utils.PaginationHelper;

import java.util.List;

import static org.junit.Assert.assertEquals;

@RunWith(SpringJUnit4ClassRunner.class)
@DataJpaTest
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.H2)
@ComponentScan("org.xcolab.service.members")
@ActiveProfiles("test")
public class UserDaoTest {

    @Autowired
    private UserDao memberDao;

    @Test
    public void testFindByGiven__shouldReturnRightCount() {
        final List<User> members =
                memberDao.findByGiven(PaginationHelper.EVERYTHING, null, null,
                        null, null, null, null, null, null, null, null);
        assertEquals("Wrong number of members", 2, members.size());
    }

    @Test
    public void testFindByNameGiven() {
        final List<User> members =
                memberDao.findByGiven(PaginationHelper.EVERYTHING, "admin", null,
                        null, null, null, null, null, null, null, null);
        assertEquals("Wrong number of members with name:admin", 1, members.size());
    }

    @Test
    public void testFindByNameGiven_with_roles() {
        final List<User> members =
                memberDao.findByGiven(PaginationHelper.EVERYTHING, null, null,
                        "Member", null, null, null, null, null, null, null);
        assertEquals("Wrong number of members with role:User", 2, members.size());
    }
}

@@ -163,16 +163,87 @@
 owired;%0A
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;%0A
 import o
@@ -309,24 +309,24 @@
 Connection;%0A
-
 import org.s
@@ -464,24 +464,258 @@
 ataJpaTest;%0A
+import org.springframework.cloud.netflix.feign.FeignAutoConfiguration;%0Aimport org.springframework.cloud.netflix.feign.ribbon.FeignRibbonClientAutoConfiguration;%0Aimport org.springframework.cloud.netflix.ribbon.RibbonAutoConfiguration;%0A
 import org.s
@@ -1225,16 +1225,16 @@
 mbers%22)%0A
-
 @ActiveP
@@ -1249,16 +1249,146 @@
 %22test%22)%0A
+@ImportAutoConfiguration(%7BRibbonAutoConfiguration.class, FeignRibbonClientAutoConfiguration.class, FeignAutoConfiguration.class%7D)%0A
 public c

add annotations to auto-configure FeignContext