本文整理汇总了Java中au.com.dius.pact.consumer.PactVerification类的典型用法代码示例。如果您正苦于以下问题:Java PactVerification类的具体用法?Java PactVerification怎么用?Java PactVerification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PactVerification类属于au.com.dius.pact.consumer包,在下文中一共展示了PactVerification类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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("サーバルちゃん"));
}
示例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();
}
示例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()));
}
示例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));
}
示例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"));
}
}
示例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));
}
示例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"));
}
}
示例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()));
}
示例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")
)));
}
示例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));
}
示例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));
}
示例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();
}
示例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));
}