RM-7119 Throw explicit exception rather than logging message.

Also address other code review comments.
This commit is contained in:
Tom Page
2020-02-27 07:55:40 +00:00
parent db852d52e5
commit 0e7ac0f0c5
2 changed files with 19 additions and 4 deletions

View File

@@ -34,13 +34,17 @@ import java.util.Map;
import com.google.common.collect.ImmutableMap;
import org.alfresco.error.AlfrescoRuntimeException;
import org.junit.Test;
/**
* Unit tests for {@link RMMethodSecurityPostProcessor}.
*
* See RM-7119.
*/
public class RMMethodSecurityPostProcessorUnitTest
{
/** The class under test. */
private RMMethodSecurityPostProcessor rmMethodSecurityPostProcessor = new RMMethodSecurityPostProcessor();
@Test
@@ -77,4 +81,11 @@ public class RMMethodSecurityPostProcessorUnitTest
Map<String, String> actual = rmMethodSecurityPostProcessor.convertToMap("a=b=c\nd=e=f");
assertEquals("Issue with handling of = symbol in value.", ImmutableMap.of("a", "b=c", "d", "e=f"), actual);
}
/** Check that if a line is missing an equals sign then we get an exception. */
@Test(expected = AlfrescoRuntimeException.class)
public void testConvertToMap_missingEquals()
{
rmMethodSecurityPostProcessor.convertToMap("a=b\ncd");
}
}