Skip to content

Releases: co-mmer/aaa-mockmvc

v1.4.0

08 Jan 19:56
63cdefb
Compare
Choose a tag to compare

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

10 Nov 13:08
4049d10
Compare
Choose a tag to compare

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 a DemoA instance.

  • Collections Deserialization: Handle lists and sets with ease using answerAsList(Class<T> elementType) and answerAsSet(Class<T> elementType). These methods automatically convert response data into a typed List or Set, streamlining collection handling and eliminating additional data conversion steps.

  • Map Deserialization: Transform response data into a Map using answerAsMap(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

26 Oct 13:34
20358ed
Compare
Choose a tag to compare

This release improves general test coverage across the framework, enhancing reliability and stability in core functionalities.

v1.2.0

25 Oct 10:46
3bdf903
Compare
Choose a tag to compare

This release introduces new methods for retrieving the results of executed HTTP requests. The result of the request can be accessed using the answer() method, allowing for further examination and validation of the response.

v1.1.0

24 Oct 14:06
cd1ff61
Compare
Choose a tag to compare

This release brings new features: TestAssertCustom, allowing for custom assertions with the new assertCustom() method, and TestAssertStatus, designed for validating HTTP status codes via the assertStatus() method.

Version v1.0.0

19 Oct 20:44
488ebdf
Compare
Choose a tag to compare

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.