Skip to content

Commit

Permalink
Merge branch 'release/0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jangalinski committed Jul 20, 2022
2 parents 2919ae3 + 22ceeb5 commit fe9b87f
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/bankaccount-jgiven-junit4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>examples</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/bankaccount-jgiven-junit5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>examples</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing.examples</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import io.toolisticon.testing.jgiven.AND
import io.toolisticon.testing.jgiven.GIVEN
import io.toolisticon.testing.jgiven.THEN
import io.toolisticon.testing.jgiven.WHEN
import org.axonframework.test.aggregate.AggregateTestFixture
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test


Expand Down Expand Up @@ -45,12 +45,26 @@ class BankAccountAggregateJgivenKotlinTest : AggregateFixtureScenarioTest<BankAc
.build()
)
.AND
.expectEvents(
AccountCreatedEvent.builder()
.accountId("1")
.customerId("1")
.initialBalance(100)
.maximalBalance(DEFAULT_MAXIMAL_BALANCE)
.build()
)
.AND
.expectState(
BankAccountAggregate.builder()
.accountId("1")
.currentBalance(100)
.maximalBalance(DEFAULT_MAXIMAL_BALANCE)
.build()
)
.AND
.expectState("assert correct balance") {
assertEquals(100, it.currentBalance)
}

}
}
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>axon-testing_</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<artifactId>examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extension/jgiven/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>extension-jgiven</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
@file:Suppress("unused")

package io.holixon.axon.testing.jgiven.aggregate

import com.tngtech.jgiven.Stage
import com.tngtech.jgiven.annotation.*
import com.tngtech.jgiven.annotation.As
import com.tngtech.jgiven.annotation.ExpectedScenarioState
import com.tngtech.jgiven.annotation.Hidden
import com.tngtech.jgiven.annotation.Quoted
import io.holixon.axon.testing.jgiven.AxonJGivenStage
import org.axonframework.commandhandling.CommandResultMessage
import org.axonframework.deadline.DeadlineMessage
Expand All @@ -12,6 +16,7 @@ import org.hamcrest.Matcher
import org.hamcrest.MatcherAssert
import java.time.Duration
import java.time.Instant
import java.util.function.Consumer

/**
* Then stage for aggregate fixture.
Expand Down Expand Up @@ -81,6 +86,12 @@ class AggregateFixtureThen<T> : Stage<AggregateFixtureThen<T>>() {
}
}


@As("expect state: $")
fun expectState(@Quoted message: String = "by validator", @Hidden validator: Consumer<T>) = execute {
resultValidator.expectState(validator)
}

/**
* Expects an exception with provided message to be thrown.
* @param exceptionMessage message to expect.
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion extension/jgiven/junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>extension-jgiven</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extension/jgiven/junit5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>extension-jgiven</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extension/jgiven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>extension</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<artifactId>extension-jgiven</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>axon-testing_</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<artifactId>extension</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extension/upcaster-test-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>extension</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing</groupId>
Expand Down
2 changes: 1 addition & 1 deletion lib/fixtures/bankaccount/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>fixtures</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing.lib</groupId>
Expand Down
2 changes: 1 addition & 1 deletion lib/fixtures/giftcard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>fixtures</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<groupId>io.holixon.axon.testing.lib</groupId>
Expand Down
2 changes: 1 addition & 1 deletion lib/fixtures/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>lib</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<artifactId>fixtures</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.testing._</groupId>
<artifactId>axon-testing_</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</parent>

<artifactId>lib</artifactId>
Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>io.holixon.axon.testing._</groupId>
<artifactId>axon-testing_</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
<packaging>pom</packaging>

<modules>
Expand All @@ -22,9 +22,9 @@
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<kotlin.version>1.6.21</kotlin.version>
<kotlin.version>1.7.10</kotlin.version>

<axon-bom.version>4.5.13</axon-bom.version>
<axon-bom.version>4.5.16</axon-bom.version>

<jackson.version>2.13.3</jackson.version>
<junit.version>4.13.2</junit.version>
Expand Down Expand Up @@ -184,14 +184,14 @@
<!-- Install -->
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<version>3.0.0</version>
</plugin>

<!-- Assembly -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<configuration>
<descriptorSourceDirectory>assembly</descriptorSourceDirectory>
<archiverConfig>
Expand Down Expand Up @@ -268,7 +268,7 @@
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>1.6.21</version>
<version>1.7.10</version>
<configuration>
<!-- Conditional on maven property set per-project -->
<skip>${dokka.skip}</skip>
Expand Down Expand Up @@ -321,7 +321,7 @@
<!-- Enforcer -->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<executions>
<execution>
<id>enforce-java</id>
Expand Down Expand Up @@ -392,7 +392,7 @@
<!-- Deploy -->
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<version>3.0.0</version>
<configuration>
<skip>true</skip>
</configuration>
Expand Down

0 comments on commit fe9b87f

Please sign in to comment.