Java Code Examples for com.netflix.zuul.monitoring.MonitoringHelper

The following examples show how to use com.netflix.zuul.monitoring.MonitoringHelper. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: pig   Source File: GroovyLoadInitListener.java    License: MIT License 5 votes vote down vote up
@EventListener(value = {EmbeddedServletContainerInitializedEvent.class})
public void init() {
    MonitoringHelper.initMocks();
    FilterLoader.getInstance().setCompiler(new GroovyCompiler());
    FilterFileManager.setFilenameFilter(new GroovyFileFilter());
    try {
        FilterFileManager.init(10, groovyPath);
    } catch (Exception e) {
        log.error("初始化网关Groovy 文件失败 {}", e);
    }
    log.warn("初始化网关Groovy 文件成功");
}
 
Example 2
@BeforeAll
public static void setup() {
    MonitoringHelper.initMocks();
    BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(10);
    UserDetailsService userDetailsService = new InMemoryUserDetailsService(encoder);
    AuthenticationService authenticationService = mock(AuthenticationService.class);
    dummyAuthenticationProvider = new DummyAuthenticationProvider(encoder, userDetailsService, authenticationService);
}
 
Example 3
@Override
public void run(String... args) throws Exception {
  MonitoringHelper.initMocks();
  FilterLoader.getInstance().setCompiler(new GroovyCompiler());
  try {
    FilterFileManager.setFilenameFilter(new GroovyFileFilter());

    String basePath = "D:/写书/code/microservice-gateway-zuul-filter-groovy/src/main/filters/";

    FilterFileManager.init(1, basePath + "pre", basePath + "post");
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
Example 4
@Override
public void run(String... args) throws Exception {
  MonitoringHelper.initMocks();
  FilterLoader.getInstance().setCompiler(new GroovyCompiler());
  try {
    FilterFileManager.setFilenameFilter(new GroovyFileFilter());

    String basePath = "D:/写书/code/microservice-gateway-zuul-filter-groovy/src/main/filters/";

    FilterFileManager.init(1, basePath + "pre", basePath + "post");
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
Example 5
@BeforeAll
public static void setup() {
    MonitoringHelper.initMocks();
    encoder = Mockito.mock(BCryptPasswordEncoder.class);
    inMemoryUserDetailsService = new InMemoryUserDetailsService(encoder);
}
 
Example 6
Source Project: api-layer   Source File: TlsErrorCheckTest.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@BeforeAll
public static void setup() {
    MonitoringHelper.initMocks();
    MessageService messageService = new YamlMessageService();
    errorController = new InternalServerErrorController(messageService);
}
 
Example 7
Source Project: api-layer   Source File: TimeoutErrorCheckTest.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@BeforeClass
public static void setup() {
    MonitoringHelper.initMocks();
    MessageService messageService = new YamlMessageService();
    errorController = new InternalServerErrorController(messageService);
}
 
Example 8
@BeforeAll
public static void initMocks() {
    MonitoringHelper.initMocks();
}
 
Example 9
@BeforeAll
public static void setupAll() {
    MonitoringHelper.initMocks();
}
 
Example 10
@BeforeEach
public void prepareCheckUnderTest() {
    MonitoringHelper.initMocks();
    underTest = new ServiceNotFoundCheck(new YamlMessageService());
}
 
Example 11
@BeforeEach
public void prepareFilterUnderTest() {
    provider = Mockito.mock(RequestContextProvider.class);
    underTest = new ServiceNotFoundFilter(provider);
    MonitoringHelper.initMocks();
}