Tabnine Logo
InjectMockResourceFactory.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.linkedin.restli.server.mock.InjectMockResourceFactory
constructor

Best Java code snippets using com.linkedin.restli.server.mock.InjectMockResourceFactory.<init> (Showing top 5 results out of 315)

origin: apache/incubator-gobblin

@Override
protected void startUp()
  throws Exception {
 // Server configuration
 RestLiConfig config = new RestLiConfig();
 config.addResourcePackageNames(JobExecutionInfoResource.class.getPackage().getName());
 config.setServerNodeUri(serverUri);
 config.setDocumentationRequestHandler(new DefaultDocumentationRequestHandler());
 // Handle dependency injection
 Injector injector = Guice.createInjector(new MetaStoreModule(properties));
 JobHistoryStore jobHistoryStore = injector.getInstance(JobHistoryStore.class);
 SimpleBeanProvider beanProvider = new SimpleBeanProvider();
 beanProvider.add("jobHistoryStore", jobHistoryStore);
 // Use InjectMockResourceFactory to keep this Spring free
 ResourceFactory factory = new InjectMockResourceFactory(beanProvider);
 // Create and start the HTTP server
 TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config, factory));
 String acceptedFilters = EncodingType.SNAPPY.getHttpName() + "," + EncodingType.GZIP.getHttpName();
 FilterChain filterChain = FilterChains.createRestChain(new ServerCompressionFilter(acceptedFilters));
 this.httpServer = Optional.of(new HttpNettyServerFactory(filterChain).createServer(port, dispatcher));
 LOGGER.info("Starting the job execution information server");
 this.httpServer.get().start();
}
origin: com.linkedin.pegasus/restli-server-testutils

/**
 * Creates a {@link ResourceFactory} to inject dependencies into your Rest.li resource
 *
 * @param beans
 * @return
 */
private static ResourceFactory createResourceFactory(Map<String, ?> beans)
{
 SimpleBeanProvider beanProvider = new SimpleBeanProvider();
 for (Map.Entry<String, ?> entry: beans.entrySet())
 {
  beanProvider.add(entry.getKey(), entry.getValue());
 }
 return new InjectMockResourceFactory(beanProvider);
}
origin: com.linkedin.gobblin/gobblin-rest-server

@Override
protected void startUp()
  throws Exception {
 // Server configuration
 RestLiConfig config = new RestLiConfig();
 config.addResourcePackageNames(JobExecutionInfoResource.class.getPackage().getName());
 config.setServerNodeUri(serverUri);
 config.setDocumentationRequestHandler(new DefaultDocumentationRequestHandler());
 // Handle dependency injection
 Injector injector = Guice.createInjector(new MetaStoreModule(properties));
 JobHistoryStore jobHistoryStore = injector.getInstance(JobHistoryStore.class);
 SimpleBeanProvider beanProvider = new SimpleBeanProvider();
 beanProvider.add("jobHistoryStore", jobHistoryStore);
 // Use InjectMockResourceFactory to keep this Spring free
 ResourceFactory factory = new InjectMockResourceFactory(beanProvider);
 // Create and start the HTTP server
 TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config, factory));
 String acceptedFilters = EncodingType.SNAPPY.getHttpName() + "," + EncodingType.GZIP.getHttpName();
 FilterChain filterChain = FilterChains.createRestChain(new ServerCompressionFilter(acceptedFilters));
 this.httpServer = Optional.of(new HttpNettyServerFactory(filterChain).createServer(port, dispatcher));
 LOGGER.info("Starting the job execution information server");
 this.httpServer.get().start();
}
origin: org.apache.gobblin/gobblin-rest-server

@Override
protected void startUp()
  throws Exception {
 // Server configuration
 RestLiConfig config = new RestLiConfig();
 config.addResourcePackageNames(JobExecutionInfoResource.class.getPackage().getName());
 config.setServerNodeUri(serverUri);
 config.setDocumentationRequestHandler(new DefaultDocumentationRequestHandler());
 // Handle dependency injection
 Injector injector = Guice.createInjector(new MetaStoreModule(properties));
 JobHistoryStore jobHistoryStore = injector.getInstance(JobHistoryStore.class);
 SimpleBeanProvider beanProvider = new SimpleBeanProvider();
 beanProvider.add("jobHistoryStore", jobHistoryStore);
 // Use InjectMockResourceFactory to keep this Spring free
 ResourceFactory factory = new InjectMockResourceFactory(beanProvider);
 // Create and start the HTTP server
 TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config, factory));
 String acceptedFilters = EncodingType.SNAPPY.getHttpName() + "," + EncodingType.GZIP.getHttpName();
 FilterChain filterChain = FilterChains.createRestChain(new ServerCompressionFilter(acceptedFilters));
 this.httpServer = Optional.of(new HttpNettyServerFactory(filterChain).createServer(port, dispatcher));
 LOGGER.info("Starting the job execution information server");
 this.httpServer.get().start();
}
origin: com.linkedin.pegasus/restli-int-test-server

beanProvider.add("GroupsRestApplication", app);
ResourceFactory factory = new InjectMockResourceFactory(beanProvider);
com.linkedin.restli.server.mockInjectMockResourceFactory<init>

Popular methods of InjectMockResourceFactory

  • processChildResource

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now