当前位置: 首页>>代码示例>>Java>>正文


Java State类代码示例

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


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

示例1: noSetUp

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State({"a forgotten password does not exists",
        "a user does not exist",
        "a user exists",
        "no user exits with the given name",
        "a user exits with the given name",
        "a valid (non-expired) forgotten password entry does not exist",
        "default",
        "a user exist",
        "a user exists with a given username password",
        "a user not exists with a given username password",
        "a user not exists with a given username password",
        "no user exits with the given external id",
        "a user exits with the given external id"
})
public void noSetUp() {
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:17,代码来源:UsersApiTest.java

示例2: customerLoaderIsAvailable

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("Remote customer loader is available")
public void customerLoaderIsAvailable() {
    CustomerAddressImpl address = Fixture.from(CustomerAddressImpl.class).gimme("valid");

    when(customerService.createAddress(
            anyString(),
            anyString(),
            anyString(),
            anyString(),
            anyString(),
            anyString()
    )).thenReturn(address);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:14,代码来源:CustomerServiceContractTest.java

示例3: customerLoaderIsNotAvailable

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("Remote customer loader is not available")
public void customerLoaderIsNotAvailable() {
    when(customerService.createAddress(
            anyString(),
            anyString(),
            anyString(),
            anyString(),
            anyString(),
            anyString()
    )).thenThrow(exception);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:12,代码来源:CustomerServiceContractTest.java

示例4: aUserExistsWithAForgottenPasswordRequest

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("a valid forgotten password entry and a related user exists")
public void aUserExistsWithAForgottenPasswordRequest() throws Exception {
    String code = "avalidforgottenpasswordtoken";
    String userExternalId = RandomIdGenerator.randomUuid();
    createUserWithinAService(userExternalId, randomAlphabetic(20), "password");
    List<Map<String, Object>> userByExternalId = dbHelper.findUserByExternalId(userExternalId);
    dbHelper.add(ForgottenPassword.forgottenPassword(code, userExternalId), (Integer) userByExternalId.get(0).get("id"));
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:9,代码来源:UsersApiTest.java

示例5: aForgottenPasswordEntryExist

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("a forgotten password entry exist")
public void aForgottenPasswordEntryExist() throws Exception {
    String code = "existing-code";
    String existingUserExternalId = "7d19aff33f8948deb97ed16b2912dcd3";
    List<Map<String, Object>> userByName = dbHelper.findUserByExternalId(existingUserExternalId);
    dbHelper.add(ForgottenPassword.forgottenPassword(code, existingUserExternalId), (Integer) userByName.get(0).get("id"));
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:8,代码来源:UsersApiTest.java

示例6: aUserAndUserAdminExistBeforeADelete

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("a user and user admin exists in service with the given ids before a delete operation")
public void aUserAndUserAdminExistBeforeADelete() throws Exception {

    String existingUserExternalId = "pact-delete-user-id";
    String existingUserRemoverExternalId = "pact-delete-remover-id";
    String existingServiceExternalId = "pact-delete-service-id";

    Service service = ServiceDbFixture.serviceDbFixture(dbHelper).withExternalId(existingServiceExternalId).insertService();
    Role role = RoleDbFixture.roleDbFixture(dbHelper).insertAdmin();

    UserDbFixture.userDbFixture(dbHelper).withExternalId(existingUserExternalId).withServiceRole(service, role.getId()).insertUser();
    UserDbFixture.userDbFixture(dbHelper).withExternalId(existingUserRemoverExternalId).withServiceRole(service, role.getId()).insertUser();
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:14,代码来源:UsersApiTest.java

示例7: aUserExistButRemoverBeforeADelete

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("a user exists but not the remover before a delete operation")
public void aUserExistButRemoverBeforeADelete() throws Exception {

    String existingUserExternalId = "pact-user-no-remover-test";
    String existingServiceExternalId = "pact-service-no-remover-test";

    Service service = ServiceDbFixture.serviceDbFixture(dbHelper).withExternalId(existingServiceExternalId).insertService();
    Role role = RoleDbFixture.roleDbFixture(dbHelper).insertAdmin();

    UserDbFixture.userDbFixture(dbHelper).withExternalId(existingUserExternalId).withServiceRole(service, role.getId()).insertUser();
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:12,代码来源:UsersApiTest.java

示例8: tonyStarkBecameANewMember

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("Tony Stark became a new member")
public void tonyStarkBecameANewMember() {
    String email = "[email protected]";
    creditScoreServiceRule.setCreditResponse(email,
        giveResponse("{\"creditScore\":850}", APPLICATION_JSON));
    Map<String, Object> specialMembershipDto = singletonMap("email", email);
    Response response = resourcesClient.postSpecialMembership(specialMembershipDto);
    response.close();
    assertThat(response.getStatus(), equalTo(200));
}
 
开发者ID:andreschaffer,项目名称:microservices-testing-examples,代码行数:11,代码来源:MessagePactsVerifications.java

示例9: stateChange

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("a serval exists")
public void stateChange() {}
 
开发者ID:azusa,项目名称:pact-jvm-example,代码行数:3,代码来源:AnimalContractTest.java

示例10: foundSpecifiedCustomer

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("Customer Sean is registered")
public void foundSpecifiedCustomer() {
    when(customerService.getCustomerByUsername(customer.getUsername())).thenReturn(customer);
    when(customerService.validateSession(customerSessionInfo.getId())).thenReturn(customerSessionInfo);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:6,代码来源:CustomerServiceContractTest.java

示例11: noSuchCustomerFound

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("No customer Mike found")
public void noSuchCustomerFound() {
    when(customerService.getCustomerByUsername("mike")).thenReturn(null);
    when(customerService.validateSession("session-mike-123")).thenReturn(null);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:6,代码来源:CustomerServiceContractTest.java

示例12: acceptAuthenticatedUser

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("User Sean is authorized")
public void acceptAuthenticatedUser() {
  when(authenticationService.validate("sean-token")).thenReturn("Sean");
}
 
开发者ID:ServiceComb,项目名称:ServiceComb-Company-WorkShop,代码行数:5,代码来源:AuthenticationContractTest.java

示例13: rejectUnknownUser

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("User Jack is unauthorized")
public void rejectUnknownUser() {
  when(authenticationService.validate("unknown-token"))
      .thenThrow(new UnauthorizedAccessException("No user matches such a token unknown-token"));
}
 
开发者ID:ServiceComb,项目名称:ServiceComb-Company-WorkShop,代码行数:6,代码来源:AuthenticationContractTest.java

示例14: toDefaultState

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("default")
public void toDefaultState() {
    System.out.println("Now service in default state");
}
 
开发者ID:whunmr,项目名称:spring-server,代码行数:5,代码来源:VerifyPactsTest.java

示例15: aUserExistsWithMaxLoginAttempts

import au.com.dius.pact.provider.junit.State; //导入依赖的package包/类
@State("a user exists with max login attempts")
public void aUserExistsWithMaxLoginAttempts() throws Exception {
    String username = "user-login-attempts-max";
    createUserWithinAService(RandomIdGenerator.randomUuid(), username, "password");
    dbHelper.updateLoginCount(username, 10);
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:7,代码来源:UsersApiTest.java


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