INT-2964 Various JavaDoc Fixes
INT-2964 - JavaDoc: <emphasis> should be <em>
INT-2964 - JavaDoc: <p/> should be <p>
INT-2964 - JavaDoc polishing
* <li></li> should be wrapped in <ul></ul>
* wrap code snippets in {@code myCode()}
* change <code>false</false> to <code>false</code>
INT-2964 - Polish - Fix more JavaDoc errors
* Mockito-all dependency causes JavaDoc error. Change dependency to Mockito-Core.
This commit is contained in:
committed by
Gary Russell
parent
4c348d3785
commit
05062aa0b2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,13 +28,12 @@ import java.util.Map;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
|
||||
/**
|
||||
* <h2>Are the {@link MessageHeaders} of a {@link Message} containing any entry
|
||||
* or multiple that match?</h2>
|
||||
*
|
||||
*
|
||||
* <h3>
|
||||
* Are the {@link MessageHeaders} of a {@link Message} containing any entry
|
||||
* or multiple that match?
|
||||
* <p>
|
||||
* For example using {@link Assert#assertThat(Object, Matcher)} for a single
|
||||
* entry:</h3>
|
||||
* entry:
|
||||
* <p>
|
||||
*
|
||||
* <pre>
|
||||
* ANY_HEADER_KEY = "foo";
|
||||
@@ -44,9 +43,9 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
* assertThat(message, hasEntry(ANY_HEADER_KEY, notNullValue()));
|
||||
* assertThat(message, hasEntry(ANY_HEADER_KEY, is(ANY_HEADER_VALUE)));
|
||||
* </pre>
|
||||
*
|
||||
* <h3>For multiple entries to match all:</h3>
|
||||
*
|
||||
* <p>
|
||||
* For multiple entries to match all:
|
||||
* <p>
|
||||
* <pre>
|
||||
* Map<String, Object> expectedInHeaderMap = new HashMap<String, Object>();
|
||||
* expectedInHeaderMap.put(ANY_HEADER_KEY, ANY_HEADER_VALUE);
|
||||
@@ -54,8 +53,9 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
* assertThat(message, HeaderMatcher.hasAllEntries(expectedInHeaderMap));
|
||||
* </pre>
|
||||
*
|
||||
* <h3>
|
||||
* For a single key:</h3>
|
||||
* <p>
|
||||
* For a single key:
|
||||
* <p>
|
||||
*
|
||||
* <pre>
|
||||
* ANY_HEADER_KEY = "foo";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,18 +26,18 @@ import org.mockito.Mockito;
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
/**
|
||||
* <h2>Mockito matcher factory for {@link Message} matcher creation.</h2>
|
||||
* Mockito matcher factory for {@link Message} matcher creation.
|
||||
* <p>
|
||||
* This class contains expressive factory methods for the most common Mockito
|
||||
* matchers needed when matching {@link Message}s. If you need a different
|
||||
* matching strategy, any Hamcrest matcher can be used in Mockito through
|
||||
* {@link Mockito#argThat(Matcher)}.
|
||||
*
|
||||
* <h3>Example usage:</h3>
|
||||
*
|
||||
* Example usage:
|
||||
* <p>
|
||||
* With {@link Mockito#verify(Object)}:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* @Mock
|
||||
* MessageHandler handler;
|
||||
@@ -49,16 +49,16 @@ import org.springframework.integration.Message;
|
||||
* <p>
|
||||
* With {@link Mockito#when(Object)}:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* ...
|
||||
* when(channel.send(messageWithPayload(SOME_PAYLOAD))).thenReturn(true);
|
||||
* assertThat(channel.send(message), is(true));
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author Alex Peters
|
||||
* @author Iwein Fuld
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MockitoMessageMatchers {
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
/**
|
||||
*
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed 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.springframework.integration.test.matcher;
|
||||
|
||||
@@ -15,23 +27,25 @@ import org.springframework.integration.MessageHeaders;
|
||||
|
||||
/**
|
||||
* Matcher to make assertions about message equality easier. Usage:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* @Test
|
||||
* public void testSomething() {
|
||||
* Message<String> expected = ...;
|
||||
* Message<String> result = ...;
|
||||
* assertThat(result, sameExceptImmutableHeaders(expected));
|
||||
* }
|
||||
*
|
||||
*
|
||||
* @Factory
|
||||
* public static Matcher<Message<?>> sameExceptImmutableHeaders(Message<?> expected) {
|
||||
* return new PayloadAndHeaderMatcher(expected);
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class PayloadAndHeaderMatcher extends BaseMatcher<Message<?>> {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,35 +23,33 @@ import org.junit.Assert;
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
/**
|
||||
* <h2>Is the payload of a {@link Message} equal to a given value or is matching
|
||||
* a given matcher?</h2>
|
||||
*
|
||||
* <h3>
|
||||
* Is the payload of a {@link Message} equal to a given value or is matching
|
||||
* a given matcher?
|
||||
* <p>
|
||||
* A Junit example using {@link Assert#assertThat(Object, Matcher)} could look
|
||||
* like this to test a payload value:</h3>
|
||||
*
|
||||
* like this to test a payload value:
|
||||
* <p>
|
||||
* <pre>
|
||||
* ANY_PAYLOAD = new BigDecimal("1.123");
|
||||
* Message<BigDecimal message = MessageBuilder.withPayload(ANY_PAYLOAD).build();
|
||||
* assertThat(message, hasPayload(ANY_PAYLOjAD));
|
||||
* </pre>
|
||||
*
|
||||
* <h3>
|
||||
* <p>
|
||||
* An example using {@link Assert#assertThat(Object, Matcher)} delegating to
|
||||
* another {@link Matcher}.</h3>
|
||||
*
|
||||
* another {@link Matcher}.
|
||||
* <p>
|
||||
* <pre>
|
||||
* ANY_PAYLOAD = new BigDecimal("1.123");
|
||||
* assertThat(message, PayloadMatcher.hasPayload(is(BigDecimal.class)));
|
||||
* assertThat(message, PayloadMatcher.hasPayload(notNullValue()));
|
||||
* assertThat(message, not((PayloadMatcher.hasPayload(is(String.class))))); *
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author Alex Peters
|
||||
* @author Iwein Fuld
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class PayloadMatcher extends TypeSafeMatcher<Message> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,8 +22,8 @@ import java.lang.reflect.Method;
|
||||
/**
|
||||
* This class was copied from JUnit to avoid using it from org.junit.internal (causing a backwards compatibility issue).
|
||||
* If you want to extend this class use a recent version of JUnit, and extend
|
||||
* <code>org.junit.matchers.TypeSafeMatcher</code>
|
||||
* <p/>
|
||||
* <code>org.junit.matchers.TypeSafeMatcher</code>
|
||||
* <p>
|
||||
* Convenient base class for Matchers that require a non-null value of a specific type.
|
||||
* This simply implements the null check, checks the type and then casts.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user