Match secondBestMatch = matches.get(1); if (comparator.compare(bestMatch, secondBestMatch) == 0) { Method m1 = bestMatch.handlerMethod.getMethod(); Method m2 = secondBestMatch.handlerMethod.getMethod(); throw new IllegalStateException("Ambiguous handler methods mapped for destination '" + lookupDestination + "': {" + m1 + ", " + m2 + "}");
@Test public void exceptionWithHandlerMethodArg() { Message<?> message = createMessage("/pre/illegalState"); this.messageHandler.registerHandler(this.testController); this.messageHandler.handleMessage(message); assertEquals("handleExceptionWithHandlerMethodArg", this.testController.method); HandlerMethod handlerMethod = (HandlerMethod) this.testController.arguments.get("handlerMethod"); assertNotNull(handlerMethod); assertEquals("illegalState", handlerMethod.getMethod().getName()); }
@Test public void exceptionAsCause() { Message<?> message = createMessage("/pre/illegalStateCause"); this.messageHandler.registerHandler(this.testController); this.messageHandler.handleMessage(message); assertEquals("handleExceptionWithHandlerMethodArg", this.testController.method); HandlerMethod handlerMethod = (HandlerMethod) this.testController.arguments.get("handlerMethod"); assertNotNull(handlerMethod); assertEquals("illegalStateCause", handlerMethod.getMethod().getName()); }
@Test public void errorAsMessageHandlingException() { Message<?> message = createMessage("/pre/error"); this.messageHandler.registerHandler(this.testController); this.messageHandler.handleMessage(message); assertEquals("handleErrorWithHandlerMethodArg", this.testController.method); HandlerMethod handlerMethod = (HandlerMethod) this.testController.arguments.get("handlerMethod"); assertNotNull(handlerMethod); assertEquals("errorAsThrowable", handlerMethod.getMethod().getName()); }
Match secondBestMatch = matches.get(1); if (comparator.compare(bestMatch, secondBestMatch) == 0) { Method m1 = bestMatch.handlerMethod.getMethod(); Method m2 = secondBestMatch.handlerMethod.getMethod(); throw new IllegalStateException("Ambiguous handler methods mapped for destination '" + lookupDestination + "': {" + m1 + ", " + m2 + "}");
Match secondBestMatch = matches.get(1); if (comparator.compare(bestMatch, secondBestMatch) == 0) { Method m1 = bestMatch.handlerMethod.getMethod(); Method m2 = secondBestMatch.handlerMethod.getMethod(); throw new IllegalStateException("Ambiguous handler methods mapped for destination '" + lookupDestination + "': {" + m1 + ", " + m2 + "}");
Match secondBestMatch = matches.get(1); if (comparator.compare(bestMatch, secondBestMatch) == 0) { Method m1 = bestMatch.handlerMethod.getMethod(); Method m2 = secondBestMatch.handlerMethod.getMethod(); throw new IllegalStateException("Ambiguous handler methods mapped for destination '" + lookupDestination + "': {" + m1 + ", " + m2 + "}");