AbstractReplacement { protected List<ReplaceEntity> getReplacementsInRequestData(ScriptStep step, String searchQuery, String replaceString, Set<RequestData> requestDatas, SearchMode searchMode) { List<ReplaceEntity> reList = new ArrayList<ReplaceEntity>(); for (RequestData requestData : requestDatas) { if (searchMode == SearchMode.all) { reList.addAll(getReplacementInValue(searchQuery, replaceString, requestData.getValue(), step.getType(), requestData.getKey())); reList.addAll(getReplacementInKey(searchQuery, replaceString, requestData.getValue(), step.getType(), requestData.getKey())); } else if (searchMode == SearchMode.keyOnly) { reList.addAll(getReplacementInKey(searchQuery, replaceString, requestData.getValue(), step.getType(), requestData.getKey())); } else if (searchMode == SearchMode.valueOnly) { reList.addAll(getReplacementInValue(searchQuery, replaceString, requestData.getValue(), step.getType(), requestData.getKey())); } } return reList; } protected  AbstractReplacement(Section section, String type); String getType(); void setType(String type); Section getSection(); void setSection(Section section); abstract List<ReplaceEntity> getReplacements(ScriptStep step, String searchQuery, String replaceString,
            SearchMode searchMode); abstract void replace(ScriptStep step, String replaceString, String key, ReplaceMode replaceMode);  }
@Test public void testGetReplacementsInRequestData_1() throws Exception { AbstractReplacement fixture = new HostReplacement(); ScriptStep step = new ScriptStep(); String searchQuery = ""; String replaceString = ""; Set<RequestData> requestDatas = new HashSet(); SearchMode searchMode = SearchMode.all; List<ReplaceEntity> result = fixture.getReplacementsInRequestData(step, searchQuery, replaceString, requestDatas, searchMode); assertNotNull(result); assertEquals(0, result.size()); }
@Test public void testGetReplacementsInRequestData_2() throws Exception { AbstractReplacement fixture = new HostReplacement(); ScriptStep step = new ScriptStep(); String searchQuery = ""; String replaceString = ""; Set<RequestData> requestDatas = new HashSet(); SearchMode searchMode = SearchMode.all; List<ReplaceEntity> result = fixture.getReplacementsInRequestData(step, searchQuery, replaceString, requestDatas, searchMode); assertNotNull(result); assertEquals(0, result.size()); }
@Test public void testGetReplacementsInRequestData_3() throws Exception { AbstractReplacement fixture = new HostReplacement(); ScriptStep step = new ScriptStep(); String searchQuery = ""; String replaceString = ""; Set<RequestData> requestDatas = new HashSet(); SearchMode searchMode = SearchMode.all; List<ReplaceEntity> result = fixture.getReplacementsInRequestData(step, searchQuery, replaceString, requestDatas, searchMode); assertNotNull(result); assertEquals(0, result.size()); }
@Test public void testGetReplacementsInRequestData_4() throws Exception { AbstractReplacement fixture = new HostReplacement(); ScriptStep step = new ScriptStep(); String searchQuery = ""; String replaceString = ""; Set<RequestData> requestDatas = new HashSet(); SearchMode searchMode = SearchMode.all; List<ReplaceEntity> result = fixture.getReplacementsInRequestData(step, searchQuery, replaceString, requestDatas, searchMode); assertNotNull(result); assertEquals(0, result.size()); }
@Test public void testGetReplacementsInRequestData_5() throws Exception { AbstractReplacement fixture = new HostReplacement(); ScriptStep step = new ScriptStep(); String searchQuery = ""; String replaceString = ""; Set<RequestData> requestDatas = new HashSet(); SearchMode searchMode = SearchMode.all; List<ReplaceEntity> result = fixture.getReplacementsInRequestData(step, searchQuery, replaceString, requestDatas, searchMode); assertNotNull(result); assertEquals(0, result.size()); }