// Path: the-mathmos-server/src/main/java/com/digirati/themathmos/model/ServiceResponse.java
// public class ServiceResponse<T> implements Serializable{
// 
//     /**
//      *
//      */
//     private static final long serialVersionUID = 8231671973667011469L;
// 
//     public enum Status {
//         OK, NOT_FOUND, CACHE_KEY_MISS, ILLEGAL_MODIFICATION, NON_CONFORMANT
//     }
// 
//     private final Status status;
//     private final transient T obj;
// 
//     public ServiceResponse(Status status, T obj) {
//         this.status = status;
//         this.obj = obj;
//     }
// 
//     public Status getStatus() {
//         return status;
//     }
// 
//     public T getObj() {
//         return obj;
//     }
// }
// 
// Path: the-mathmos-server/src/main/java/com/digirati/themathmos/model/ServiceResponse.java
// public enum Status {
//     OK, NOT_FOUND, CACHE_KEY_MISS, ILLEGAL_MODIFICATION, NON_CONFORMANT
// }
// 
// Path: the-mathmos-server/src/main/java/com/digirati/themathmos/service/GetPayloadService.java
// public interface GetPayloadService {
// 
//     public String getJsonPayload(String url, String payload);
// 
// }


import static org.junit.Assert.*;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.Fields;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ListenableActionFuture;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.termvectors.MultiTermVectorsItemResponse;
import org.elasticsearch.action.termvectors.MultiTermVectorsResponse;
import org.elasticsearch.action.termvectors.TermVectorsRequest.Flag;
import org.elasticsearch.action.termvectors.TermVectorsResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHitField;
import org.elasticsearch.search.SearchHits;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import com.digirati.themathmos.model.ServiceResponse;
import com.digirati.themathmos.model.ServiceResponse.Status;
import com.digirati.themathmos.service.GetPayloadService;
import com.google.common.collect.Iterators;
package com.digirati.themathmos.service.impl;








@RunWith(com.carrotsearch.randomizedtesting.RandomizedRunner.class)
public class TextSearchServiceImplTest {

    private static final Logger LOG = Logger.getLogger(TextSearchServiceImplTest.class);

    TextSearchServiceImpl textSearchServiceImpl;
    private ElasticsearchTemplate template;
    Client client;
    private TextUtils textUtils;
    String url = "";
// Path: the-mathmos-server/src/main/java/com/digirati/themathmos/model/ServiceResponse.java
// public class ServiceResponse<T> implements Serializable{
// 
//     /**
//      *
//      */
//     private static final long serialVersionUID = 8231671973667011469L;
// 
//     public enum Status {
//         OK, NOT_FOUND, CACHE_KEY_MISS, ILLEGAL_MODIFICATION, NON_CONFORMANT
//     }
// 
//     private final Status status;
//     private final transient T obj;
// 
//     public ServiceResponse(Status status, T obj) {
//         this.status = status;
//         this.obj = obj;
//     }
// 
//     public Status getStatus() {
//         return status;
//     }
// 
//     public T getObj() {
//         return obj;
//     }
// }
// 
// Path: the-mathmos-server/src/main/java/com/digirati/themathmos/model/ServiceResponse.java
// public enum Status {
//     OK, NOT_FOUND, CACHE_KEY_MISS, ILLEGAL_MODIFICATION, NON_CONFORMANT
// }
// 
// Path: the-mathmos-server/src/main/java/com/digirati/themathmos/service/GetPayloadService.java
// public interface GetPayloadService {
// 
//     public String getJsonPayload(String url, String payload);
// 
// }


// Path: the-mathmos-server/src/test/java/com/digirati/themathmos/service/impl/TextSearchServiceImplTest.java
import static org.junit.Assert.*;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.Fields;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ListenableActionFuture;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.termvectors.MultiTermVectorsItemResponse;
import org.elasticsearch.action.termvectors.MultiTermVectorsResponse;
import org.elasticsearch.action.termvectors.TermVectorsRequest.Flag;
import org.elasticsearch.action.termvectors.TermVectorsResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHitField;
import org.elasticsearch.search.SearchHits;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import com.digirati.themathmos.model.ServiceResponse;
import com.digirati.themathmos.model.ServiceResponse.Status;
import com.digirati.themathmos.service.GetPayloadService;
import com.google.common.collect.Iterators;

package com.digirati.themathmos.service.impl;








@RunWith(com.carrotsearch.randomizedtesting.RandomizedRunner.class)
public class TextSearchServiceImplTest {

    private static final Logger LOG = Logger.getLogger(TextSearchServiceImplTest.class);

    TextSearchServiceImpl textSearchServiceImpl;
    private ElasticsearchTemplate template;
    Client client;
    private TextUtils textUtils;
    String url = "";
    private GetPayloadService coordinateService;