Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions ca-spring-multimodule/domain/entities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,42 @@

<dependencies>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<!-- compile internal -->

<!-- compile external -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>

<!-- test -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest</artifactId>
<version>1.9.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.mockito.Mockito;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import java.util.UUID;

Expand Down Expand Up @@ -44,7 +46,14 @@ void shouldCreateValidCustomer() throws BusinessException {
assertEquals(validName, created.getName());
assertEquals(validEmail, created.getEmail());
assertEquals(validAddress, created.getAddress());
}
}

@Test
void shouldCallAddressValidationWhenCreatingCustomer() throws BusinessException {
new DefaultCustomer(UUID.randomUUID(), validName, validEmail, validAddress);

verify(validAddress, times(1)).validate();
}

@Nested
class CustomerValidationShouldThrow {
Expand Down