File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
main/java/com/google/protobuf
test/java/com/google/protobuf Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ private TextFormat() {}
42
42
private static final String ENABLE_INSERT_SILENT_MARKER_ENV_NAME =
43
43
"SILENT_MARKER_INSERTION_ENABLED" ;
44
44
private static final boolean ENABLE_INSERT_SILENT_MARKER =
45
- "true" . equals ( System .getenv (ENABLE_INSERT_SILENT_MARKER_ENV_NAME ) );
45
+ System .getenv (). getOrDefault ( ENABLE_INSERT_SILENT_MARKER_ENV_NAME , "false" ). equals ( "true" );
46
46
47
47
private static final String REDACTED_MARKER = "[REDACTED]" ;
48
48
Original file line number Diff line number Diff line change 12
12
13
13
@ RunWith (JUnit4 .class )
14
14
public final class ProtobufToStringOutputTest extends DebugFormatTest {
15
+ private static final String SILENT_MARKER = "" ;
16
+
15
17
RedactedFields .Builder messageBuilder ;
16
18
RedactedFields message ;
17
19
@@ -31,7 +33,7 @@ public void setupTest() {
31
33
public void toStringFormat_defaultFormat () {
32
34
assertThat (message .toString ())
33
35
.matches (
34
- "optional_redacted_string: \" bar\" \n "
36
+ "optional_redacted_string: " + SILENT_MARKER + " \" bar\" \n "
35
37
+ "optional_unredacted_string: \" foo\" \n "
36
38
+ "optional_redacted_message \\ {\n "
37
39
+ " optional_unredacted_nested_string: \" foobar\" \n "
@@ -107,7 +109,7 @@ public void toStringFormat_testProtoWrapperWithTextFormat() {
107
109
public void builderToStringFormat_defaultFormat () {
108
110
assertThat (messageBuilder .toString ())
109
111
.matches (
110
- "optional_redacted_string: \" bar\" \n "
112
+ "optional_redacted_string: " + SILENT_MARKER + " \" bar\" \n "
111
113
+ "optional_unredacted_string: \" foo\" \n "
112
114
+ "optional_redacted_message \\ {\n "
113
115
+ " optional_unredacted_nested_string: \" foobar\" \n "
You can’t perform that action at this time.
0 commit comments