InternalSearch extends BusinessObject { @Override void setParams() { tracker.setParam(Hit.HitParam.InternalSearchKeyword.stringValue(), keyword == null ? "" : keyword, new ParamOption().setEncode(true)) .setParam(Hit.HitParam.InternalSearchResultScreenNumber.stringValue(), resultScreenNumber); if (resultPosition > -1) { tracker.setParam(Hit.HitParam.InternalSearchResultPosition.stringValue(), resultPosition); } } InternalSearch(Tracker tracker); String getKeyword(); int getResultScreenNumber(); int getResultPosition(); InternalSearch setKeyword(String keyword); InternalSearch setResultScreenNumber(int resultScreenNumber); InternalSearch setResultPosition(int resultPosition);  }
@Test public void setParamsTest() { internalSearch.setKeyword("search").setResultScreenNumber(3).setParams(); assertEquals(2, buffer.getVolatileParams().size()); assertEquals(0, buffer.getPersistentParams().size()); assertEquals(1, buffer.getVolatileParams().get("mc").getValues().size()); assertEquals("search", buffer.getVolatileParams().get("mc").getValues().get(0).execute()); assertEquals(1, buffer.getVolatileParams().get("np").getValues().size()); assertEquals("3", buffer.getVolatileParams().get("np").getValues().get(0).execute()); }