• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Fixtures类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.axonframework.test.Fixtures的典型用法代码示例。如果您正苦于以下问题:Java Fixtures类的具体用法?Java Fixtures怎么用?Java Fixtures使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Fixtures类属于org.axonframework.test包,在下文中一共展示了Fixtures类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {

    // setup predefined events
    serviceInstanceCreatedEvent = new ServiceInstanceCreated(anOrganizationId, serviceSpecificationId, serviceInstanceId, A_NAME, A_SUMMARY, A_COVERAGE, A_SERVICE_TYPE);
    serviceSpecificationCreatedEvent = new ServiceSpecificationCreated(anOrganizationId, serviceSpecificationId, A_SERVICE_TYPE, A_NAME, A_SUMMARY);
    organizationCreatedEvent = new OrganizationCreated(anOrganizationId, AN_ALIAS, A_NAME, A_SUMMARY, A_URL);

    // Setup a fixture with an OrganizationCommandHandler with mocked 
    // organization- and serviceSpecification repositories and aggregates
    fixture = Fixtures.newGivenWhenThenFixture(ServiceInstance.class);
    Organization anOrganization = new Organization(generateCreateOrganizationCommand(AN_ORG_ID));
    ServiceSpecification serviceSpecification = new ServiceSpecification(anOrganizationId, serviceSpecificationId, A_SERVICE_TYPE, A_NAME, A_SUMMARY);
    OrganizationCommandHandler commandHandler = new OrganizationCommandHandler();
    commandHandler.setOrganizationRepository(new RepositoryMock(anOrganization));
    commandHandler.setServiceSpecificationRepository(new RepositoryMock(serviceSpecification));
    commandHandler.setServiceInstanceRepository(fixture.getRepository());
    fixture.registerAnnotatedCommandHandler(commandHandler);

}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:21,代码来源:ServiceInstanceTest.java


示例2: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() {
    fixture = Fixtures.newGivenWhenThenFixture(DeliveryDay.class);
    DeliveryDayCommandHandler commandHandler = new DeliveryDayCommandHandler(fixture.getRepository());
    fixture.registerAnnotatedCommandHandler(commandHandler);

    deliveryDayId = DeliveryDayId.generate();
    orderId = OrderId.generate();
    tomorrow = LocalDate.now().plusDays(1);
}
 
开发者ID:psamatt,项目名称:OrderFulfilmentCQRSDemo,代码行数:11,代码来源:DeliveryDayCommandHandlerTest.java


示例3: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    // set up the encryptor here
    PasswordEncryptor passwordEncryptor = new TestPasswordEncryptor();

    fixture = Fixtures.newGivenWhenThenFixture(UserAggregate.class);
    UserCommandHandler commandHandler = new UserCommandHandler(fixture.getRepository(), mock(UserRepository.class), passwordEncryptor);
    fixture.registerAnnotatedCommandHandler(commandHandler);
    fixture.setReportIllegalStateChange(false);
}
 
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:11,代码来源:UserCommandHandlerTest.java


示例4: setup

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setup() {

    fixture = Fixtures.newGivenWhenThenFixture(UserAggregate.class);

    UserCommandHandler commandHandler = new UserCommandHandler(fixture.getRepository(), userQueryRepository, new StrongPasswordEncryptor());
    fixture.registerAnnotatedCommandHandler(commandHandler);

    this.mockMvc = MockMvcBuilders
            .webAppContextSetup(this.wac)
            .addFilters(springSessionRepositoryFilter, springSecurityFilterChain)
            .build();
}
 
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:14,代码来源:FacebookControllerTest.java


示例5: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() {
    anOrganization = new Organization(generateCreateOrganizationCommand(AN_ORG_ID)) {

        @Override
        public boolean isDeleted() {
            return mockDeleted ? true : super.isDeleted(); //To change body of generated methods, choose Tools | Templates.
        }

    };
    serviceSpecification = new ServiceSpecification(anOrganizationId, serviceSpecificationId, A_SERVICE_TYPE, A_NAME, A_SUMMARY);

    // Setup a fixture with an OrganizationCommandHandler with mocked 
    // organization repository and aggregate
    fixtureServiceSpecification = Fixtures.newGivenWhenThenFixture(ServiceSpecification.class);
    commandHandler = new OrganizationCommandHandler();
    commandHandler.setOrganizationRepository(new RepositoryMock(anOrganization));
    commandHandler.setServiceSpecificationRepository(fixtureServiceSpecification.getRepository());
    commandHandler.setServiceInstanceRepository(null);
    fixtureServiceSpecification.registerAnnotatedCommandHandler(commandHandler);

    // Setup a fixture with an OrganizationCommandHandler with mocked 
    // organization- and serviceSpecification repositories and aggregates
    fixtureServiceInstance = Fixtures.newGivenWhenThenFixture(ServiceInstance.class);
    commandHandler = new OrganizationCommandHandler();
    commandHandler.setOrganizationRepository(new RepositoryMock(anOrganization));
    commandHandler.setServiceSpecificationRepository(new RepositoryMock(serviceSpecification));
    commandHandler.setServiceInstanceRepository(fixtureServiceInstance.getRepository());
    fixtureServiceInstance.registerAnnotatedCommandHandler(commandHandler);
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:31,代码来源:OrganizationCommandHandlerTest.java


示例6: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    fixture = Fixtures.newGivenWhenThenFixture(Organization.class);

    // just some ugly mocking for the organization alias test : (
    ApplicationContext applicationContext = Mockito.mock(ApplicationContext.class);
    mockedAliasService = Mockito.mock(AliasService.class);
    new ApplicationContextProvider().setApplicationContext(applicationContext);
    when(applicationContext.getBean("aliasService")).thenReturn(mockedAliasService);

}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:12,代码来源:OrganizationTest.java


示例7: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() {
    fixture = Fixtures.newGivenWhenThenFixture(Membership.class);
    Organization anOrganization = new Organization(generateCreateOrganizationCommand(AN_ORG_ID)) {
        @Override
        public boolean isDeleted() {
            return false;
        }
    };
    organizationCommandHandler.setOrganizationRepository(new RepositoryMock(anOrganization));
    organizationCommandHandler.setMembershipRepository(fixture.getRepository());
    membershipQueryRepository = Mockito.mock(OrganizationMembershipQueryRepository.class);
    organizationCommandHandler.setMembershipQueryRepository(membershipQueryRepository);
            fixture.registerAnnotatedCommandHandler(organizationCommandHandler);
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:16,代码来源:MembershipTest.java


示例8: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    fixture = Fixtures.newGivenWhenThenFixture(User.class);

    MockitoAnnotations.initMocks(this);
    Mockito.when(applicationContext.getBean("encryptionService")).thenReturn(new SHA512EncryptionService());
    new ApplicationContextProvider().setApplicationContext(applicationContext);
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:9,代码来源:UserTest.java


示例9: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    fixture = Fixtures.newGivenWhenThenFixture(Book.class);
    BookCommandHandler handler = new BookCommandHandler(fixture.getRepository());
    fixture.registerAnnotatedCommandHandler(handler);
    bookId = IdentifierFactory.getInstance().generateIdentifier();
}
 
开发者ID:rvillars,项目名称:bookapp-cqrs,代码行数:8,代码来源:BookEventTest.java


示例10: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    fixture = Fixtures.newGivenWhenThenFixture(Author.class);
    AuthorCommandHandler handler = new AuthorCommandHandler(fixture.getRepository());
    fixture.registerAnnotatedCommandHandler(handler);
    authorId = IdentifierFactory.getInstance().generateIdentifier();
}
 
开发者ID:rvillars,项目名称:bookapp-cqrs,代码行数:8,代码来源:AuthorEventTest.java


示例11: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    fixture = Fixtures.newGivenWhenThenFixture(ProductAggregate.class);
}
 
开发者ID:benwilcock,项目名称:cf-cqrs-microservice-sampler,代码行数:5,代码来源:ProductAggregateTest.java


示例12: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() {
    fixture = Fixtures.newGivenWhenThenFixture(Order.class);
    OrderCommandHandler commandHandler = new OrderCommandHandler(fixture.getRepository());
    fixture.registerAnnotatedCommandHandler(commandHandler);
}
 
开发者ID:psamatt,项目名称:OrderFulfilmentCQRSDemo,代码行数:7,代码来源:OrderCommandHandlerTest.java


示例13: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() {
    fixture = Fixtures.newGivenWhenThenFixture(StoreAssistant.class);
    StoreAssistantCommandHandler commandHandler = new StoreAssistantCommandHandler(fixture.getRepository());
    fixture.registerAnnotatedCommandHandler(commandHandler);
}
 
开发者ID:psamatt,项目名称:OrderFulfilmentCQRSDemo,代码行数:7,代码来源:StoreAssistantCommandHandlerTest.java


示例14: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() {
	fixture = Fixtures.newGivenWhenThenFixture(Library.class);
}
 
开发者ID:yizhuan,项目名称:library-saga,代码行数:5,代码来源:LibraryTest.java


示例15: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    fixture = Fixtures.newGivenWhenThenFixture(ToDoItem.class);
}
 
开发者ID:benwilcock,项目名称:axon-cqrs-sample,代码行数:5,代码来源:ToDoItemTest.java


示例16: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
    public void setUp() {
        fixture = Fixtures.newGivenWhenThenFixture(Rating.class);
//        MyCommandHandler myCommandHandler = new MyCommandHandler(fixture.createGenericRepository(MyAggregate.class));
//        fixture.registerAnnotatedCommandHandler(myCommandHandler);
    }
 
开发者ID:tipsy,项目名称:twistrating,代码行数:7,代码来源:TwistRatingTest.java


示例17: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    fixture = Fixtures.newGivenWhenThenFixture(ToDoItemAggregate.class);
    ToDoCommandHandler commandHandler = new ToDoCommandHandler(fixture.getRepository());
    fixture.registerAnnotatedCommandHandler(commandHandler);
}
 
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:7,代码来源:ToDoCommandHandlerTest.java


示例18: setUp

import org.axonframework.test.Fixtures; //导入依赖的package包/类
@Before
public void setUp() {
    fixture = Fixtures.newGivenWhenThenFixture(ServiceSpecification.class);
    fixture.registerInjectableResource(fixture.getRepository());
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:6,代码来源:ServiceSpecificationTest.java



注:本文中的org.axonframework.test.Fixtures类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ZooInspectorIconResources类代码示例发布时间:2022-05-23
下一篇:
Java ForgeDummyContainer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap