Refactor: add realistic mapping in originator fields node
This commit is contained in:
parent
df25091f3c
commit
39e9ab26e3
@ -103,9 +103,7 @@ public class TbGetOriginatorFieldsNodeTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenDefaultConfig_whenInit_thenOK() throws TbNodeException {
|
public void givenDefaultConfig_whenInit_thenOK() throws TbNodeException {
|
||||||
// GIVEN
|
// GIVEN-WHEN
|
||||||
|
|
||||||
// WHEN
|
|
||||||
node.init(ctxMock, nodeConfiguration);
|
node.init(ctxMock, nodeConfiguration);
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
@ -122,9 +120,9 @@ public class TbGetOriginatorFieldsNodeTest {
|
|||||||
public void givenCustomConfig_whenInit_thenOK() throws TbNodeException {
|
public void givenCustomConfig_whenInit_thenOK() throws TbNodeException {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
config.setFieldsMapping(Map.of(
|
config.setFieldsMapping(Map.of(
|
||||||
"sourceField1", "targetKey1",
|
"email", "originatorEmail",
|
||||||
"sourceField2", "targetKey2",
|
"title", "originatorTitle",
|
||||||
"sourceField3", "targetKey3"));
|
"country", "originatorCountry"));
|
||||||
config.setIgnoreNullStrings(true);
|
config.setIgnoreNullStrings(true);
|
||||||
config.setFetchTo(FetchTo.DATA);
|
config.setFetchTo(FetchTo.DATA);
|
||||||
nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config));
|
nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config));
|
||||||
@ -135,9 +133,9 @@ public class TbGetOriginatorFieldsNodeTest {
|
|||||||
// THEN
|
// THEN
|
||||||
assertThat(node.config).isEqualTo(config);
|
assertThat(node.config).isEqualTo(config);
|
||||||
assertThat(config.getFieldsMapping()).isEqualTo(Map.of(
|
assertThat(config.getFieldsMapping()).isEqualTo(Map.of(
|
||||||
"sourceField1", "targetKey1",
|
"email", "originatorEmail",
|
||||||
"sourceField2", "targetKey2",
|
"title", "originatorTitle",
|
||||||
"sourceField3", "targetKey3"));
|
"country", "originatorCountry"));
|
||||||
assertThat(config.isIgnoreNullStrings()).isEqualTo(true);
|
assertThat(config.isIgnoreNullStrings()).isEqualTo(true);
|
||||||
assertThat(config.getFetchTo()).isEqualTo(FetchTo.DATA);
|
assertThat(config.getFetchTo()).isEqualTo(FetchTo.DATA);
|
||||||
assertThat(node.fetchTo).isEqualTo(FetchTo.DATA);
|
assertThat(node.fetchTo).isEqualTo(FetchTo.DATA);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user