Rossen Stoyanchev
3653a37e27
Polish tests
2018-03-09 21:16:18 -05:00
Sam Brannen
107f8bb5fd
Polishing
2018-03-09 18:19:30 +01:00
Sam Brannen
00fea23e6b
Introduce test for WebTestClient with RegEx-based JsonPath
2018-03-09 14:51:37 +01:00
Juergen Hoeller
2a3f90dc7b
Upgrade to Hibernate ORM 5.2.15 and Hibernate Validator 6.0.8
2018-03-09 09:40:12 +01:00
Juergen Hoeller
139dc1d373
Polishing (collapsed if checks, consistent downcasts, refined javadoc)
2018-03-08 18:11:57 +01:00
igor-suhorukov
0f7485b01d
Polish: reorder the modifiers to comply with the Java Language Specification.
2018-03-08 17:57:47 +01:00
Sam Brannen
b14301bfba
Allow TestContextManager to be compiled in Eclipse again
2018-03-07 17:44:24 +01:00
Sam Brannen
2454b31b30
Polish MockRestRequestMatchers[Tests]
2018-03-07 14:20:57 +01:00
Sam Brannen
f932796201
Polishing
2018-03-07 13:22:36 +01:00
Sam Brannen
fef0c7b151
Throw AssertionError instead of IAE in MockRestRequestMatchers
2018-03-07 13:22:21 +01:00
Yannik Hampe
4094879daf
Make MockRestRequestMatchers independent of JUnit ( #1720 )
...
MockRestRequestMatchers was using org.junit.Assert.assertNotNull
and thus could not be used in projects that use e.g. TestNG instead
of JUnit 4.
2018-03-07 13:07:32 +01:00
Juergen Hoeller
4f8c4546f1
Upgrade to SnakeYAML 1.20 and Selenium 3.10
2018-03-05 15:25:01 +01:00
Juergen Hoeller
a0cc80063d
Concurrency and exception message refinements for test transactions
2018-03-05 13:00:35 +01:00
igor-suhorukov
ed936cbd89
Polish: Overriding methods should do more than simply call the same method in the super class
2018-03-02 00:06:27 +01:00
Juergen Hoeller
bfddbbe731
Polishing
2018-03-01 01:39:06 +01:00
igor-suhorukov
8080f56db8
Polish: "@Override" should be used on overriding and implementing methods
2018-03-01 00:15:18 +01:00
Juergen Hoeller
33cd160861
Upgrade to Reactor Bismuth SR7, Hibernate ORM 5.2.14, Common Annotations 1.3.2
2018-02-28 14:01:04 +01:00
Rossen Stoyanchev
e12fcca1e3
Fix failing test
2018-02-26 20:35:17 -05:00
Juergen Hoeller
9e55422334
Polishing
2018-02-25 15:38:32 +01:00
Juergen Hoeller
01d9475bcc
Turn registered controller classes into controller instances on the fly
...
Issue: SPR-16520
2018-02-25 14:29:44 +01:00
igor-suhorukov
c782075a13
Polish: Array designators "[]" should be on the type, not the variable
2018-02-25 13:14:20 +01:00
Juergen Hoeller
3531c104b0
Prefer Collections.addAll call with array over Set.addAll(Arrays.asList)
2018-02-25 00:21:39 +01:00
Juergen Hoeller
a5cbf5fe24
Consistent use of Collection.toArray with zero-sized array argument
...
Includes consistent use of ClassUtils.toClassArray (as non-null variant)
Issue: SPR-16523
2018-02-22 11:29:46 +01:00
Rossen Stoyanchev
bb8cddda23
Assert instances (vs classes) in MockMvc/WebTestClient
...
Issue: SPR-16520
2018-02-21 14:01:53 -05:00
Juergen Hoeller
0de36d2883
Consistent HttpMethod identity comparisons
2018-02-18 22:01:22 +01:00
Juergen Hoeller
d7cab23e6d
Consistent use of StringUtils.toStringArray
...
(cherry picked from commit 6d11b40 )
2018-02-16 20:49:17 +01:00
Juergen Hoeller
8d3264f680
Prefer List.sort(Comparator) over Collections.sort(List, Comparator)
2018-02-16 10:23:18 +01:00
igor-suhorukov
2be4985b8f
Polish: anonymous inner classes containing only one method should become lambdas,
...
use getOrDefault instead of ternary operator
2018-02-16 09:38:19 +01:00
Juergen Hoeller
3b810f3544
Consistent Class array vs vararg declarations (and related polishing)
2018-02-14 14:44:00 +01:00
igor-suhorukov
45e520ed86
Polish: remove unused private fields, remove empty operator
2018-02-13 23:00:18 +01:00
Sam Brannen
c11a963b1e
Remove dependency on apiguardian-api in spring-test
...
The apiguardian-api dependency is once again a mandatory transitive
dependency of JUnit 5 since JUnit Jupiter 5.0.3.
2018-02-13 13:04:48 +01:00
Juergen Hoeller
c9aede3727
Upgrade to Tomcat 8.5.28 (and Selenium HtmlUnit Driver 2.29.2)
2018-02-13 12:44:34 +01:00
Juergen Hoeller
a5a069c5b1
Upgrade to JavaMail 1.6.1
2018-02-13 00:02:43 +01:00
Juergen Hoeller
91965500cb
Upgrade to TestNG 6.14.2 and Selenium 3.9.1
2018-02-10 17:48:58 +01:00
igor-suhorukov
0ee505b73e
Polish: assertion arguments should be passed in the correct order,
...
use assertNull instead of assertEquals(null, value),
declare delta as double value in assertEquals
2018-02-10 17:17:28 +01:00
Juergen Hoeller
39201adca4
Consistent handling of InterruptedException
...
Issue: SPR-16479
2018-02-10 13:03:33 +01:00
igor-suhorukov
9a6fbf59c5
Polish: follow name convention - make immutable fields final
2018-02-10 12:09:19 +01:00
Stephane Nicoll
991eb4858e
Update copyright header
2018-02-09 10:16:58 +01:00
igor-suhorukov
e381514b07
Collection.isEmpty() should be used to test for emptiness
...
Closes gh-1670
2018-02-09 10:11:44 +01:00
Juergen Hoeller
4318710b9b
Upgrade to Hibernate 5.2.13
2018-02-07 14:14:22 +01:00
Rossen Stoyanchev
1653a32a04
Stabilize Flux.interval emissions in integration tests
...
After this commit the use of interval in tests is combined with
take(n).onBackpressureBuffer(n) to ensure emissions don't fail if the
fixed rate is exceeded (e.g. on slow CI server).
Tests that verify N number of items followed by verifyOnComplete()
should set the number of emissions to N.
Tests that verify N number of items followed by thenCancel() should
set the number of buffered to an arbitrary number greater than N.
2018-02-06 11:01:19 -05:00
Rossen Stoyanchev
f20eacdb9b
Polish
2018-02-02 15:06:59 -05:00
Rob Winch
0cd427bdd3
MockHttpServletRequestBuilder decodes pathInfo
...
Previously MockHttpServletRequestBuilder calculated the pathInfo from the
provided URL without decoding the value. This meant that the pathInfo
incorrectly included URL encoded values.
Now MockHttpServletRequestBuilder properly decodes the pathInfo.
Fixes: SPR-16453
2018-02-02 15:00:47 -05:00
Juergen Hoeller
b3e21ec737
MockHttpServletRequest leniently handles invalid Accept-Language header
...
Issue: SPR-16454
2018-02-02 11:34:22 +01:00
Rossen Stoyanchev
6d909b013e
Do not commit response on access to content
...
MockHttpServletResponse no longer calls flushBuffer on calls to
getContentAsByteArray and getContentAsString. The flushing doesn't
actually do anything useful but does commit the response leading to
unexpected side effects.
Issue: SPR-16430
2018-01-30 16:19:08 -05:00
Sam Brannen
b612f53e27
Rename doesExist() to exists() for header assertions
2018-01-26 17:24:54 +01:00
Juergen Hoeller
c6b0d85a7c
Consistent available() support in DelegatingServletInputStream
...
Issue: SPR-16416
2018-01-25 19:06:20 +01:00
Ketan Padegaonkar
a0c9fdba12
Fix `DelegatingServletInputStream#available`
...
Ensure that the method returns the correct number of bytes that can be
read without blocking
Issue: #SPR-16416
2018-01-25 18:02:59 +01:00
Sam Brannen
165ca12e6d
Add doesExist() to HeaderAssertions for WebTestClient
2018-01-25 15:50:19 +01:00
Sam Brannen
431494096a
Polishing
2018-01-25 15:49:06 +01:00
Rossen Stoyanchev
49f1aa78eb
Polish
2018-01-24 17:37:49 -05:00
Neonailol
81ca1f7c2b
Add doesExist assertion method to HeaderResultMatchers
2018-01-24 17:28:46 -05:00
Rossen Stoyanchev
97894a1c22
Improve logging dependencies for tests
2018-01-23 10:42:41 -05:00
Juergen Hoeller
91e6274b7d
Upgrade to Apache HttpClient 4.5.5 and Tomcat 8.5.27
2018-01-22 22:11:00 +01:00
Juergen Hoeller
61579ffe7b
Polishing
2018-01-22 21:34:44 +01:00
Juergen Hoeller
9d0e62ef68
Javadoc format and related polishing
2018-01-22 11:43:21 +01:00
Juergen Hoeller
40127bd9ad
Polishing
2018-01-19 12:30:10 +01:00
Rossen Stoyanchev
0c289283ff
Separate from expectations from response creation
...
This commit separates the creation of a response so that it is executed
after the synchronized block inside which requests need to be matched
and validated (for order and count).
This allows a ResponseCreator to be slow or block if it has to.
Issue: SPR-16319
2018-01-17 13:01:40 -05:00
Rossen Stoyanchev
7ab4d0ca08
Polish MockRestServiceServer code
2018-01-17 13:01:40 -05:00
Juergen Hoeller
214576673a
Proper NoClassDefFoundError check against BeanUtils.instantiateClass
...
Issue: SPR-16369
2018-01-17 18:29:05 +01:00
Sam Brannen
c88f11f958
Avoid deprecation warnings on JDK 9 in spring-test
2018-01-13 16:45:04 +01:00
Juergen Hoeller
a15975d94d
Log non-loadable TestExecutionListener classes at debug level only
...
Issue: SPR-16369
2018-01-12 16:47:46 +01:00
Juergen Hoeller
8f6d3feaa0
Tests for non-required MultipartFile parameters
...
Issue: SPR-16329
2018-01-11 10:22:59 +01:00
Juergen Hoeller
73cad470e5
Upgrade to HtmlUnit 2.29 and Selenium 3.8.1
2018-01-08 13:41:36 +01:00
Juergen Hoeller
4a57e26d76
Polishing
2018-01-07 23:33:35 +01:00
Rossen Stoyanchev
0f1f95e090
Add hasJsonPath/doesNotHaveJsonPath assertion options
...
Issue: SPR-16339
2018-01-03 20:27:09 -05:00
Juergen Hoeller
dd4f915234
Upgrade to JCache 1.1 (and Caffeine 2.6.1)
...
Issue: SPR-13574
2017-12-28 14:08:21 +01:00
Brian Clozel
6e587d5c57
Add new WebTestClient header assertions
...
This commit adds new header assertions for `WebTestClient`.
`doesNotExist` tests that a given header is not present:
.expectHeader().doesNotExist("Cache-Control");
`contentTypeCompatibleWith` tests for MediaType compatibility:
.expectHeader().contentTypeCompatibleWith("text/*");
Issue: SPR-16285
2017-12-21 20:34:24 +01:00
Juergen Hoeller
9d27e86951
Upgrade to Hibernate Validator 6.0.7
2017-12-21 17:00:06 +01:00
Rossen Stoyanchev
a8cf275aed
MockServerHttpRequest builder supports query params
...
Issue: SPR-16280
2017-12-19 15:38:12 -05:00
Rossen Stoyanchev
6df1a7874a
MockHttpServletResponse uses correct language header
...
Issue: SPR-16311
2017-12-19 13:56:16 -05:00
Juergen Hoeller
3a51b5a9d2
Upgrade to Hibernate Validator 6.0.6
2017-12-15 15:58:12 +01:00
Juergen Hoeller
f2e8171bfb
Latest dependency updates (RxJava 2.1.7, TestNG 6.13.1, Selenium HtmlUnit Driver 2.28.2)
2017-11-28 12:10:26 +01:00
Juergen Hoeller
a8323f6a27
Latest dependency updates (OkHttp 3.9.1, JRuby 9.1.14, Rome 1.9)
2017-11-26 16:03:48 +01:00
Juergen Hoeller
604017894e
Upgrade to Tiles 3.0.8 (and Selenium HtmlUnit Driver 2.28.1)
2017-11-21 17:56:42 +01:00
sdeleuze
9f1d8517ba
Polish Kotlin source code style
2017-11-21 15:59:23 +01:00
Juergen Hoeller
14a7da8183
Upgrade to Hibernate Validator 6.0.5
2017-11-19 21:16:10 +01:00
Juergen Hoeller
7697b398d5
Polishing
2017-11-14 17:11:16 +01:00
Juergen Hoeller
3e5209bea5
Test dependency updates (Mockito 2.12, HtmlUnit 2.28, Selenium 3.7.1, XMLUnit 2.5.1)
2017-11-13 21:51:23 +01:00
Rossen Stoyanchev
87375fe6f8
ServerHttpRequest exposes SSL certificates
...
Issue: SPR-15964
2017-11-10 16:43:12 -05:00
Rossen Stoyanchev
cb34b0b963
Polish
2017-11-09 17:16:31 -05:00
anton_bondarenko
b487db294b
Fix NullPointer when setting cookies in RequestUriSpec
2017-11-09 16:59:44 -05:00
Rossen Stoyanchev
263da1535b
WebTestClient can be configured with connector
...
Issue: SPR-16168
2017-11-07 13:01:12 -05:00
Rossen Stoyanchev
14f02d7192
Update reference with examples of multipart requests
...
Issue: SPR-16118
2017-11-06 16:33:58 -05:00
Juergen Hoeller
4ec60f08ad
PrintingResultHandler defensively accesses session.getAttributeNames()
...
Issue: SPR-16164
2017-11-06 21:19:44 +01:00
Juergen Hoeller
e5c1deea63
Polishing
2017-11-05 16:23:30 +01:00
Juergen Hoeller
80a0cf71f4
MockHttpServletResponse.getDateHeader returns -1 for non-existent header
...
Includes consistent getDateHeader results in both MockHttpServletResponse variants (spring-test and spring-web)
Issue: SPR-16160
2017-11-05 16:12:21 +01:00
Juergen Hoeller
0edf4d6509
MockHttpServletRequest.getRequestURL aligns with getServerName/Port
...
Issue: SPR-16138
2017-11-05 16:11:21 +01:00
Rossen Stoyanchev
579328bd7a
MockClientHttpRequest|Response support cookie headers
...
Issue: SPR-16124
2017-10-31 12:08:18 -04:00
Juergen Hoeller
295e3b6a99
MockRestServiceServer test for follow-up request after failure
...
Issue: SPR-16132
2017-10-30 16:40:20 +01:00
Eric Pabst
43d88e4a25
Move requests.add(request) into finally block.
...
This avoids "IllegalStateException: Expectations already declared" when
a MockRestServiceServer is used after one request throws an exception.
Issues: SPR-16132
2017-10-30 08:53:13 -06:00
Juergen Hoeller
70ed45020b
Add StatusAssertions.isForbidden
...
Includes aligned quoting for header assertion messages.
Also aligns HeaderAssertionTests class name.
Issue: SPR-16129
2017-10-29 09:51:25 +01:00
Sebastien Deleuze
b9a0e6bbf2
Update documentation about WebTestClient Kotlin issue
...
Issue: SPR-16057
2017-10-27 13:52:51 +02:00
Rossen Stoyanchev
a982123ed5
Decouple ExchangeResult from WiretapRequest/Response
...
This commit decouples ExchangeResult from knowledge about
WiretapClientHttpRequest/Response both of which are now private to
WiretapConnector.
ExchangeResult takes ClientHttpRequest/Response instead along with
promises for the serialized request and response content in the form
of MonoProcessor<byte[]>.
This sets up the possibility for an ExchangeResult to be created
outside and independent of WebTestClient, should we decide to make its
constructor public.
Issue: SPR-16101
2017-10-25 17:41:46 -04:00
Juergen Hoeller
9bab7a2708
Upgrade to Java Activation Framework 1.2 for test runtime
...
Includes upgrade to Hibernate Validator 6.0.4 (where applicable)
Issue: SPR-16115
2017-10-25 19:18:10 +02:00
Juergen Hoeller
f31069ac05
Upgrade to Selenium 3.6 and XMLUnit 2.5
2017-10-23 17:13:55 +02:00
Juergen Hoeller
e17ad551f3
Latest dependency updates (RxJava 1.3.3, Hibernate ORM 5.2.12, Hibernate Validator 5.4.2 & 6.0.3)
2017-10-20 16:16:06 +02:00
Rossen Stoyanchev
cd634633d8
MockMvc re-uses response instance on async dispatch
...
MockMvc now properly detects the presence of an AsyncContext and
re-uses the response instance used to start it.
This commit also includes a minor fix in
ResponseBodyEmitterReturnValueHandler to ensure it does not disable
ETag related content buffering for reactive return values that do not
result in streaming (e.g. single value or collections).
Issue: SPR-16067
2017-10-17 16:57:35 -04:00
Rossen Stoyanchev
94c4a7f941
Shortcut factory method in MockServerWebExchange
...
MockServerWebExchange now has a second factory method that accepts a
MockServerHttpRequest.BaseBuilder.
Issue: SPR-16079
2017-10-17 12:23:12 -04:00
Arjen Poutsma
24ca8ccf5a
WebTestClient.mutate() should not impact future .mutate() invocations
...
Issue: SPR-16059
2017-10-13 16:54:30 +02:00