#1005 Improve restricted user feature (performance, error handling)
- Move check for restricted user into validation service - Keep restrictions in a map by name for fast lookup, avoid splitting Strings on every call - Gracefully handle case when entry does not have the expected ';' and log exception
This commit is contained in:
@@ -95,4 +95,14 @@ public class StringUtilsTest {
|
||||
public void shouldHaveHiddenConstructor() {
|
||||
TestHelper.validateHasOnlyPrivateEmptyConstructor(StringUtils.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldCheckIfHasNeedleInWord() {
|
||||
// given/when/then
|
||||
assertThat(StringUtils.isInsideString('@', "@hello"), equalTo(false));
|
||||
assertThat(StringUtils.isInsideString('?', "absent"), equalTo(false));
|
||||
assertThat(StringUtils.isInsideString('-', "abcd-"), equalTo(false));
|
||||
assertThat(StringUtils.isInsideString('@', "hello@example"), equalTo(true));
|
||||
assertThat(StringUtils.isInsideString('@', "D@Z"), equalTo(true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user