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

Java PactVerification类代码示例

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

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



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

示例1: get_serval

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@PactVerification("test_provider")
@Test
public void get_serval() throws IOException {
    AnimalServiceClient providerRestClient = new AnimalServiceClient();
    Animals response = providerRestClient.getAnimalInformation("http://localhost:1234", "serval");
    assertThat(response.getAnimals().get(0).getName(), is("サーバルちゃん"));
}
 
开发者ID:azusa,项目名称:pact-jvm-example,代码行数:8,代码来源:AnimalServiceClient.java


示例2: shouldGetValidatedEidasAuthnResponseFromSamlEngineVerification

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@PactVerification(value = SAML_ENGINE_SERVICE, fragment = "shouldGetValidatedEidasAuthnResponseFromSamlEngine")
@Test
public void shouldGetValidatedEidasAuthnResponseFromSamlEngineVerification() throws Exception {
    configStub.setupStubForEidasRPCountries(TEST_RP, EIDAS_COUNTRIES.stream().map(EidasCountryDto::getEntityId).collect(Collectors.toList()));
    SessionId sessionId = createSessionInCountrySelectingState();
    selectACountry(sessionId);

    Response response = postAuthnResponseToPolicy(sessionId);

    assertThatResponseIsSuccess(response);
    assertThatAQRReceivedBySamlSoapProxyHasSameDataAsSamlEngineSent();
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:13,代码来源:EidasSessionResourceContractTest.java


示例3: getsNullWhenNoCustomerFound

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification
public void getsNullWhenNoCustomerFound() throws IOException {
    CustomerSession customerSession = userService.validateCustomerSession(sessionId);

    assertThat(customerSession, is(nullValue()));
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:8,代码来源:AuthenticationCommandValidationFailedTest.java


示例4: validatesCustomerWithSessionId

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification
public void validatesCustomerWithSessionId() throws IOException {
    CustomerSession actual = userService.validateCustomerSession(customerSessionInfo.getId());

    assertThat(actual, is(customerSessionInfo));
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:8,代码来源:AuthenticationCommandValidationTest.java


示例5: fetchesExpectedCustomer

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification
public void fetchesExpectedCustomer() throws IOException {
    try {
        userService.getCustomerInfo("mike");
        expectFailing(NoSuchElementException.class);
    } catch (NoSuchElementException e) {
        assertThat(e.getMessage(), is("No such customer with id mike"));
    }
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:11,代码来源:UserCommandFetchingCustomerFailedTest.java


示例6: fetchesExpectedCustomer

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification
public void fetchesExpectedCustomer() throws IOException {
    CustomerInfo actual = userService.getCustomerInfo(customerInfo.getId());

    assertThat(actual, is(customerInfo));
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:8,代码来源:UserCommandTest.java


示例7: blowsUpWhenRemoteIsNotAvailable

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification
public void blowsUpWhenRemoteIsNotAvailable() throws IOException {
    try {
        customerLoader.loadCustomers(5);
        expectFailing(RuntimeException.class);
    } catch (RuntimeException e) {
        assertThat(e.getMessage(), is("Remote customer loader returns status code 500"));
    }
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:11,代码来源:RemoteCustomerLoaderFailedTest.java


示例8: validatesUserToken

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@PactVerification
@Test
public void validatesUserToken() {
  when(serviceInstance.getUri()).thenReturn(URI.create(providerRule.getConfig().url()));

  ResponseEntity<String> responseEntity = authenticationService.validate(token);

  assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.FORBIDDEN);
}
 
开发者ID:ServiceComb,项目名称:ServiceComb-Company-WorkShop,代码行数:10,代码来源:AuthenticationServiceFailedTest.java


示例9: validatesUserToken

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@PactVerification
@Test
public void validatesUserToken() {
  when(serviceInstance.getUri()).thenReturn(URI.create(providerRule.getConfig().url()));

  ResponseEntity<String> responseEntity = authenticationService.validate(token);

  assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
  assertThat(responseEntity.getBody()).isEqualTo(username);
}
 
开发者ID:ServiceComb,项目名称:ServiceComb-Company-WorkShop,代码行数:11,代码来源:AuthenticationServiceHappyTest.java


示例10: should_process_the_json_payload_from_provider

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification("our_provider")
public void should_process_the_json_payload_from_provider() {
  TestObserver<ServiceResponse> observer = service.fetchResponse(DATE_TIME).test();
  observer.assertNoErrors();
  observer.assertValue(new ServiceResponse(null, Collections.emptyList()));
}
 
开发者ID:DiUS,项目名称:pact-workshop-android,代码行数:8,代码来源:ServiceNoContentPactTest.java


示例11: should_process_the_json_payload_from_provider

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification("our_provider")
public void should_process_the_json_payload_from_provider() {
  TestObserver<ServiceResponse> observer = service.fetchResponse(DATE_TIME).test();
  observer.assertNoErrors();
  observer.assertValue(ServiceResponse.create(DATE_TIME, Arrays.asList(
      Animal.create("Doggy", "dog"),
      Animal.create("Doggy", "dog"),
      Animal.create("Doggy", "dog")
  )));
}
 
开发者ID:DiUS,项目名称:pact-workshop-android,代码行数:12,代码来源:ServicePactTest.java


示例12: createSpecialMembershipToTonyStark

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@PactVerification(value = CREDIT_SCORE_SERVICE, fragment = "tonyStarkCreditScore")
@Test
public void createSpecialMembershipToTonyStark() throws Exception {
    Map<String, Object> specialMembershipDto = singletonMap("email", "[email protected]");
    Response response = resourcesClient.postSpecialMembership(specialMembershipDto);
    response.close();
    assertThat(response.getStatus(), equalTo(200));
}
 
开发者ID:andreschaffer,项目名称:microservices-testing-examples,代码行数:9,代码来源:CreditScoreServicePactIT.java


示例13: denySpecialMembershipToHawleyGriffin

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@PactVerification(value = CREDIT_SCORE_SERVICE, fragment = "hawleyGriffinCreditScore")
@Test
public void denySpecialMembershipToHawleyGriffin() throws Exception {
    Map<String, Object> specialMembershipDto = singletonMap("email", "[email protected]");
    Response response = resourcesClient.postSpecialMembership(specialMembershipDto);
    response.close();
    assertThat(response.getStatus(), equalTo(403));
}
 
开发者ID:andreschaffer,项目名称:microservices-testing-examples,代码行数:9,代码来源:CreditScoreServicePactIT.java


示例14: sendWelcomeEmailToTonyStark

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@PactVerification(value = SPECIAL_MEMBERSHIP_SERVICE, fragment = "newMemberTonyStark")
@Test
public void sendWelcomeEmailToTonyStark() throws Exception {
    String memberSignedUpEvent = new String(specialMembershipServiceRule.getMessage(), UTF_8);
    publishMembershipMessageAndWaitToBeConsumed(memberSignedUpEvent);
    assertAnEmailWasSent();
}
 
开发者ID:andreschaffer,项目名称:microservices-testing-examples,代码行数:8,代码来源:MemberSignedUpEventPactIT.java


示例15: downloadPactFromBroker

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification("one-pact-present")
public void downloadPactFromBroker() throws Exception {
    File pactFoder = new File(temporaryFolder.newFolder() + "/target/pacts-dependents");

    brokerRepositoryProvider.downloadPactsFromLinks(Collections.singletonList(pactLink), pactFoder);

    assertThat(
            new File(pactFoder.getAbsoluteFile() + "/" + CONSUMER_NAME + "-" + PROVIDER_NAME + ".json").exists(),
            is(true));
}
 
开发者ID:warmuuh,项目名称:pactbroker-maven-plugin,代码行数:12,代码来源:BrokerRepositoryProviderTest.java


示例16: downloadProviderPactInformation

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification("one-provider-pact-link-present")
public void downloadProviderPactInformation() throws Exception {
    List<String> links = brokerRepositoryProvider.downloadPactLinks(PROVIDER_NAME, null);

    assertThat(links.size(), is(1));
    assertThat(links.get(0), is(pactLink));
}
 
开发者ID:warmuuh,项目名称:pactbroker-maven-plugin,代码行数:9,代码来源:BrokerRepositoryProviderTest.java


示例17: downloadProviderPactInformationForProdTag

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification("one-prod-provider-pact-link-present")
public void downloadProviderPactInformationForProdTag() throws Exception {
    List<String> links = brokerRepositoryProvider.downloadPactLinks(PROVIDER_NAME, "prod");

    assertThat(links.size(), is(1));
    assertThat(links.get(0), is(pactLink));
}
 
开发者ID:warmuuh,项目名称:pactbroker-maven-plugin,代码行数:9,代码来源:BrokerRepositoryProviderTest.java


示例18: doNotFailDownloadForProviderWithNoPactLinkPresent

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification("provider-no-pact-link-present")
public void doNotFailDownloadForProviderWithNoPactLinkPresent() throws Exception {
    List<String> links = brokerRepositoryProvider.downloadPactLinks("provider-no-pact-link-present", null);

    assertThat(links.size(), is(0));
}
 
开发者ID:warmuuh,项目名称:pactbroker-maven-plugin,代码行数:8,代码来源:BrokerRepositoryProviderTest.java


示例19: requestsRemoteToLoadCustomers

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification
public void requestsRemoteToLoadCustomers() throws IOException {
    customerLoader.loadCustomers(5);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:6,代码来源:RemoteCustomerLoaderTest.java


示例20: should_process_the_json_payload_from_provider

import au.com.dius.pact.consumer.PactVerification; //导入依赖的package包/类
@Test
@PactVerification("our_provider")
public void should_process_the_json_payload_from_provider() {
  TestObserver<ServiceResponse> observer = service.fetchResponse(null).test();
  observer.assertError(BadRequestException.class);
}
 
开发者ID:DiUS,项目名称:pact-workshop-android,代码行数:7,代码来源:ServiceMissingQueryPactTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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