-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOrderBookUpdatedNotifierAdapterTest.java
More file actions
37 lines (27 loc) · 1.29 KB
/
OrderBookUpdatedNotifierAdapterTest.java
File metadata and controls
37 lines (27 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.cleanengine.coin.orderbook.infra;
import com.cleanengine.coin.base.WebSocketTest;
import com.cleanengine.coin.orderbook.dto.OrderBookInfo;
import com.cleanengine.coin.orderbook.dto.OrderBookUnitInfo;
import com.cleanengine.coin.tool.helper.GenericStompFrameHandler;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static org.junit.jupiter.api.Assertions.assertEquals;
@Disabled
public class OrderBookUpdatedNotifierAdapterTest extends WebSocketTest {
@Autowired
protected OrderBookUpdatedNotifierAdapter orderBookUpdatedNotifierAdapter;
@Test
public void getOrderBooks() throws Exception {
OrderBookInfo orderBookInfo = new OrderBookInfo("BTC",
List.of(new OrderBookUnitInfo(1.0, 1.0, 0.0)),
List.of(new OrderBookUnitInfo( 2.0, 2.0, 0.0)));
session.subscribe("/topic/orderbook/BTC",
new GenericStompFrameHandler<>(OrderBookInfo.class, responseQueue));
orderBookUpdatedNotifierAdapter.sendOrderBooks(orderBookInfo);
OrderBookInfo result = (OrderBookInfo) responseQueue.poll(10, TimeUnit.SECONDS);
assertEquals(orderBookInfo, result);
}
}