Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
port to axon 3.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
bliessens committed Oct 5, 2017
1 parent 61b8c80 commit d0013ac
Show file tree
Hide file tree
Showing 30 changed files with 205 additions and 181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import org.axonframework.samples.trader.api.company.CompanyId;
import org.axonframework.samples.trader.api.company.CreateCompanyCommand;
import org.axonframework.samples.trader.api.users.UserId;
import org.axonframework.test.FixtureConfiguration;
import org.axonframework.test.Fixtures;
import org.axonframework.test.aggregate.AggregateTestFixture;
import org.junit.Before;
import org.junit.Test;

Expand All @@ -30,11 +29,11 @@
*/
public class CompanyCommandHandlerTest {

private FixtureConfiguration fixture;
private AggregateTestFixture<Company> fixture;

@Before
public void setUp() {
fixture = Fixtures.newGivenWhenThenFixture(Company.class);
fixture = new AggregateTestFixture(Company.class);
CompanyCommandHandler commandHandler = new CompanyCommandHandler();
commandHandler.setRepository(fixture.getRepository());
fixture.registerAnnotatedCommandHandler(commandHandler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public CompanyId() {
}

public CompanyId(String identifier) {
Assert.notNull(identifier, "Identifier may not be null");
Assert.notNull(identifier, () -> "Identifier may not be null");
this.identifier = identifier;
this.hashCode = identifier.hashCode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public OrderBookId() {
}

public OrderBookId(String identifier) {
Assert.notNull(identifier, "Identifier may not be null");
Assert.notNull(identifier, () -> "Identifier may not be null");
this.identifier = identifier;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public OrderId() {
}

public OrderId(String identifier) {
Assert.notNull(identifier, "Identifier may not be null");
Assert.notNull(identifier, () -> "Identifier may not be null");
this.identifier = identifier;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public PortfolioId() {
}

public PortfolioId(String identifier) {
Assert.notNull(identifier, "Identifier may not be null");
Assert.notNull(identifier, () -> "Identifier may not be null");
this.identifier = identifier;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public TransactionId() {
}

public TransactionId(String identifier) {
Assert.notNull(identifier, "Identifier may not be null");
Assert.notNull(identifier, () -> "Identifier may not be null");
this.identifier = identifier;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ public class CreateUserCommand {
private String password;

public CreateUserCommand(UserId userId, String name, String username, String password) {
Assert.notNull(userId, "The provided userId cannot be null");
Assert.notNull(name, "The provided name cannot be null");
Assert.notNull(username, "The provided username cannot be null");
Assert.notNull(password, "The provided password cannot be null");
Assert.notNull(userId, () -> "The provided userId cannot be null");
Assert.notNull(name, () -> "The provided name cannot be null");
Assert.notNull(username, () -> "The provided username cannot be null");

this.userId = userId;
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public UserId() {
}

public UserId(String identifier) {
Assert.notNull(identifier, "Identifier may not be null");
Assert.notNull(identifier, () -> "Identifier may not be null");
this.identifier = identifier;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import net.sf.ehcache.CacheManager;
import org.axonframework.commandhandling.CommandBus;
import org.axonframework.commandhandling.CommandMessage;
import org.axonframework.commandhandling.SimpleCommandBus;
import org.axonframework.common.caching.EhCacheAdapter;
import org.axonframework.messaging.interceptors.BeanValidationInterceptor;
Expand All @@ -31,9 +30,6 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import java.util.Arrays;
import java.util.List;

@Configuration
@ComponentScan("org.axonframework.samples.trader")
@Import({CQRSInfrastructureHSQLDBConfig.class, CQRSInfrastructureMongoDBConfig.class})
Expand All @@ -42,9 +38,7 @@ public class CQRSInfrastructureConfig {
@Bean
public CommandBus commandBus() {
SimpleCommandBus commandBus = new SimpleCommandBus();
List<BeanValidationInterceptor<CommandMessage<?>>> beanValidationInterceptors =
Arrays.asList(new BeanValidationInterceptor<>());
commandBus.setDispatchInterceptors(beanValidationInterceptors);
commandBus.registerDispatchInterceptor(new BeanValidationInterceptor<>());

return commandBus;
}
Expand Down
Loading

0 comments on commit d0013ac

Please sign in to comment.