davsclaus commented on code in PR #25741: URL: https://github.com/apache/camel/pull/25741#discussion_r3859863860
########## components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaMuteExceptionTest.java: ########## @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.mina; + +import org.apache.camel.builder.RouteBuilder; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * The consumer used to write {@code exchange.getException()} straight back over the socket, so a route failure handed + * the remote peer the exception - its class and message over a textline codec, and its serialised form, cause chain + * included, over the object codec. + * <p> + * {@code muteException} defaults to true, matching the http consumers aligned by CAMEL-23651. + */ +class MinaMuteExceptionTest extends BaseMinaTest { + + private static final String DETAIL = "the-internal-detail-a-peer-must-not-see"; + + /** getNextPort() allocates a fresh port on every call, so the second consumer's port is resolved once. */ + private Integer unmutedPort; Review Comment: Minor, non-blocking: this lazily-initialized field works (it's only read/written from `createRouteBuilder()` and the test method, which run sequentially), but it's a slightly indirect way to get a stable port compared to just calling `getNextPort()` once in the field initializer. Not requesting a change, just flagging for awareness. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
