Setup

RECORDO

Maven Dependencies

All Modules

To add all modules at once into your project, you can use the recordo-all artifact with the pom type.

<dependency>
    <groupId>com.cariochi.recordo</groupId>
    <artifactId>recordo-all</artifactId>
    <version>1.2.22</version>
    <type>pom</type>
    <scope>test</scope>
</dependency>

Read Module

<dependency>
    <groupId>com.cariochi.recordo</groupId>
    <artifactId>recordo-read</artifactId>
    <version>1.2.22</version>
    <scope>test</scope>
</dependency>

Assertions Module

<dependency>
    <groupId>com.cariochi.recordo</groupId>
    <artifactId>recordo-assertions</artifactId>
    <version>1.2.22</version>
    <scope>test</scope>
</dependency>

MockMvc Module

<dependency>
    <groupId>com.cariochi.recordo</groupId>
    <artifactId>recordo-spring-mockmvc</artifactId>
    <version>1.2.22</version>
    <scope>test</scope>
</dependency>

MockServer Module

<dependency>
    <groupId>com.cariochi.recordo</groupId>
    <artifactId>recordo-mockserver</artifactId>
    <version>1.2.22</version>
    <scope>test</scope>
</dependency>

Initialize Extension

To set up Recordo for your test, simply use the RecordoExtension.

@ExtendWith(RecordoExtension.class)
class BookServiceTest {
    ...
}

ObjectMapper

Recordo uses the Jackson ObjectMapper for JSON operations. The logic for locating the ObjectMapper instance is as follows:

  1. As the highest priority, the ObjectMapper field annotated with the @EnableRecordo annotation will be used, if present.

  2. If Spring is being used and the test doesn't have a field, the library will use the ObjectMapper bean from the Spring context if available.

  3. In all cases other than the specific ones where a custom ObjectMapper instance is provided, the library will utilize its default Recordo ObjectMapper instance.

Last updated