public boolean getBoolean(String key) { return getBoolean(key, false); }
public void assertMessageBodyContainsArrayWithEntryHavingValue(String path, String value) { boolean caseInsensitive = globalWorldFacade.getBoolean("case-insensitive"); assertThat(message, containsValueByPathInArray(MessageWrapperContentProvider.INSTANCE, path, equalToIgnoringType(value, caseInsensitive))); }
public void assertMessageContainsPropertyWithValue(String path, String value) { boolean caseInsensitive = globalWorldFacade.getBoolean("case-insensitive"); assertThat(message, containsValueByPath(MessageWrapperContentProvider.INSTANCE, path, equalToIgnoringType(value, caseInsensitive))); }
@Before public void beforeLoadRunnerScenario() { boolean filterEnabled = world.getBoolean(CukesOptions.LOADRUNNER_FILTER_BLOCKS_REQUESTS); if (filterEnabled) { requestFacade.initNewSpecification(); } }
@Override public Response filter(FilterableRequestSpecification requestSpec, FilterableResponseSpecification responseSpec, FilterContext ctx) { WebCustomRequest request = mapper.map(requestSpec); trx.addFunction(request); boolean blockRequests = globalWorldFacade.getBoolean(CukesOptions.LOADRUNNER_FILTER_BLOCKS_REQUESTS); if (blockRequests) { Response response = Mockito.mock(Response.class); Mockito.when(response.then()).thenReturn(Mockito.mock(ValidatableResponse.class)); return response; } return ctx.next(requestSpec, responseSpec); }
public String inflate(String input) { Set<String> groups = new HashSet<String>(extractGroups(input)); boolean inflatingEnabled = world.getBoolean(CukesOptions.CONTEXT_INFLATING_ENABLED, true); if (inflatingEnabled) { return inflateGroups(input, groups); } return inflateGroupsWithPlaceholders(input, groups); }
public void shouldWaitWithIntervalUntilPropertyEqualToValue(Time waitTime, Time interval, String property, String value, String failValue) { this.awaitCondition = new AwaitCondition(waitTime, interval, aProperty(property, EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive"))), aProperty(property, EqualToIgnoringTypeMatcher.equalToIgnoringType(failValue, this.world.getBoolean("case-insensitive")))); }
public void shouldWaitWithIntervalUntilPropertyEqualToValue(Time waitTime, Time interval, String property, String value, String failValue) { this.awaitCondition = new AwaitCondition(waitTime, interval, aProperty(property, EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive"))), aProperty(property, EqualToIgnoringTypeMatcher.equalToIgnoringType(failValue, this.world.getBoolean("case-insensitive")))); }
public void shouldWaitWithIntervalUntilPropertyEqualToValue(Time waitTime, Time interval, String property, String value) { this.awaitCondition = new AwaitCondition(waitTime, interval, aProperty(property, EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
public void shouldWaitWithIntervalUntilPropertyEqualToValue(Time waitTime, Time interval, String property, String value) { this.awaitCondition = new AwaitCondition(waitTime, interval, aProperty(property, EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
@Override public void statusCodeIs(final int statusCode) { final boolean appendBody = world.getBoolean(CukesOptions.ASSERTS_STATUS_CODE_DISPLAY_BODY, false); final Integer maxSize = world.get(CukesOptions.ASSERTS_STATUS_CODE_MAX_SIZE).transform(new Function<String, Integer>() { @Override public Integer apply(String s) { return Integer.parseInt(s); } }).orNull(); final Response response = facade.response(); response.then().statusCode(new StatusCodeMatcher(statusCode, response, appendBody, maxSize)); }
@Override public void statusCodeIs(final int statusCode) { final boolean appendBody = world.getBoolean(CukesOptions.ASSERTS_STATUS_CODE_DISPLAY_BODY, false); final Integer maxSize = world.get(CukesOptions.ASSERTS_STATUS_CODE_MAX_SIZE).transform(new Function<String, Integer>() { @Override public Integer apply(String s) { return Integer.parseInt(s); } }).orNull(); final Response response = facade.response(); response.then().statusCode(new StatusCodeMatcher(statusCode, response, appendBody, maxSize)); }
@Override public void bodyContainsPathWithValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
@Override public void bodyContainsArrayWithEntryHavingValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
@Override public void bodyContainsArrayWithObjectHavingProperty(String path, String property, String value) { Response response = this.facade.response(); assertThat(response, containsPropertyValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), property, equalToIgnoringType(value, this.world.getBoolean("case-insensitive"))) ); }
@Override public void bodyContainsArrayWithEntryHavingValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
@Override public void bodyContainsArrayWithObjectHavingProperty(String path, String property, String value) { Response response = this.facade.response(); assertThat(response, containsPropertyValueByPathInArray(ResponseContentProvider.INSTANCE, getPath(path), property, equalToIgnoringType(value, this.world.getBoolean("case-insensitive"))) ); }
@Override public void bodyContainsPathWithValue(String path, String value) { Response response = this.facade.response(); assertThat(response, JsonMatchers.containsValueByPath(ResponseContentProvider.INSTANCE, getPath(path), EqualToIgnoringTypeMatcher.equalToIgnoringType(value, this.world.getBoolean("case-insensitive")))); }
private RestAssuredConfig buildRestAssuredConfig() { RestAssuredConfig config = newConfig().jsonConfig(jsonConfig().numberReturnType(JsonPathConfig.NumberReturnType.BIG_DECIMAL)) .redirect(redirectConfig().followRedirects(world.getBoolean(CukesOptions.FOLLOW_REDIRECTS, true))); if (!world.getBoolean(CukesOptions.GZIP_SUPPORT, true)) { config.decoderConfig(decoderConfig().contentDecoders(DEFLATE)); } config.sslConfig(new SSLConfig().allowAllHostnames()); return config; } }
private RestAssuredConfig buildRestAssuredConfig() { RestAssuredConfig config = newConfig() .jsonConfig(jsonConfig().numberReturnType(JsonPathConfig.NumberReturnType.BIG_DECIMAL)) .redirect(redirectConfig().followRedirects(world.getBoolean(CukesOptions.FOLLOW_REDIRECTS, true))); if(logStream != null) config = config.logConfig(logConfig().defaultStream(logStream)); if (!world.getBoolean(CukesOptions.GZIP_SUPPORT, true)) { config = config.decoderConfig(decoderConfig().contentDecoders(DEFLATE)); } config = config.sslConfig(new SSLConfig().allowAllHostnames()); return config; }