Skip to content

Commit

Permalink
fix: setup mock for usage
Browse files Browse the repository at this point in the history
Previously the mocked object was already used, before it was correctly set up this could cause issues on test execution.

(cherry picked from commit c84b26a)
  • Loading branch information
ChrisKujawa authored and github-actions[bot] committed Jan 31, 2022
1 parent 434ac61 commit cdf6c95
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
package io.camunda.zeebe.logstreams.log;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import io.camunda.zeebe.logstreams.storage.LogStorage;
import io.camunda.zeebe.logstreams.util.SyncLogStream;
Expand Down Expand Up @@ -41,14 +41,13 @@ public static Object[][] parameters() {

@Before
public void setup() {
doThrow(logStorageException).when(mockLogStorage).newReader();
logStream =
SyncLogStream.builder()
.withLogName("test-log")
.withLogStorage(mockLogStorage)
.withActorSchedulingService(actorSchedulerRule.get())
.build();

when(mockLogStorage.newReader()).thenThrow(logStorageException);
}

@After
Expand Down

0 comments on commit cdf6c95

Please sign in to comment.