You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an enhancement suggestion. I would like to be able to set a filter to do nothing; below I will explain the reason for this.
In my code, I need to be able to select different filters at runtime. The code is as follows:
public static List<Filter> getRestAssuredFilters() {
//Pass in the log level via system property, e.g. -DlogLevel=ERROR
// Set a default
if ((logLevel == null) || logLevel.isBlank()) {
logLevel = "ERROR";
}
if (logLevel.equals("ERROR")) {
restAssuredFilters.add(new ErrorLoggingFilter());
}
else if (logLevel.equals("DEBUG")){
restAssuredFilters.add(new RequestLoggingFilter(LogDetail.ALL));
restAssuredFilters.add(new ResponseLoggingFilter(LogDetail.ALL));
}
return restAssuredFilters;
}
}
The log level can be selected by a system property as noted in the comment above.
However, there are times when I would like to suppress all logging, or suppress the global filter in favor of a local log statement that is created for an individual test. For example, when I want to turn off the Error logging for tests which purposely return an error code, and instead set log().ifValidationFails().
There seems to be, as far as I can tell, no way to do this in Rest Assured.
In summary, I would like to be able to set a filter to None (or null or something similar), effectively disabling the filter so that I can do something else inside of a test.
The text was updated successfully, but these errors were encountered:
I have an enhancement suggestion. I would like to be able to set a filter to do nothing; below I will explain the reason for this.
In my code, I need to be able to select different filters at runtime. The code is as follows:
The log level can be selected by a system property as noted in the comment above.
However, there are times when I would like to suppress all logging, or suppress the global filter in favor of a local log statement that is created for an individual test. For example, when I want to turn off the Error logging for tests which purposely return an error code, and instead set log().ifValidationFails().
There seems to be, as far as I can tell, no way to do this in Rest Assured.
In summary, I would like to be able to set a filter to None (or null or something similar), effectively disabling the filter so that I can do something else inside of a test.
The text was updated successfully, but these errors were encountered: