### Question:
RestAPIAuthorizationFilter extends AbstractAuthorizationFilter { protected boolean checkResourceAuthorizationsSyntax(final Set<String> resourceAuthorizations) { boolean valid = true; for (final String resourceAuthorization : resourceAuthorizations) { if (!resourceAuthorization.matches("(" + PermissionsBuilder.USER_TYPE_AUTHORIZATION_PREFIX + "|" + PermissionsBuilder.PROFILE_TYPE_AUTHORIZATION_PREFIX + "|" + SCRIPT_TYPE_AUTHORIZATION_PREFIX + ")\\|.+")) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Error while getting dynamic authoriations. Unknown syntax: " + resourceAuthorization + " defined in dynamic-permissions-checks.properties"); } valid = false; } } return valid; } RestAPIAuthorizationFilter(final boolean reload);  RestAPIAuthorizationFilter();  static final String SCRIPT_TYPE_AUTHORIZATION_PREFIX; }### Answer:
@Test public void checkResourceAuthorizationsSyntax_should_return_false_if_syntax_is_invalid() throws Exception { final RestAPIAuthorizationFilter restAPIAuthorizationFilterSpy = spy(restAPIAuthorizationFilter); final Set<String> resourceAuthorizations = new HashSet<String>(); resourceAuthorizations.add("any string"); final boolean isValid = restAPIAuthorizationFilterSpy.checkResourceAuthorizationsSyntax(resourceAuthorizations); assertThat(isValid).isFalse(); }
@Test public void checkResourceAuthorizationsSyntax_should_return_true_if_syntax_is_valid() throws Exception { final RestAPIAuthorizationFilter restAPIAuthorizationFilterSpy = spy(restAPIAuthorizationFilter); final Set<String> resourceAuthorizations = new HashSet<String>(Arrays.asList("user|any.username", "profile|any.profile", "check|className")); final boolean isValid = restAPIAuthorizationFilterSpy.checkResourceAuthorizationsSyntax(resourceAuthorizations); assertThat(isValid).isTrue(); }