This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed local server start issues. Updated docs.
Updates to BaseDynoDAOTest per code review.
- Loading branch information
1 parent
8c952e4
commit 4866e0c
Showing
5 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
redis-persistence/src/test/java/com/netflix/conductor/dao/dynomite/BaseDynoDAOTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.netflix.conductor.dao.dynomite; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.netflix.conductor.core.config.Configuration; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.Mock; | ||
import org.mockito.Mockito; | ||
import org.mockito.runners.MockitoJUnitRunner; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
@RunWith(MockitoJUnitRunner.class) | ||
public class BaseDynoDAOTest { | ||
|
||
@Mock | ||
private DynoProxy dynoClient; | ||
|
||
@Mock | ||
private ObjectMapper objectMapper; | ||
|
||
@Mock | ||
private Configuration config; | ||
|
||
private BaseDynoDAO baseDynoDAO; | ||
|
||
@Before | ||
public void setUp() { | ||
this.baseDynoDAO = new BaseDynoDAO(dynoClient, objectMapper, config); | ||
} | ||
|
||
@Test | ||
public void testNsKey() { | ||
assertEquals("", baseDynoDAO.nsKey()); | ||
|
||
String[] keys = {"key1", "key2"}; | ||
assertEquals("key1.key2", baseDynoDAO.nsKey(keys)); | ||
|
||
Mockito.when(config.getProperty("workflow.namespace.prefix", null)).thenReturn("test"); | ||
assertEquals("test", baseDynoDAO.nsKey()); | ||
|
||
assertEquals("test.key1.key2", baseDynoDAO.nsKey(keys)); | ||
|
||
Mockito.when(config.getStack()).thenReturn("stack"); | ||
assertEquals("test.stack.key1.key2", baseDynoDAO.nsKey(keys)); | ||
} | ||
} |