@Test public void resolveCatchesSecurityExceptions() { when(this.resolver.resolveEntity(P001)).thenThrow(new SecurityException()); this.component.resolve(P001); verify(this.resolver, times(1)).resolveEntity(P001); verify(this.logger, times(1)).error("Unauthorized access for [{}]", P001); verifyNoMoreInteractions(this.resolver); }
@Nullable public PrimaryEntity resolve(@Nullable final String entityId) { try { return this.resolver.resolveEntity(entityId); } catch (final SecurityException e) { this.logger.error("Unauthorized access for [{}]", entityId); return null; } }
PrimaryEntityResolverScriptService implements ScriptService { @Nullable public PrimaryEntity resolve(@Nullable final String entityId) { try { return this.resolver.resolveEntity(entityId); } catch (final SecurityException e) { this.logger.error("Unauthorized access for [{}]", entityId); return null; } } }
PrimaryEntityResolverScriptService implements ScriptService { @Nullable public PrimaryEntity resolve(@Nullable final String entityId) { try { return this.resolver.resolveEntity(entityId); } catch (final SecurityException e) { this.logger.error("Unauthorized access for [{}]", entityId); return null; } }  }
PrimaryEntityResolverScriptService implements ScriptService { @Nullable public PrimaryEntity resolve(@Nullable final String entityId) { try { return this.resolver.resolveEntity(entityId); } catch (final SecurityException e) { this.logger.error("Unauthorized access for [{}]", entityId); return null; } }  @Nullable PrimaryEntity resolve(@Nullable final String entityId); @Nullable PrimaryEntityManager<?> getEntityManager(@Nullable final String entityType); boolean hasEntityManager(@Nullable final String entityType); }
PrimaryEntityResolverScriptService implements ScriptService { @Nullable public PrimaryEntity resolve(@Nullable final String entityId) { try { return this.resolver.resolveEntity(entityId); } catch (final SecurityException e) { this.logger.error("Unauthorized access for [{}]", entityId); return null; } }  @Nullable PrimaryEntity resolve(@Nullable final String entityId); @Nullable PrimaryEntityManager<?> getEntityManager(@Nullable final String entityType); boolean hasEntityManager(@Nullable final String entityType);  }