package com.izouma.dingdong.repo;


import com.izouma.dingdong.enums.MerchantStatus;
import com.izouma.dingdong.enums.OrderStatus;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.time.LocalDateTime;


@RunWith(SpringRunner.class)
@SpringBootTest
public class OrderInfoRepoTest {
    @Autowired
    private OrderInfoRepo orderInfoRepo;

    @Test
    public void testOrder() {
        System.out.println(orderInfoRepo.sumRealAmountByUserId(170L));
    }

    @Test
    public void testTime() {
        System.out.println(orderInfoRepo.findAllByStatusAndOrderTimeAfterAndMerchantStatus(OrderStatus.PAID, LocalDateTime.now()
                .plusMinutes(5), MerchantStatus.RECEIVED));
    }

}
