@Test public void testCircuitClosing() { doAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { ((Runnable) invocation.getArguments()[0]).run(); return null; } }).when(scheduler) .schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); webHookDispatcherResource.handleConnectivityException(mock(ConnectivityException.class)); mockConfiguration(true); mockStatus(IntegrationStatus.ACTIVE); mockRequest(); assertEquals(ResponseEntity.ok().build(), webHookDispatcherResource.handleHeadRequest(TEST_HASH, CONFIGURATION_ID, TEST_USER)); }
@RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", method = RequestMethod.HEAD) public ResponseEntity<Void> handleHeadRequest(@PathVariable String hash, @PathVariable String configurationId, @PathVariable String configurationType) { return handleHeadRequest(hash, configurationId); }
WebHookDispatcherResource extends WebHookResource { @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", method = RequestMethod.HEAD) public ResponseEntity<Void> handleHeadRequest(@PathVariable String hash, @PathVariable String configurationId, @PathVariable String configurationType) { return handleHeadRequest(hash, configurationId); } }
WebHookDispatcherResource extends WebHookResource { @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", method = RequestMethod.HEAD) public ResponseEntity<Void> handleHeadRequest(@PathVariable String hash, @PathVariable String configurationId, @PathVariable String configurationType) { return handleHeadRequest(hash, configurationId); }  }
WebHookDispatcherResource extends WebHookResource { @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", method = RequestMethod.HEAD) public ResponseEntity<Void> handleHeadRequest(@PathVariable String hash, @PathVariable String configurationId, @PathVariable String configurationType) { return handleHeadRequest(hash, configurationId); }  @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleFormRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType,
      HttpServletRequest request); @RequestMapping(value = "/{configurationId}/{hash}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleFormRequest(@PathVariable String hash,
      @PathVariable String configurationId, HttpServletRequest request); @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", consumes = MediaType.ALL_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType,
      @RequestBody String body, HttpServletRequest request); @RequestMapping(value = "/{configurationId}/{hash}", consumes = MediaType.ALL_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleRequest(@PathVariable String hash,
      @PathVariable String configurationId, @RequestBody String body, HttpServletRequest request); @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", method = RequestMethod.HEAD) ResponseEntity<Void> handleHeadRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType); @RequestMapping(value = "/{configurationId}/{hash}", method = RequestMethod.HEAD) ResponseEntity<Void> handleHeadRequest(@PathVariable String hash,
      @PathVariable String configurationId); @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleMultiPartFormDataRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType,
      @RequestPart(value = "message") String message,
      @RequestPart(value = "data", required = false) String data, HttpServletRequest request); @RequestMapping(value = "/{configurationId}/{hash}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleMultiPartFormDataRequest(@PathVariable String hash,
      @PathVariable String configurationId, @RequestPart(value = "message") String message,
      @RequestPart(value = "data", required = false) String data, HttpServletRequest request); @ExceptionHandler(RemoteApiException.class) ResponseEntity<String> handleRemoteApiException(RemoteApiException e); }
WebHookDispatcherResource extends WebHookResource { @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", method = RequestMethod.HEAD) public ResponseEntity<Void> handleHeadRequest(@PathVariable String hash, @PathVariable String configurationId, @PathVariable String configurationType) { return handleHeadRequest(hash, configurationId); }  @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleFormRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType,
      HttpServletRequest request); @RequestMapping(value = "/{configurationId}/{hash}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleFormRequest(@PathVariable String hash,
      @PathVariable String configurationId, HttpServletRequest request); @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", consumes = MediaType.ALL_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType,
      @RequestBody String body, HttpServletRequest request); @RequestMapping(value = "/{configurationId}/{hash}", consumes = MediaType.ALL_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleRequest(@PathVariable String hash,
      @PathVariable String configurationId, @RequestBody String body, HttpServletRequest request); @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", method = RequestMethod.HEAD) ResponseEntity<Void> handleHeadRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType); @RequestMapping(value = "/{configurationId}/{hash}", method = RequestMethod.HEAD) ResponseEntity<Void> handleHeadRequest(@PathVariable String hash,
      @PathVariable String configurationId); @RequestMapping(value = "/{configurationType}/{configurationId}/{hash}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleMultiPartFormDataRequest(@PathVariable String hash,
      @PathVariable String configurationId, @PathVariable String configurationType,
      @RequestPart(value = "message") String message,
      @RequestPart(value = "data", required = false) String data, HttpServletRequest request); @RequestMapping(value = "/{configurationId}/{hash}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity<String> handleMultiPartFormDataRequest(@PathVariable String hash,
      @PathVariable String configurationId, @RequestPart(value = "message") String message,
      @RequestPart(value = "data", required = false) String data, HttpServletRequest request); @ExceptionHandler(RemoteApiException.class) ResponseEntity<String> handleRemoteApiException(RemoteApiException e);  }