@Test
void filterJSONWithOneMaskField() {

    var param = new BytesLogParam(null, null);
    // language=json
    var value = "{\"field1\": \"value1\",\n  \"password\" : \"pass123\",\n  \"field2\": \"value2\"\n}";
    assertThat(param.filter(value, Set.of("password", "passwordConfirm")).toString())
            .isEqualTo("{\"field1\": \"value1\",\n  \"password\" : \"******\",\n  \"field2\": \"value2\"\n}");
    value = "{\"field1\": \"value1\", \"password\": null, \"field2\": null, \"field3\": null}";
    assertThat(param.filter(value, Set.of("password", "passwordConfirm")).toString())
            .isEqualTo(value);
    value = "{\"field1\": \"value1\", \"password\": {\"field2\": null}}";
    assertThat(param.filter(value, Set.of("password", "passwordConfirm")).toString())
            .isEqualTo(value);
    value = "{\"field1\": [\"secret1\", \"secret2\", \"secret3\"], \"field2\": \"value\"}";
    assertThat(param.filter(value, Set.of("secret1", "secret2", "secret3")).toString())
            .isEqualTo(value);
}