Releases: co-mmer/aaa-mockmvc
v1.4.0
New Features
-
Class Assertions:
- Added the ability to check if the class of the HTTP response is empty or not, or if it matches a specific object.
- Added match support to verify if the class satisfies all, at least one, or none of the specified conditions.
-
Collection Assertions:
- Verify if a collection (list or set) in the HTTP response is empty, has the correct size, or contains specific elements, with or without regard to the order.
- Added match support to check if the collection meets all, at least one, or none of the specified conditions.
-
Map Assertions:
- Added methods to validate maps in HTTP responses, enabling checks for non-emptiness, correct size, and matching key-value pairs.
-
Byte Array Assertions:
- Introduced methods to assert the content of byte arrays in HTTP responses, ensuring they are not empty, match a specific length, or are identical to an expected byte array.
v1.3.0
New Features
Enhanced Answer Section
-
Direct Object Deserialization: The
answerAsObject(T resultType)
method allows HTTP responses to be deserialized directly into a specified class type. Responses are returned as fully typed objects, eliminating the need for manual parsing. For example,answerAsObject(DemoA.class)
will directly return aDemoA
instance. -
Collections Deserialization: Handle lists and sets with ease using
answerAsList(Class<T> elementType)
andanswerAsSet(Class<T> elementType)
. These methods automatically convert response data into a typedList
orSet
, streamlining collection handling and eliminating additional data conversion steps. -
Map Deserialization: Transform response data into a
Map
usinganswerAsMap(Class<K> keyType, Class<V> valueType)
. This method supports fully typed key-value pairs, for example,answerAsMap(Integer.class, DemoA.class)
, allowing complex structured data to be managed without extra casting.
Seamless Test Chaining with arrangeJson(T content)
- The new
arrangeJson
method enables straightforward JSON content setup for PUT, POST, and PATCH requests, reusing data directly from previous responses. This feature supports a smooth testing flow, where responses from one request can be set as the body of the next, enabling efficient and connected testing.
Improvements
Unicode Consistency in Assertions
assertContentEquals
methods now normalize content using Unicode Normalization Form C (NFC), ensuring consistent comparisons across various formats and encoding variations. This improvement enhances reliability in text-based content validation, especially when working with Unicode data.
v1.2.1
v1.2.0
v1.1.0
Version v1.0.0
Version v1.0.0 of the test framework is now available. This framework structures unit tests following the AAA (Arrange, Act, Assert) pattern, focusing on clarity and readability.
Key features include:
- Fluent API: Guides developers through each phase (Arrange, Act, Assert) with contextually relevant methods.
- Separation of Concerns: Ensures clean, maintainable test logic by isolating each test phase.
- Improved Readability: Enables writing tests in a natural and expressive manner.