Tabnine Logo
RoutingService.getResponseDescriptorDTOAndRemove
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: epam/Wilma

@Override
public ResponseDescriptorDTO getResponseDescriptor(final String key) {
  return routingService.getResponseDescriptorDTOAndRemove(key);
}
origin: epam/Wilma

@Test
public void testGetResponseDescriptorDTOAndRemoveShouldReturnNullWhenKeyNotFound() {
  //GIVEN
  Map<String, ResponseDescriptor> responseDescriptorMap = new HashMap<>();
  String key = "key";
  Whitebox.setInternalState(underTest, "responseDescriptorMap", responseDescriptorMap);
  //WHEN
  ResponseDescriptorDTO actual = underTest.getResponseDescriptorDTOAndRemove(key);
  //THEN
  assertNull(actual);
}
origin: epam/Wilma

@Test
public void testGetResponseDescriptorShouldCallRoutingService() {
  //GIVEN
  String key = "key";
  //WHEN
  underTest.getResponseDescriptor(key);
  //THEN
  verify(routingService).getResponseDescriptorDTOAndRemove(key);
}
origin: epam/Wilma

@Test
public void testGetResponseDescriptorAndRemoveShouldReturnWithEntry() {
  //GIVEN
  Map<String, ResponseDescriptorDTO> responseDescriptorMap = new HashMap<>();
  String key = "key";
  ResponseDescriptorDTO expected = new ResponseDescriptorDTO(null, "", MSG_ID);
  responseDescriptorMap.put(key, expected);
  Whitebox.setInternalState(underTest, "responseDescriptorMap", responseDescriptorMap);
  //WHEN
  ResponseDescriptorDTO actual = underTest.getResponseDescriptorDTOAndRemove(key);
  //THEN
  assertEquals(actual, expected);
}
origin: epam/Wilma

@Test
public void testGetResponseDescriptorDTOAndRemoveShouldFindResponseDescriptorWithKey() {
  //GIVEN
  Map<String, ResponseDescriptorDTO> responseDescriptorMap = new HashMap<>();
  String key = "key";
  responseDescriptorMap.put(key, new ResponseDescriptorDTO(null, "", MSG_ID));
  Whitebox.setInternalState(underTest, "responseDescriptorMap", responseDescriptorMap);
  //WHEN
  ResponseDescriptorDTO actual = underTest.getResponseDescriptorDTOAndRemove(key);
  //THEN
  assertEquals(actual.getRequestBody(), MSG_ID);
}
origin: epam/Wilma

@Test
public void testGetResponseDescriptorAndRemoveShouldNotDeleteEntryWhenKeyNotFound() {
  //GIVEN
  Map<String, ResponseDescriptorDTO> responseDescriptorMap = new HashMap<>();
  String key = "key";
  responseDescriptorMap.put("someOtherKey", new ResponseDescriptorDTO(null, "", MSG_ID));
  Whitebox.setInternalState(underTest, "responseDescriptorMap", responseDescriptorMap);
  //WHEN
  underTest.getResponseDescriptorDTOAndRemove(key);
  //THEN
  @SuppressWarnings("unchecked")
  Map<String, ResponseDescriptorDTO> newDescriptorMap = (Map<String, ResponseDescriptorDTO>) Whitebox.getInternalState(underTest,
      "responseDescriptorMap");
  assertEquals(newDescriptorMap.get("someOtherKey").getRequestBody(), MSG_ID);
}
com.epam.wilma.routerRoutingServicegetResponseDescriptorDTOAndRemove

Javadoc

Reads a value matched to a key from the response descriptor map and if the value is found it deletes it from the map in order to free the map from it.

Popular methods of RoutingService

  • performModification
    This method execute the given command. The given command is any operation which works with the stubD
  • getStubDescriptors
  • 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

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • 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