-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2007 from skjolber/emptyObfuscateJsonBodyFields
Return 'none' body filter if list of to-be-filtered JSON field-names is empty
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...toconfigure/src/test/java/org/zalando/logbook/autoconfigure/ObfuscateBodyDefaultTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.zalando.logbook.autoconfigure; | ||
|
||
import org.json.JSONException; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.zalando.logbook.BodyFilter; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@LogbookTest | ||
class ObfuscateBodyDefaultTest { | ||
|
||
@Autowired | ||
@Qualifier("jsonBodyFieldsFilter") | ||
private BodyFilter jsonBodyFieldsFilter; | ||
|
||
@Test | ||
void shouldNotFilterJsonBodiesIfEmptyObfuscateJsonBodyFieldNames() throws IOException, JSONException { | ||
assertThat(jsonBodyFieldsFilter).isSameAs(BodyFilter.none()); | ||
} | ||
|
||
} |