changed exception text for mapping based rule nodes

This commit is contained in:
ShvaykaD 2023-05-03 16:33:59 +03:00
parent 7d3354a8c6
commit d49c83b264
6 changed files with 6 additions and 6 deletions

View File

@ -50,7 +50,7 @@ public abstract class TbAbstractGetEntityAttrNode<T extends EntityId> extends Tb
protected void checkIfMappingIsNotEmptyOrElseThrow(Map<String, String> attrMapping) throws TbNodeException { protected void checkIfMappingIsNotEmptyOrElseThrow(Map<String, String> attrMapping) throws TbNodeException {
if (attrMapping == null || attrMapping.isEmpty()) { if (attrMapping == null || attrMapping.isEmpty()) {
throw new TbNodeException("At least one attribute mapping should be specified!"); throw new TbNodeException("At least one mapping entry should be specified!");
} }
} }

View File

@ -51,7 +51,7 @@ public class TbGetOriginatorFieldsNode extends TbAbstractNodeWithFetchTo<TbGetOr
protected TbGetOriginatorFieldsConfiguration loadNodeConfiguration(TbNodeConfiguration configuration) throws TbNodeException { protected TbGetOriginatorFieldsConfiguration loadNodeConfiguration(TbNodeConfiguration configuration) throws TbNodeException {
var config = TbNodeUtils.convert(configuration, TbGetOriginatorFieldsConfiguration.class); var config = TbNodeUtils.convert(configuration, TbGetOriginatorFieldsConfiguration.class);
if (config.getFieldsMapping() == null || config.getFieldsMapping().isEmpty()) { if (config.getFieldsMapping() == null || config.getFieldsMapping().isEmpty()) {
throw new TbNodeException("At least one field mapping should be specified!"); throw new TbNodeException("At least one mapping entry should be specified!");
} }
return config; return config;
} }

View File

@ -175,7 +175,7 @@ public class TbGetCustomerAttributeNodeTest {
@Test @Test
public void givenEmptyAttributesMapping_whenInit_thenException() { public void givenEmptyAttributesMapping_whenInit_thenException() {
// GIVEN // GIVEN
var expectedExceptionMessage = "At least one attribute mapping should be specified!"; var expectedExceptionMessage = "At least one mapping entry should be specified!";
config.setAttrMapping(Collections.emptyMap()); config.setAttrMapping(Collections.emptyMap());
nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config)); nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config));

View File

@ -303,7 +303,7 @@ public class TbGetOriginatorFieldsNodeTest {
var exception = assertThrows(TbNodeException.class, () -> node.init(ctxMock, nodeConfiguration)); var exception = assertThrows(TbNodeException.class, () -> node.init(ctxMock, nodeConfiguration));
// THEN // THEN
assertThat(exception.getMessage()).isEqualTo("At least one field mapping should be specified!"); assertThat(exception.getMessage()).isEqualTo("At least one mapping entry should be specified!");
verify(ctxMock, never()).tellSuccess(any()); verify(ctxMock, never()).tellSuccess(any());
} }

View File

@ -197,7 +197,7 @@ public class TbGetRelatedAttributeNodeTest {
@Test @Test
public void givenEmptyAttributesMapping_whenInit_thenException() { public void givenEmptyAttributesMapping_whenInit_thenException() {
// GIVEN // GIVEN
var expectedExceptionMessage = "At least one attribute mapping should be specified!"; var expectedExceptionMessage = "At least one mapping entry should be specified!";
config.setAttrMapping(Collections.emptyMap()); config.setAttrMapping(Collections.emptyMap());
nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config)); nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config));

View File

@ -156,7 +156,7 @@ public class TbGetTenantAttributeNodeTest {
@Test @Test
public void givenEmptyAttributesMapping_whenInit_thenException() { public void givenEmptyAttributesMapping_whenInit_thenException() {
// GIVEN // GIVEN
var expectedExceptionMessage = "At least one attribute mapping should be specified!"; var expectedExceptionMessage = "At least one mapping entry should be specified!";
config.setAttrMapping(Collections.emptyMap()); config.setAttrMapping(Collections.emptyMap());
nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config)); nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config));