@@ -47,7 +47,8 @@ void saveGossipMessageDecodingError_shouldSaveToFile(@TempDir Path tempDir) {
47
47
final String topic = "test_topic" ;
48
48
manager .saveGossipMessageDecodingError ("test_topic" , arrivalTimestamp , messageBytes );
49
49
50
- final String fileName = String .format ("%s.ssz" , manager .formatTimestamp (arrivalTimestamp ));
50
+ final String fileName =
51
+ String .format ("%s.ssz" , manager .formatOptionalTimestamp (arrivalTimestamp ));
51
52
final Path expectedFile =
52
53
tempDir
53
54
.resolve ("gossip_messages" )
@@ -65,7 +66,8 @@ void saveGossipMessageDecodingError_shouldNotSaveToFileWhenDisabled(@TempDir Pat
65
66
manager .saveGossipMessageDecodingError ("test_topic" , arrivalTimestamp , messageBytes );
66
67
assertThat (manager .isEnabled ()).isFalse ();
67
68
68
- final String fileName = String .format ("%s.ssz" , manager .formatTimestamp (arrivalTimestamp ));
69
+ final String fileName =
70
+ String .format ("%s.ssz" , manager .formatOptionalTimestamp (arrivalTimestamp ));
69
71
final Path expectedFile =
70
72
tempDir .resolve ("gossip_messages" ).resolve ("decoding_error" ).resolve (fileName );
71
73
checkFileNotExist (expectedFile );
@@ -79,7 +81,8 @@ void saveGossipRejectedMessageToFile_shouldSaveToFile(@TempDir Path tempDir) {
79
81
final String topic = "test_topic" ;
80
82
manager .saveGossipRejectedMessageToFile ("test_topic" , arrivalTimestamp , messageBytes );
81
83
82
- final String fileName = String .format ("%s.ssz" , manager .formatTimestamp (arrivalTimestamp ));
84
+ final String fileName =
85
+ String .format ("%s.ssz" , manager .formatOptionalTimestamp (arrivalTimestamp ));
83
86
final Path expectedFile =
84
87
tempDir .resolve ("gossip_messages" ).resolve ("rejected" ).resolve (topic ).resolve (fileName );
85
88
checkBytesSavedToFile (expectedFile , messageBytes );
@@ -158,15 +161,15 @@ void constructionOfDirectories_shouldDisableWhenFailedToCreate(@TempDir Path tem
158
161
void formatTimestamp_shouldFormatDate () {
159
162
final DebugDataDumper manager = new DebugDataDumper (Path .of ("." ), true );
160
163
final String formattedTimestamp =
161
- manager .formatTimestamp (Optional .of (timeProvider .getTimeInMillis ()));
164
+ manager .formatOptionalTimestamp (Optional .of (timeProvider .getTimeInMillis ()));
162
165
assertThat (formattedTimestamp ).isEqualTo ("1970-01-01T12:46:40.00" );
163
166
}
164
167
165
168
@ Test
166
- void formatTimestamp_shouldReturnConsistentUnknown () {
169
+ void generateTimestamp_shouldGenerateTimestamp () {
167
170
final DebugDataDumper manager = new DebugDataDumper (Path .of ("." ), true );
168
- final String formattedTimestamp = manager .formatTimestamp ( Optional . empty () );
169
- assertThat (formattedTimestamp ).isEqualTo ("unknown " );
171
+ final String formattedTimestamp = manager .generateTimestamp ( timeProvider );
172
+ assertThat (formattedTimestamp ).isEqualTo ("1970-01-01T12:46:40.00 " );
170
173
}
171
174
172
175
private void checkBytesSavedToFile (final Path path , final Bytes expectedBytes ) {
0 commit comments