mirror of https://github.com/apache/kafka.git
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:
parent
50940fa537
commit
9e4a4a2821
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue