### Question:
PolicySummaryPresenter extends AbstractGenericPresenter { private void fetchPoliciesByName(String name, String type, String effect) { PolicyKey key = new PolicyKey(); key.setName(name); key.setType(type); QueryCondition condition = new QueryCondition(); if ("RL".equals(type) && effect != null) { condition.addQuery(new QueryCondition.Query(QueryCondition.EffectValue.valueOf(effect))); } condition.addQuery(new QueryCondition.Query(QueryCondition.ActivePoliciesOnlyValue.FALSE)); service.findPolicies(null, Collections.singletonList(key), null, null, null, null, null, condition, new AsyncCallback<GetPoliciesResponse>() { public void onFailure(Throwable arg) { if (arg.getLocalizedMessage().contains("500")) { view.error(PolicyAdminUIUtil.messages .serverError(PolicyAdminUIUtil.policyAdminConstants .genericErrorMessage())); } else { view.error(PolicyAdminUIUtil.messages.serverError(arg.getLocalizedMessage())); } } public void onSuccess(GetPoliciesResponse result) { PolicySummaryPresenter.this.policies = copyToWriteable(result.getPolicies()); PolicySummaryPresenter.this.view.setPolicies(policies); if(policies.isEmpty()){ view.info(PolicyAdminUIUtil.policyAdminConstants .noItemFoundMessage()); }else{ for (GenericPolicy p : policies){ fetchAccess(p); } } } }); } PolicySummaryPresenter(HandlerManager eventBus, PolicySummaryDisplay view,
                    Map<SupportedService, PolicyAdminUIService> serviceMap); String getId(); void bind(); @Override void go(HasWidgets container, final HistoryToken token); final static String PRESENTER_ID; }### Answer:
@Test public void testFetchPoliciesByName() { summaryPresenter = new PolicySummaryPresenter(this.eventBus, view, serviceMap); summaryPresenter.service = (PolicyQueryService) serviceMap.get(SupportedService.POLICY_QUERY_SERVICE); view.setPolicies((List<GenericPolicy>)EasyMock.anyObject()); AppUser user = AppUser.newAppUser("admin", "admin", ""); replay(view); GwtReflectionUtils.callPrivateMethod(summaryPresenter, "fetchPoliciesByName", "Policy_1", "BlackList", ""); assertEquals(1, summaryPresenter.policies.size()); assertEquals("Policy_1", summaryPresenter.policies.get(0).getName()); }