package com.github.vlsidlyarevich.unity.service;

import com.github.vlsidlyarevich.unity.Application;
import com.github.vlsidlyarevich.unity.models.WorkerProfile;
import com.github.vlsidlyarevich.unity.utils.TestUtils;
import org.junit.Assert;
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 org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import java.util.List;

/**
 * Created by vlad on 02.10.16.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@SpringApplicationConfiguration(Application.class)
public class WorkerProfileSearchServiceTest {

    @Autowired
    private WorkerProfileSearchService workerProfileSearchService;

    @Autowired
    private WorkerProfileService workerProfileService;

    @Test
    public void findByFiltersTest() {
        WorkerProfile workerProfile = TestUtils.generateWorkerProfile();
        workerProfileService.save(workerProfile);

        MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
        map.add("firstname", workerProfile.getName().getFirstName());
        map.add("skype", workerProfile.getSkype());
        List<WorkerProfile> workerProfiles = workerProfileSearchService.findByFilters(map);
        Assert.assertEquals(workerProfile, workerProfiles.get(0));
    }
}

@@ -663,16 +663,42 @@
 ueMap;%0A%0A
+import java.util.HashMap;%0A
 import j
@@ -1246,26 +1246,20 @@
         
-MultiValue
+Hash
 Map%3CStri
@@ -1280,32 +1280,20 @@
 p = new 
-LinkedMultiValue
+Hash
 Map%3C%3E();
@@ -1305,19 +1305,19 @@
     map.
-add
+put
 (%22firstn
@@ -1379,11 +1379,11 @@
 map.
-add
+put
 (%22sk

Fix tests for search service