Created
August 15, 2021 16:29
-
-
Save mand2/3a27c23ed1d42a18059c85a1845dab75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.order.aws; | |
import org.junit.jupiter.api.DisplayName; | |
import org.junit.jupiter.api.Test; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import static java.util.stream.Collectors.toList; | |
import static org.junit.jupiter.api.Assertions.*; | |
class OrderSqsTest { | |
@Test | |
@DisplayName("사장님에게 주문 메세지를 한개 보낸다") | |
void sendOneMessageToStore() throws Exception { | |
// given | |
Order order = new Order(1, 8736290, 717); | |
// when | |
OrderSqs orderSqs = new OrderSqs(); | |
orderSqs.sendOrder(order); | |
// then | |
assertEquals(orderSqs.ORDER_SQS_RESULT_SUCCESS, orderSqs); | |
} | |
@Test | |
@DisplayName("사장님에게 주문 메세지를 여러개 보낸다") | |
void sendMultipleMessageToStore() throws Exception { | |
// given | |
List<Order> orders = IntStream.range(182726, 182735) | |
.boxed() | |
.map(i -> new Order(i, i-286, i+1525)) | |
.collect(toList()); | |
// when | |
OrderSqs orderSqs = new OrderSqs(); | |
orderSqs.sendOrder(orders); | |
// then | |
assertEquals(orderSqs.ORDER_SQS_RESULT_SUCCESS, orderSqs); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment