com.netflix.zuul.scriptManager.ZuulFilterDAO.getZuulFiltersForFilterId()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中com.netflix.zuul.scriptManager.ZuulFilterDAO.getZuulFiltersForFilterId()方法的一些代码示例,展示了ZuulFilterDAO.getZuulFiltersForFilterId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZuulFilterDAO.getZuulFiltersForFilterId()方法的具体详情如下:
包路径:com.netflix.zuul.scriptManager.ZuulFilterDAO
类名称:ZuulFilterDAO
方法名:getZuulFiltersForFilterId

ZuulFilterDAO.getZuulFiltersForFilterId介绍

[英]returns all filter revisions for the given filter_id
[中]返回给定筛选器id的所有筛选器修订

代码示例

代码示例来源:origin: com.netflix.zuul/zuul-netflix

/**
 * Not found response for a "list scripts" request.
 *
 * @throws Exception
 */
@Test
public void testListScriptNotFound() throws Exception {
  /* setup mock request to return URI */
  when(request.getPathInfo()).thenReturn("?action=LIST&filter_id=name2:type");
  when(request.getParameter("action")).thenReturn("LIST");
  when(request.getParameter("filter_id")).thenReturn("name:type");
  when(request.getMethod()).thenReturn("GET");
  /* setup mock DAO */
  ZuulFilterDAO dao = mock(ZuulFilterDAOCassandra.class);
  List<FilterInfo> emptyResponse = Collections.emptyList();
  when(dao.getZuulFiltersForFilterId(anyString())).thenReturn(emptyResponse);
  /* construct servlet */
  FilterScriptManagerServlet servlet = getEndpointScriptManagerImplementation(dao);
  servlet.service(request, response);
  // verify that we get a 404 when this endpoint isn't found
  verify(response).setStatus(404);
}

代码示例来源:origin: com.netflix.zuul/zuul-core

/**
 * We don't want a NULL when an filter is not found, instead we want an empty list.
 */
@Test
public void testGetScriptForEndpointReturnsEmptyListInsteadOfNullWhenEndpointNotFound() {
  ZuulFilterDAO dao = new ZuulFilterDAOCassandra(gateway);
  // setup empty response
  when(gateway.select(anyString())).thenReturn(response);
  when(response.isEmpty()).thenReturn(true);
  List<FilterInfo> list = dao.getZuulFiltersForFilterId("/unknown/Filter");
  assertNotNull(list);
  assertEquals(0, list.size());
}

代码示例来源:origin: com.netflix.zuul/zuul-netflix

/**
 * We don't want a NULL when an filter is not found, instead we want an empty list.
 */
@Test
public void testGetScriptForEndpointReturnsEmptyListInsteadOfNullWhenEndpointNotFound() {
  ZuulFilterDAO dao = new ZuulFilterDAOCassandra(gateway);
  // setup empty response
  when(gateway.select(anyString())).thenReturn(response);
  when(response.isEmpty()).thenReturn(true);
  List<FilterInfo> list = dao.getZuulFiltersForFilterId("/unknown/Filter");
  assertNotNull(list);
  assertEquals(0, list.size());
}

代码示例来源:origin: com.netflix.zuul/zuul-netflix

scriptsForEndpoint.add(new FilterInfo("name2:type", "code", "type", "name", "disable", "order", "app"));
scriptsForEndpoint.add(new FilterInfo("name3:type", "code", "type", "name", "disable", "order", "app"));
when(dao.getZuulFiltersForFilterId(anyString())).thenReturn(scriptsForEndpoint);

代码示例来源:origin: com.netflix.zuul/zuul-netflix

} else {
  scripts = scriptDAO.getZuulFiltersForFilterId(filter_id);

代码示例来源:origin: com.netflix.zuul/zuul-core

List<FilterInfo> list = dao.getZuulFiltersForFilterId(filter);

代码示例来源:origin: com.netflix.zuul/zuul-netflix

List<FilterInfo> list = dao.getZuulFiltersForFilterId(filter);

相关文章