Compare commits
5 Commits
docs
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
601f1c2fea | ||
|
|
e2b77ab1d0 | ||
|
|
967a349b4c | ||
|
|
42b08c8995 | ||
|
|
58a9a0f95b |
49
pom.xml
49
pom.xml
@@ -72,7 +72,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.2.12</version>
|
||||
<version>42.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.liquibase</groupId>
|
||||
@@ -91,16 +91,28 @@
|
||||
<version>1.2.32</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TEST dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.3-groovy-2.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-spring</artifactId>
|
||||
<version>1.3-groovy-2.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tngtech.archunit</groupId>
|
||||
@@ -108,10 +120,7 @@
|
||||
<version>0.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -144,8 +153,25 @@
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<reportsDirectory>${surefire.and.failsafe.report.dir}</reportsDirectory>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>addTestSources</goal>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
@@ -263,6 +289,7 @@
|
||||
<sonar.sources>.</sonar.sources>
|
||||
<sonar.inclusions>src/main/java/**,src/main/resources/**</sonar.inclusions>
|
||||
<sonar.exclusions>${code.coverage.exclusions}</sonar.exclusions>
|
||||
<sonat.tests>src/test/groovy,src/test/java</sonat.tests>
|
||||
<sonar.projectKey>wkrzywiec_library-hexagonal</sonar.projectKey>
|
||||
<sonar.organization>wkrzywiec</sonar.organization>
|
||||
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package io.wkrzywiec.hexagonal.library.domain.borrowing
|
||||
|
||||
import io.wkrzywiec.hexagonal.library.domain.borrowing.core.BorrowingFacade
|
||||
import io.wkrzywiec.hexagonal.library.domain.borrowing.core.model.AvailableBook
|
||||
import io.wkrzywiec.hexagonal.library.domain.borrowing.core.model.MakeBookAvailableCommand
|
||||
import io.wkrzywiec.hexagonal.library.domain.borrowing.core.ports.outgoing.BorrowingEventPublisher
|
||||
import spock.lang.Specification
|
||||
|
||||
class BorrowingFacadeSpec extends Specification {
|
||||
|
||||
private BorrowingFacade facade;
|
||||
private InMemoryBorrowingDatabase database;
|
||||
private BorrowingEventPublisher eventPublisher;
|
||||
|
||||
def setup(){
|
||||
database = new InMemoryBorrowingDatabase();
|
||||
eventPublisher = new BorrowingEventPublisherFake();
|
||||
facade = new BorrowingFacade(database, eventPublisher);
|
||||
}
|
||||
|
||||
def "Make a book available"(){
|
||||
|
||||
given: "prepare a command"
|
||||
def command = new MakeBookAvailableCommand(100L)
|
||||
|
||||
when: "receive MakeBookAvailableCommand"
|
||||
facade.handle(command)
|
||||
|
||||
then: "check database to have this book as available"
|
||||
database.availableBooks[100L].idAsLong == new AvailableBook(100L).idAsLong
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user