zoukankan      html  css  js  c++  java
  • @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);
        }
      }
  • 相关阅读:
    投资理财知识小结1
    iOS中异常处理机制使用小结
    iOS中NSBundle使用小结
    ant design vue a-cascader 级联选择器 数据回显
    hbase数据存储及数据访问原理
    第15章: Prometheus监控Kubernetes资源与应用
    第14章:部署Java网站项目案例
    第13章:Kubernetes 鉴权框架与用户权限分配
    第12章:有状态应用部署
    第11章:Pod数据持久化
  • 原文地址:https://www.cnblogs.com/tonggc1668/p/11971567.html
Copyright © 2011-2022 走看看