congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RoutingService.getStubDescriptors
Code IndexAdd Tabnine to your IDE (free)

How to use
getStubDescriptors
method
in
com.epam.wilma.router.RoutingService

Best Java code snippets using com.epam.wilma.router.RoutingService.getStubDescriptors (Showing top 11 results out of 315)

origin: epam/Wilma

@Override
protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
  response.setContentType("application/json");
  PrintWriter out = response.getWriter();
  Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors();
  writeAllDialogDescriptors(out, stubDescriptors);
  out.flush();
  out.close();
}
origin: epam/Wilma

@Override
public void process(final WilmaHttpEntity entity) throws ApplicationException {
  Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors();
  for (String groupName : stubDescriptors.keySet()) {
    StubDescriptor stubDescriptor = stubDescriptors.get(groupName);
    List<InterceptorDescriptor> interceptorDescriptors = stubDescriptor.getInterceptorDescriptors();
    for (InterceptorDescriptor interceptorDescriptor : interceptorDescriptors) {
      ResponseInterceptor interceptor = interceptorDescriptor.getResponseInterceptor();
      callInterceptor(interceptor, entity, interceptorDescriptor);
    }
  }
}
origin: epam/Wilma

/**
 * This method deletes all old files from the cache folder.
 * Then it gets all stub descriptors from {@link RoutingService} and call {@link StubConfigurationSaver} to save all of the descriptors.
 * @throws JsonTransformationException is thrown when a document can not be written
 */
public void saveStubConfigurations() throws JsonTransformationException {
  cleaner.cleanCache();
  Map<String, StubDescriptor> descriptors = routingService.getStubDescriptors();
  saver.saveAllStubConfigurations(descriptors);
}
origin: epam/Wilma

@Override
public void process(final WilmaHttpEntity entity) throws ApplicationException {
  Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors();
  for (String groupName : stubDescriptors.keySet()) {
    StubDescriptor stubDescriptor = stubDescriptors.get(groupName);
    List<InterceptorDescriptor> interceptorDescriptors = stubDescriptor.getInterceptorDescriptors();
    for (InterceptorDescriptor interceptorDescriptor : interceptorDescriptors) {
      RequestInterceptor interceptor = interceptorDescriptor.getRequestInterceptor();
      callInterceptor(interceptor, entity, interceptorDescriptor);
    }
  }
}
origin: epam/Wilma

Map<String, StubDescriptor> descriptors = routingService.getStubDescriptors();
for (String key : descriptors.keySet()) {
  StubDescriptor stubDescriptor = descriptors.get(key);
origin: epam/Wilma

@BeforeMethod
public void setUp() {
  MockitoAnnotations.initMocks(this);
  given(routingService.getStubDescriptors()).willReturn(descriptors);
}
origin: epam/Wilma

@Test
public void testProcessShouldCallAllResponseInterceptors() throws ApplicationException {
  //GIVEN
  Map<String, StubDescriptor> stubDescriptors = new LinkedHashMap<>();
  stubDescriptors.put("test", createStubDescriptor());
  given(routingService.getStubDescriptors()).willReturn(stubDescriptors);
  WilmaHttpEntity entity = new WilmaHttpResponse(isVolatile);
  //WHEN
  underTest.process(entity);
  //THEN
  BDDMockito.verify(responseInterceptor).onResponseReceive((WilmaHttpResponse) entity, PARAMS);
}
origin: epam/Wilma

@Test
public void testProcessShouldCallAllResponseInterceptors() throws ApplicationException {
  //GIVEN
  Map<String, StubDescriptor> stubDescriptors = new LinkedHashMap<>();
  stubDescriptors.put("test", createStubDescriptor());
  given(routingService.getStubDescriptors()).willReturn(stubDescriptors);
  WilmaHttpEntity entity = new WilmaHttpRequest();
  //WHEN
  underTest.process(entity);
  //THEN
  BDDMockito.verify(requestInterceptor).onRequestReceive((WilmaHttpRequest) entity, PARAMS);
}
origin: epam/Wilma

@Test
public void testProcessWhenThereAreNoInterceptorsShouldDoNothing() throws ApplicationException {
  //GIVEN
  Map<String, StubDescriptor> stubDescriptors = new LinkedHashMap<>();
  stubDescriptors.put("test", createStubDescriptorWithNoInterceptor());
  given(routingService.getStubDescriptors()).willReturn(stubDescriptors);
  WilmaHttpEntity entity = new WilmaHttpResponse(isVolatile);
  //WHEN
  underTest.process(entity);
  //THEN
  BDDMockito.verify(responseInterceptor, BDDMockito.never()).onResponseReceive((WilmaHttpResponse) entity, PARAMS);
}
origin: epam/Wilma

@Test
public void testProcessWhenThereAreNoInterceptorsShouldDoNothing() throws ApplicationException {
  //GIVEN
  Map<String, StubDescriptor> stubDescriptors = new LinkedHashMap<>();
  stubDescriptors.put("test", createStubDescriptorWithNoInterceptor());
  given(routingService.getStubDescriptors()).willReturn(stubDescriptors);
  WilmaHttpEntity entity = new WilmaHttpRequest();
  //WHEN
  underTest.process(entity);
  //THEN
  BDDMockito.verify(requestInterceptor, BDDMockito.never()).onRequestReceive((WilmaHttpRequest) entity, PARAMS);
}
origin: epam/Wilma

@BeforeMethod
public void setUp() throws IOException {
  MockitoAnnotations.initMocks(this);
  Whitebox.setInternalState(underTest, "routingService", routingService);
  Whitebox.setInternalState(underTest, "expirationTimeProvider", expirationTimeProvider);
  sequenceDescriptors = new ArrayList<>();
  dialogDescriptors = new ArrayList<>();
  interceptorDescriptors = new ArrayList<>();
  Map<String, StubDescriptor> stubDescriptors = new LinkedHashMap<>();
  stubDescriptors.put(TEST_GROUPNAME, stubDescriptor);
  Whitebox.setInternalState(routingService, "stubDescriptors", stubDescriptors);
  given(routingService.getStubDescriptors()).willReturn(stubDescriptors);
  given(stubDescriptor.getAttributes()).willReturn(stubDescriptorAttributes);
  given(stubDescriptor.getDialogDescriptors()).willReturn(dialogDescriptors);
  given(stubDescriptor.getSequenceDescriptors()).willReturn(sequenceDescriptors);
  given(stubDescriptor.getInterceptorDescriptors()).willReturn(interceptorDescriptors);
  given(response.getWriter()).willReturn(out);
  Whitebox.setInternalState(stubDescriptor, "attributes", stubDescriptorAttributes);
}
com.epam.wilma.routerRoutingServicegetStubDescriptors

Popular methods of RoutingService

  • performModification
    This method execute the given command. The given command is any operation which works with the stubD
  • getResponseDescriptorDTOAndRemove
    Reads a value matched to a key from the response descriptor map and if the value is found it deletes
  • setOperationMode
    Sets the new operation mode.
  • isStubModeOn
  • redirectRequestToStub
    Redirects requests based on their content. If a request needs to be redirected to the stub, it will
  • getOperationMode
  • saveInResponseDescriptorMap

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • BoxLayout (javax.swing)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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