• @PropertySource


    @PropertySource("tempest-${spring.profiles.active}.properties")
    @PropertySource(factory = YamlPropertySourceFactory.class, value = "classpath:SlaTimeMap.yml")
    import com.citi.tm.api.report.portfolio.tradePortfolio.TradePortfolioReportServiceTest.TestContextConfiguration;
    import com.citi.tm.model.g10.trade.TradeSchema;
    import com.citi.tm.model.report.portfolio.PortfolioReport;
    import com.citi.tm.model.report.portfolio.TradePortfolioDto;
    import java.time.Instant;
    import java.util.List;
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.mockito.stubbing.OngoingStubbing;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
    import org.springframework.boot.context.properties.EnableConfigurationProperties;
    import org.springframework.boot.test.context.SpringBootTest;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.context.annotation.Import;
    import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
    import org.springframework.data.mongodb.core.aggregation.Aggregation;
    import org.springframework.test.context.ContextConfiguration;
    import org.springframework.test.context.TestPropertySource;
    import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
    import org.springframework.test.context.ActiveProfiles;
    import org.springframework.test.context.junit4.SpringRunner;
    import org.springframework.web.server.ResponseStatusException;
    import reactor.core.publisher.Flux;
    import reactor.core.publisher.Mono;
    import reactor.test.StepVerifier;
    
    /*@RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(
        classes = {TestContextConfiguration.class, TradePortfolioReportService.class},
        initializers = {ConfigFileApplicationContextInitializer.class})
    @TestPropertySource(properties = {"spring.config.location=classpath:application-test.yml"})*/
    @RunWith(SpringRunner.class)
    @SpringBootTest(classes = TestContextConfiguration.class)
    @ActiveProfiles("test")
    public class TradePortfolioReportServiceTest {
    
      @Configuration
      @Import(TradePortfolioReportService.class)
      @EnableConfigurationProperties(TradePortfolioSlaTime.class)
      static class TestContextConfiguration {
        @Bean
        public List<ReactiveMongoTemplate> templates() {
          ReactiveMongoTemplate template = mock(ReactiveMongoTemplate.class);
          return asList(template);
        }
      }
  • 相关阅读:
    HTML/CSS的学习过程一览
    C++ MFC实现基于RFID读写器的上位机软件
    Java实现UDP之Echo客户端和服务端
    Java实现TCP之Echo客户端和服务端
    Java实现Socket之WhoisClient
    Java实现Socket之TimeClient
    openWRT自学---针对backfire版本的主要目录和文件的作用的分析整理
    openWRT自学计划安排
    openWRT自学---对官方的开发指导文档的解读和理解 记录2:如何控制内核模块的编译
    openWRT自学---对官方的开发指导文档的解读和理解 记录1:编译一个package
  • 原文地址:https://www.cnblogs.com/tonggc1668/p/11971567.html
Copyright © 2020-2023  润新知