@Override protected void configure() { // soft assertion aspect SoftAssertionsAspect softAssertAspect = new SoftAssertionsAspect(); requestInjection(softAssertAspect); bindInterceptor(Matchers.any(), Matchers.annotatedWith(When.class), softAssertAspect); bindInterceptor(Matchers.any(), Matchers.annotatedWith(Then.class), softAssertAspect); bindInterceptor(Matchers.any(), Matchers.annotatedWith(And.class), softAssertAspect); bindInterceptor(Matchers.any(), Matchers.annotatedWith(But.class), softAssertAspect); bindInterceptor(Matchers.any(), Matchers.annotatedWith(Given.class), softAssertAspect); }
@Test public void qualified_step_pattern_should_match_regular_steps__en() { assertThat(Given.class.getName()).matches(STEP_KEYWORD_QUALIFIED_NAME.pattern()); assertThat(When.class.getName()).matches(STEP_KEYWORD_QUALIFIED_NAME.pattern()); assertThat(Then.class.getName()).matches(STEP_KEYWORD_QUALIFIED_NAME.pattern()); assertThat(And.class.getName()).matches(STEP_KEYWORD_QUALIFIED_NAME.pattern()); assertThat(But.class.getName()).matches(STEP_KEYWORD_QUALIFIED_NAME.pattern()); }
@But("^'(.*)' has not '(.*)' notification from '(.*)'$") public void user_has_not_notificationTypes_notification_from_selectedServices(String userId, List<FileEventNotification.Type> types, List<String> servicesId) throws Throwable { servicesId.stream().forEach(serviceId -> user_has_not_notificationTypes_notification(userId, types, serviceId)); }
@But("persist userId variable") public void persistUserId() { variables.put("userId", user.getId()); }
@But("persist id variable") public void persistId() { LOGGER.info("Try find id from " + response.asString()); String id = response.jsonPath().getString("id"); variables.put("id", id); }