This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 1ea6b35 [CAMEL-13096] MockEndpoint may not respect expected minimum
message count (#2725)
1ea6b35 is described below
commit 1ea6b35ed6674bc84f40f5bc92d426443b25b23d
Author: Thomas Diesler <[email protected]>
AuthorDate: Tue Jan 22 11:03:55 2019 +0100
[CAMEL-13096] MockEndpoint may not respect expected minimum message count
(#2725)
---
.../main/java/org/apache/camel/component/mock/MockEndpoint.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git
a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 7962a0e..64db1b7 100644
--- a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -43,7 +43,6 @@ import org.apache.camel.Message;
import org.apache.camel.Predicate;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
-import org.apache.camel.RuntimeCamelException;
import org.apache.camel.builder.ProcessorBuilder;
import org.apache.camel.impl.InterceptSendToEndpoint;
import org.apache.camel.spi.BrowsableEndpoint;
@@ -508,8 +507,8 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint {
* <b>Important:</b> This overrides any previous set value using {@link
#expectedMessageCount(int)}
*/
public void expectedHeaderReceived(final String name, final Object value) {
- if (expectedCount == -1) {
- expectedMessageCount(1);
+ if (expectedMinimumCount == -1) {
+ expectedMinimumMessageCount(1);
}
if (expectedHeaderValues == null) {
expectedHeaderValues =
getCamelContext().getHeadersMapFactory().newMap();
@@ -717,7 +716,7 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint {
}
if (actualValue instanceof Expression) {
- Class clazz = Object.class;
+ Class<?> clazz = Object.class;
if (expectedValue != null) {
clazz = expectedValue.getClass();
}