Skip to content

Commit

Permalink
refactor (jkube-kit-watcher-api): Migrate test from JUnit4 to JUnit5 (#…
Browse files Browse the repository at this point in the history
…1568)

Signed-off-by: Anurag Rajawat <[email protected]>
  • Loading branch information
anurag-rajawat authored and manusa committed Aug 2, 2022
1 parent 0a78f4d commit b956d61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
5 changes: 3 additions & 2 deletions jkube-kit/watcher/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import org.eclipse.jkube.kit.config.service.JKubeServiceHub;

import io.fabric8.kubernetes.api.model.HasMetadata;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
Expand All @@ -34,17 +34,15 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class WatcherManagerTest {
class WatcherManagerTest {

JKubeServiceHub jKubeServiceHub;

KitLogger logger;
private KitLogger logger;

private WatcherContext watcherContext;

@Before
public void setUp() throws Exception {
jKubeServiceHub = mock(JKubeServiceHub.class, RETURNS_DEEP_STUBS);
@BeforeEach
void setUp() {
JKubeServiceHub jKubeServiceHub = mock(JKubeServiceHub.class, RETURNS_DEEP_STUBS);
logger = mock(KitLogger.class);
when(jKubeServiceHub.getClusterAccess().isOpenShift()).thenReturn(false);
final ProcessorConfig processorConfig = new ProcessorConfig();
Expand All @@ -57,7 +55,7 @@ public void setUp() throws Exception {
}

@Test
public void watch_withTestWatcher_shouldMutateImages() throws Exception {
void watch_withTestWatcher_shouldMutateImages() throws Exception {
// Given
final List<ImageConfiguration> images = Collections.singletonList(new ImageConfiguration());
// When
Expand Down

0 comments on commit b956d61

Please sign in to comment.