refactor
This commit is contained in:
14
README.md
14
README.md
@@ -1,9 +1,9 @@
|
||||
# Reactive Stock Exchange
|
||||
# Reactive Stock Market
|
||||
|
||||
### Introduction
|
||||
|
||||
This project demonstrates reactive implementation of simple stock exchange platform.
|
||||
Originally assigment is given to Senior Software Engineers as a technical coding interview in some stock/crypto exchange companies.
|
||||
This project demonstrates reactive implementation of simple stock market platform.
|
||||
Originally assigment is given to Senior Software Engineers as a technical coding interview in some stock/crypto market companies.
|
||||
|
||||
Read [system requirements here.](system_requirements.pdf)
|
||||
|
||||
@@ -16,7 +16,7 @@ Read [system requirements here.](system_requirements.pdf)
|
||||
### Implementation
|
||||
|
||||
- **Matching engine**
|
||||
+ [Matching Engine](src/main/java/com/github/schananas/reactivestockexchange/domain/engine/MatchingEngine.java) uses Max-Heap and Min-Heap
|
||||
+ [Matching Engine](src/main/java/com/github/schananas/reactivestockmarket/domain/engine/MatchingEngine.java) uses Max-Heap and Min-Heap
|
||||
+ Time complexity for critical operations are as:
|
||||
+ Add – O(log N)
|
||||
+ Cancel – O(1)
|
||||
@@ -65,15 +65,15 @@ So how can we reduce complexity and improve performance for high load? In this p
|
||||
|
||||

|
||||
|
||||
Using reactor pattern commands are de-multiplexed (see [CommandBus:80](src/main/java/com/github/schananas/reactivestockexchange/domain/bus/CommandBus.java)) to a single "flow" of execution. I'm using word flow instead of thread here, as threads can arbitrarily be changed in Project Reactor, but that does not matter as we model our flow in such way that we know which components can be only accessed sequentially and which concurrently.
|
||||
Using reactor pattern commands are de-multiplexed (see [CommandBus:80](src/main/java/com/github/schananas/reactivestockmarket/domain/bus/CommandBus.java)) to a single "flow" of execution. I'm using word flow instead of thread here, as threads can arbitrarily be changed in Project Reactor, but that does not matter as we model our flow in such way that we know which components can be only accessed sequentially and which concurrently.
|
||||
Then we place our components within this flow. Each component executes one intent/command at the time, like any synchronized component from blocking example would. Once command is executed, next is taken from flow and gets executed. There is also option to specify what is maximum time allowed to access component, preventing potential congestion.
|
||||
Now components can be single threaded without any concurrency protection complexity.
|
||||
Once all steps from flow have been executed, user is asynchronously notified with response.
|
||||
|
||||
**Reactive with parallel execution**
|
||||
|
||||
So what if some components can be accessed in parallel? In case of this project, if two users are bidding for two different assets/instruments we can execute their orders in parallel as assets are two logically separated components. (see [Book aggregate](src/main/java/com/github/schananas/reactivestockexchange/domain/Book.java))
|
||||
In this case we just multiplex flow again and split it to two separate flows, each executing commands and orders for distinct assets. (see [CommandBus:51](src/main/java/com/github/schananas/reactivestockexchange/domain/bus/CommandBus.java))
|
||||
So what if some components can be accessed in parallel? In case of this project, if two users are bidding for two different assets/instruments we can execute their orders in parallel as assets are two logically separated components. (see [Book aggregate](src/main/java/com/github/schananas/reactivestockmarket/domain/Book.java))
|
||||
In this case we just multiplex flow again and split it to two separate flows, each executing commands and orders for distinct assets. (see [CommandBus:51](src/main/java/com/github/schananas/reactivestockmarket/domain/bus/CommandBus.java))
|
||||
|
||||

|
||||
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -10,10 +10,10 @@
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.github.schananas</groupId>
|
||||
<artifactId>reactivestockexhange</artifactId>
|
||||
<artifactId>reactivestockmarket</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>Reactive Stock Exchange</name>
|
||||
<description>Proof of concept for reactive implementation of reactive stock exchange with only a simple limit order matching engine.</description>
|
||||
<name>Reactive Stock Market</name>
|
||||
<description>Proof of concept for reactive implementation of reactive stock market with only a simple limit order matching engine.</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange;
|
||||
package com.github.schananas.reactivestockmarket;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -9,7 +9,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ReactiveStockExchangeApplication {
|
||||
public class ReactiveStockMarketApplication {
|
||||
|
||||
@Bean
|
||||
RestTemplate restTemplate(ProtobufHttpMessageConverter hmc) {
|
||||
@@ -22,7 +22,7 @@ public class ReactiveStockExchangeApplication {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ReactiveStockExchangeApplication.class, args);
|
||||
SpringApplication.run(ReactiveStockMarketApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
/**
|
||||
* Interface to define event
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
/**
|
||||
* Interface to define sourcing event - event that changes aggregate and projection state
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
/**
|
||||
* Interface to define update event - event that changes only projection state
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.github.schananas.reactivestockexchange.domain;
|
||||
package com.github.schananas.reactivestockmarket.domain;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Aggregate;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Command;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Event;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.command.CancelOrderCommand;
|
||||
import com.github.schananas.reactivestockexchange.domain.command.MakeOrderCommand;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.MatchingEngine;
|
||||
import com.github.schananas.reactivestockexchange.domain.events.CancellationRequestedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.events.OrderAcceptedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.events.OrderRejectedEvent;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Aggregate;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Command;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Event;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.command.CancelOrderCommand;
|
||||
import com.github.schananas.reactivestockmarket.domain.command.MakeOrderCommand;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.MatchingEngine;
|
||||
import com.github.schananas.reactivestockmarket.domain.events.CancellationRequestedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.events.OrderAcceptedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.events.OrderRejectedEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import reactor.core.publisher.Flux;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.github.schananas.reactivestockexchange.domain;
|
||||
package com.github.schananas.reactivestockmarket.domain;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.AggregateRepository;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.BookQueryRepository;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.AggregateRepository;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.BookQueryRepository;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.bus;
|
||||
package com.github.schananas.reactivestockmarket.domain.bus;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Command;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.BookAggregateRepository;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Command;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.BookAggregateRepository;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.command;
|
||||
package com.github.schananas.reactivestockmarket.domain.command;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Command;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Command;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.command;
|
||||
package com.github.schananas.reactivestockmarket.domain.command;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Command;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Command;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.engine;
|
||||
package com.github.schananas.reactivestockmarket.domain.engine;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderCanceledEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderCanceledEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import reactor.core.publisher.Flux;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.engine;
|
||||
package com.github.schananas.reactivestockmarket.domain.engine;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.engine.events;
|
||||
package com.github.schananas.reactivestockmarket.domain.engine.events;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.engine.events;
|
||||
package com.github.schananas.reactivestockmarket.domain.engine.events;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.engine.events;
|
||||
package com.github.schananas.reactivestockmarket.domain.engine.events;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.UpdateEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.events;
|
||||
package com.github.schananas.reactivestockmarket.domain.events;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.SourcingEvent;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.events;
|
||||
package com.github.schananas.reactivestockmarket.domain.events;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.events;
|
||||
package com.github.schananas.reactivestockmarket.domain.events;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.query;
|
||||
package com.github.schananas.reactivestockmarket.domain.query;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderCanceledEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Event;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.QueryRepository;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderCanceledEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Event;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.QueryRepository;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.scheduler.Schedulers;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.query;
|
||||
package com.github.schananas.reactivestockmarket.domain.query;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.query;
|
||||
package com.github.schananas.reactivestockmarket.domain.query;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.query;
|
||||
package com.github.schananas.reactivestockmarket.domain.query;
|
||||
|
||||
/**
|
||||
* @author Stefan Dragisic
|
||||
@@ -1,19 +1,19 @@
|
||||
package com.github.schananas.reactivestockexchange.web;
|
||||
package com.github.schananas.reactivestockmarket.web;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.api.protobuf.OrderStatusResponse;
|
||||
import com.github.schananas.reactivestockexchange.api.protobuf.PlaceOrderRequest;
|
||||
import com.github.schananas.reactivestockexchange.api.protobuf.Trade;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.Event;
|
||||
import com.github.schananas.reactivestockexchange.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.bus.CommandBus;
|
||||
import com.github.schananas.reactivestockexchange.domain.command.CancelOrderCommand;
|
||||
import com.github.schananas.reactivestockexchange.domain.command.MakeOrderCommand;
|
||||
import com.github.schananas.reactivestockexchange.domain.events.OrderAcceptedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.BookQueryRepository;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderEntry;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockexchange.domain.Book;
|
||||
import com.github.schananas.reactivestockexchange.domain.BookAggregateRepository;
|
||||
import com.github.schananas.reactivestockmarket.api.protobuf.OrderStatusResponse;
|
||||
import com.github.schananas.reactivestockmarket.api.protobuf.PlaceOrderRequest;
|
||||
import com.github.schananas.reactivestockmarket.api.protobuf.Trade;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.Event;
|
||||
import com.github.schananas.reactivestockmarket.cqrs.SourcingEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.bus.CommandBus;
|
||||
import com.github.schananas.reactivestockmarket.domain.command.CancelOrderCommand;
|
||||
import com.github.schananas.reactivestockmarket.domain.command.MakeOrderCommand;
|
||||
import com.github.schananas.reactivestockmarket.domain.events.OrderAcceptedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.BookQueryRepository;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderEntry;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.domain.Book;
|
||||
import com.github.schananas.reactivestockmarket.domain.BookAggregateRepository;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -134,7 +134,7 @@ public class MarketController {
|
||||
.setAsset(order.asset())
|
||||
.setAmount(order.amount().doubleValue())
|
||||
.setPrice(order.price().doubleValue())
|
||||
.setDirection(com.github.schananas.reactivestockexchange.api.protobuf.OrderType.valueOf(
|
||||
.setDirection(com.github.schananas.reactivestockmarket.api.protobuf.OrderType.valueOf(
|
||||
order.direction().name()))
|
||||
.addAllTrades(order.trades().stream()
|
||||
.map(t -> Trade.newBuilder()
|
||||
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package com.github.schananas.reactivestockexchange.api;
|
||||
package com.github.schananas.reactivestockmarket.api;
|
||||
|
||||
option java_package = "com.github.schananas.reactivestockexchange.api.protobuf";
|
||||
option java_package = "com.github.schananas.reactivestockmarket.api.protobuf";
|
||||
option java_multiple_files = true;
|
||||
|
||||
enum OrderType {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.github.schananas.reactivestockexchange.cqrs;
|
||||
package com.github.schananas.reactivestockmarket.cqrs;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.domain.bus.CommandBus;
|
||||
import com.github.schananas.reactivestockexchange.domain.command.CancelOrderCommand;
|
||||
import com.github.schananas.reactivestockexchange.domain.command.MakeOrderCommand;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.MatchingEngine;
|
||||
import com.github.schananas.reactivestockexchange.domain.events.CancellationRequestedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.events.OrderAcceptedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockexchange.domain.Book;
|
||||
import com.github.schananas.reactivestockexchange.domain.BookAggregateRepository;
|
||||
import com.github.schananas.reactivestockmarket.domain.bus.CommandBus;
|
||||
import com.github.schananas.reactivestockmarket.domain.command.CancelOrderCommand;
|
||||
import com.github.schananas.reactivestockmarket.domain.command.MakeOrderCommand;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.MatchingEngine;
|
||||
import com.github.schananas.reactivestockmarket.domain.events.CancellationRequestedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.events.OrderAcceptedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.domain.Book;
|
||||
import com.github.schananas.reactivestockmarket.domain.BookAggregateRepository;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.mockito.*;
|
||||
import reactor.core.publisher.Mono;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.github.schananas.reactivestockexchange.domain;
|
||||
package com.github.schananas.reactivestockmarket.domain;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.domain.query.BookQueryRepository;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.BookQueryRepository;
|
||||
import org.junit.jupiter.api.*;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.github.schananas.reactivestockexchange.domain;
|
||||
package com.github.schananas.reactivestockmarket.domain;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.BookQueryRepository;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.BookQueryRepository;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import org.junit.jupiter.api.*;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.github.schananas.reactivestockexchange.domain.engine;
|
||||
package com.github.schananas.reactivestockmarket.domain.engine;
|
||||
|
||||
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderCanceledEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockexchange.domain.query.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderCanceledEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderMatchedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.engine.events.OrderPlacedEvent;
|
||||
import com.github.schananas.reactivestockmarket.domain.query.OrderType;
|
||||
import org.junit.jupiter.api.*;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.github.schananas.reactivestockexchange.integration;
|
||||
package com.github.schananas.reactivestockmarket.integration;
|
||||
|
||||
import com.github.schananas.reactivestockexchange.api.protobuf.OrderStatusResponse;
|
||||
import com.github.schananas.reactivestockexchange.api.protobuf.OrderType;
|
||||
import com.github.schananas.reactivestockexchange.ReactiveStockExchangeApplication;
|
||||
import com.github.schananas.reactivestockmarket.api.protobuf.OrderStatusResponse;
|
||||
import com.github.schananas.reactivestockmarket.api.protobuf.OrderType;
|
||||
import com.github.schananas.reactivestockmarket.ReactiveStockMarketApplication;
|
||||
import org.junit.*;
|
||||
import org.junit.runner.*;
|
||||
import org.slf4j.Logger;
|
||||
@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||
* @author Stefan Dragisic
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = ReactiveStockExchangeApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = ReactiveStockMarketApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class IntegrationTest {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(IntegrationTest.class);
|
||||
Reference in New Issue
Block a user