@@ -60,7 +60,6 @@ public void setUp() {
6060 MockitoAnnotations .initMocks (this );
6161 this .sinkConfig = Mockito .mock (BlobSinkConfig .class );
6262 Mockito .when (sinkConfig .getFilePartitionProtoTimestampTimezone ()).thenReturn (zone );
63- Mockito .when (sinkConfig .getFilePartitionProcessingTimeEnabled ()).thenReturn (false );
6463 Mockito .when (sinkConfig .getOutputKafkaMetadataColumnName ()).thenReturn ("" );
6564 Mockito .when (sinkConfig .getFilePartitionProtoTimestampFieldName ()).thenReturn (timeStampFieldName );
6665 Mockito .when (sinkConfig .getFilePartitionTimeGranularityType ()).thenReturn (Constants .FilePartitionType .HOUR );
@@ -72,7 +71,7 @@ public void setUp() {
7271 public void shouldCreateLocalFileWriter () throws Exception {
7372 Record record = Mockito .mock (Record .class );
7473 Mockito .when (record .getLocalDateTime (sinkConfig )).thenReturn (LocalDateTime .now ());
75- Mockito .when (record .getTimestamp (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (1L ));
74+ Mockito .when (record .getTimestampFromMessage (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (1L ));
7675 Mockito .when (record .getTopic ("" )).thenReturn (defaultTopic );
7776 Mockito .when (localFileWriter1 .getFullPath ()).thenReturn ("/tmp/test" );
7877 Mockito .when (localStorage .createLocalFileWriter (TimePartitionedPathUtils .getTimePartitionedPath (record , sinkConfig ))).thenReturn (localFileWriter1 );
@@ -87,15 +86,15 @@ public void shouldCreateLocalFileWriter() throws Exception {
8786 public void shouldCreateMultipleWriterBasedOnPartition () throws Exception {
8887 Record record1 = Mockito .mock (Record .class );
8988 Mockito .when (record1 .getLocalDateTime (sinkConfig )).thenReturn (LocalDateTime .ofInstant (Instant .ofEpochMilli (3600000L ), ZoneId .of (zone )));
90- Mockito .when (record1 .getTimestamp (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (3600000L ));
89+ Mockito .when (record1 .getTimestampFromMessage (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (3600000L ));
9190 Mockito .when (record1 .getTopic ("" )).thenReturn (defaultTopic );
9291 Mockito .when (localStorage .createLocalFileWriter (TimePartitionedPathUtils .getTimePartitionedPath (record1 , sinkConfig ))).thenReturn (localFileWriter1 );
9392 Mockito .when (localFileWriter1 .write (record1 )).thenReturn (true );
9493 Mockito .when (localFileWriter1 .getFullPath ()).thenReturn ("/tmp/test1" );
9594
9695 Record record2 = Mockito .mock (Record .class );
9796 Mockito .when (record2 .getLocalDateTime (sinkConfig )).thenReturn (LocalDateTime .ofInstant (Instant .ofEpochMilli (7200000L ), ZoneId .of (zone )));
98- Mockito .when (record2 .getTimestamp (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (7200000L ));
97+ Mockito .when (record2 .getTimestampFromMessage (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (7200000L ));
9998 Mockito .when (record2 .getTopic ("" )).thenReturn (defaultTopic );
10099 Mockito .when (localStorage .createLocalFileWriter (TimePartitionedPathUtils .getTimePartitionedPath (record2 , sinkConfig ))).thenReturn (localFileWriter2 );
101100 Mockito .when (localFileWriter2 .write (record2 )).thenReturn (true );
@@ -113,7 +112,7 @@ public void shouldCreateMultipleWriterBasedOnPartition() throws Exception {
113112 public void shouldThrowIOExceptionWhenWriteThrowsException () throws Exception {
114113 Record record = Mockito .mock (Record .class );
115114 Mockito .when (record .getLocalDateTime (sinkConfig )).thenReturn (LocalDateTime .now ());
116- Mockito .when (record .getTimestamp (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (3600000L ));
115+ Mockito .when (record .getTimestampFromMessage (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (3600000L ));
117116 Mockito .when (record .getTopic ("" )).thenReturn (defaultTopic );
118117 Mockito .when (localFileWriter1 .getMetadata ()).thenReturn (new LocalFileMetadata ("/tmp/" , "/tmp/test1" , 0 , 0 , 0 ));
119118 Mockito .when (localStorage .createLocalFileWriter (TimePartitionedPathUtils .getTimePartitionedPath (record , sinkConfig ))).thenReturn (localFileWriter1 );
@@ -128,7 +127,7 @@ public void shouldThrowIOExceptionWhenOpenNewWriterFailed() throws Exception {
128127 expectedException .expect (LocalFileWriterFailedException .class );
129128 Record record = Mockito .mock (Record .class );
130129 Mockito .when (record .getLocalDateTime (sinkConfig )).thenReturn (LocalDateTime .now ());
131- Mockito .when (record .getTimestamp (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (3600000L ));
130+ Mockito .when (record .getTimestampFromMessage (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (3600000L ));
132131 Mockito .when (record .getTopic ("" )).thenReturn (defaultTopic );
133132 Mockito .when (localFileWriter1 .getMetadata ()).thenReturn (new LocalFileMetadata ("/tmp/" , "/tmp/test1" , 0 , 0 , 0 ));
134133 Mockito .when (localStorage .createLocalFileWriter (TimePartitionedPathUtils .getTimePartitionedPath (record , sinkConfig ))).thenThrow (new LocalFileWriterFailedException (new IOException ("Some error" )));
@@ -140,7 +139,7 @@ public void shouldThrowIOExceptionWhenOpenNewWriterFailed() throws Exception {
140139 @ Test
141140 public void shouldGetEmptyFlushedPath () throws Exception {
142141 Record record = Mockito .mock (Record .class );
143- Mockito .when (record .getTimestamp (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (1L ));
142+ Mockito .when (record .getTimestampFromMessage (timeStampFieldName )).thenReturn (Instant .ofEpochMilli (1L ));
144143 Mockito .when (record .getLocalDateTime (sinkConfig )).thenReturn (LocalDateTime .ofInstant (Instant .ofEpochMilli (1L ), ZoneId .of (zone )));
145144 Mockito .when (record .getTopic ("" )).thenReturn (defaultTopic );
146145 Mockito .when (localFileWriter1 .getFullPath ()).thenReturn ("/tmp/test" );
0 commit comments