22
33import com .google .protobuf .DynamicMessage ;
44import com .gotocompany .firehose .config .BlobSinkConfig ;
5+ import com .gotocompany .firehose .config .enums .TimePartitionType ;
56import com .gotocompany .firehose .sink .blob .Constants ;
67import com .gotocompany .firehose .sink .blob .TestProtoMessage ;
78import com .gotocompany .firehose .sink .blob .TestUtils ;
@@ -41,6 +42,7 @@ public void shouldCreateDayPartitioningPath() {
4142 Mockito .when (sinkConfig .getFilePartitionProtoTimestampTimezone ()).thenReturn (zone );
4243 Mockito .when (sinkConfig .getFilePartitionProtoTimestampFieldName ()).thenReturn (timeStampFieldName );
4344 Mockito .when (sinkConfig .getFilePartitionTimeGranularityType ()).thenReturn (Constants .FilePartitionType .DAY );
45+ Mockito .when (sinkConfig .getFilePartitionTimeType ()).thenReturn (TimePartitionType .EVENT_TIMESTAMP );
4446 Mockito .when (sinkConfig .getOutputKafkaMetadataColumnName ()).thenReturn (kafkaMetadataFieldName );
4547 Mockito .when (sinkConfig .getFilePartitionTimeDatePrefix ()).thenReturn ("date=" );
4648 Mockito .when (sinkConfig .getFilePartitionTimeHourPrefix ()).thenReturn ("" );
@@ -58,6 +60,7 @@ public void shouldCreateHourPartitioningPath() {
5860 Mockito .when (sinkConfig .getFilePartitionProtoTimestampTimezone ()).thenReturn (zone );
5961 Mockito .when (sinkConfig .getOutputKafkaMetadataColumnName ()).thenReturn (kafkaMetadataFieldName );
6062 Mockito .when (sinkConfig .getFilePartitionProtoTimestampFieldName ()).thenReturn (timeStampFieldName );
63+ Mockito .when (sinkConfig .getFilePartitionTimeType ()).thenReturn (TimePartitionType .EVENT_TIMESTAMP );
6164 Mockito .when (sinkConfig .getFilePartitionTimeGranularityType ()).thenReturn (Constants .FilePartitionType .HOUR );
6265 Mockito .when (sinkConfig .getFilePartitionTimeDatePrefix ()).thenReturn (datePrefix );
6366 Mockito .when (sinkConfig .getFilePartitionTimeHourPrefix ()).thenReturn (hourPrefix );
@@ -91,6 +94,7 @@ public void shouldCreatePartitionPathWhenKafkaMetadataIsNotNested() {
9194 BlobSinkConfig sinkConfig = Mockito .mock (BlobSinkConfig .class );
9295 Mockito .when (sinkConfig .getFilePartitionProtoTimestampTimezone ()).thenReturn (zone );
9396 Mockito .when (sinkConfig .getFilePartitionTimeGranularityType ()).thenReturn (Constants .FilePartitionType .DAY );
97+ Mockito .when (sinkConfig .getFilePartitionTimeType ()).thenReturn (TimePartitionType .EVENT_TIMESTAMP );
9498 Mockito .when (sinkConfig .getFilePartitionProtoTimestampFieldName ()).thenReturn (timeStampFieldName );
9599 Mockito .when (sinkConfig .getFilePartitionTimeDatePrefix ()).thenReturn (datePrefix );
96100 Mockito .when (sinkConfig .getFilePartitionTimeHourPrefix ()).thenReturn (hourPrefix );
@@ -107,6 +111,7 @@ public void shouldCreatePartitioningPathForNestedKafkaMetadata() {
107111 Record record = new Record (message , metadata );
108112 BlobSinkConfig sinkConfig = Mockito .mock (BlobSinkConfig .class );
109113 Mockito .when (sinkConfig .getFilePartitionProtoTimestampTimezone ()).thenReturn (zone );
114+ Mockito .when (sinkConfig .getFilePartitionTimeType ()).thenReturn (TimePartitionType .EVENT_TIMESTAMP );
110115 Mockito .when (sinkConfig .getFilePartitionTimeGranularityType ()).thenReturn (Constants .FilePartitionType .DAY );
111116 Mockito .when (sinkConfig .getFilePartitionProtoTimestampFieldName ()).thenReturn (timeStampFieldName );
112117 Mockito .when (sinkConfig .getFilePartitionTimeDatePrefix ()).thenReturn (datePrefix );
0 commit comments