KAFKA-16204: Create partition dir for mockLog (#15288)

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Omnia Ibrahim <o.g.h.ibrahim@gmail.com>
This commit is contained in:
Gaurav Narula 2024-01-30 14:53:24 +00:00 committed by GitHub
parent 50940fa537
commit 9e4a4a2821
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -4381,6 +4381,9 @@ class ReplicaManagerTest {
private def setupMockLog(path: String): UnifiedLog = {
val mockLog = mock(classOf[UnifiedLog])
val partitionDir = new File(path, s"$topic-0")
partitionDir.mkdir()
when(mockLog.dir).thenReturn(partitionDir)
when(mockLog.parentDir).thenReturn(path)
when(mockLog.topicId).thenReturn(Some(topicId))
when(mockLog.topicPartition).thenReturn(new TopicPartition(topic, 0))