@Test void getContent() { when(dataService.findOneById(STATIC_CONTENT, "home", StaticContent.class)) .thenReturn(staticContent); when(staticContent.getContent()).thenReturn("<p>Welcome to Molgenis!</p>"); assertEquals("<p>Welcome to Molgenis!</p>", staticContentService.getContent("home")); }
@Transactional(readOnly = true) @Override public String getContent(String key) { StaticContent staticContent = RunAsSystemAspect.runAsSystem( () -> dataService.findOneById(STATIC_CONTENT, key, StaticContent.class)); return staticContent != null ? staticContent.getContent() : null; }
StaticContentServiceImpl implements StaticContentService { @Transactional(readOnly = true) @Override public String getContent(String key) { StaticContent staticContent = RunAsSystemAspect.runAsSystem( () -> dataService.findOneById(STATIC_CONTENT, key, StaticContent.class)); return staticContent != null ? staticContent.getContent() : null; } }
StaticContentServiceImpl implements StaticContentService { @Transactional(readOnly = true) @Override public String getContent(String key) { StaticContent staticContent = RunAsSystemAspect.runAsSystem( () -> dataService.findOneById(STATIC_CONTENT, key, StaticContent.class)); return staticContent != null ? staticContent.getContent() : null; } StaticContentServiceImpl(
      DataService dataService,
      StaticContentFactory staticContentFactory,
      UserPermissionEvaluator permissionService); }
StaticContentServiceImpl implements StaticContentService { @Transactional(readOnly = true) @Override public String getContent(String key) { StaticContent staticContent = RunAsSystemAspect.runAsSystem( () -> dataService.findOneById(STATIC_CONTENT, key, StaticContent.class)); return staticContent != null ? staticContent.getContent() : null; } StaticContentServiceImpl(
      DataService dataService,
      StaticContentFactory staticContentFactory,
      UserPermissionEvaluator permissionService); @Override @Transactional boolean submitContent(String key, String content); @Transactional(readOnly = true) @Override boolean isCurrentUserCanEdit(String pluginId); @Transactional(readOnly = true) @Override String getContent(String key); void checkPermissions(String pluginId); }
StaticContentServiceImpl implements StaticContentService { @Transactional(readOnly = true) @Override public String getContent(String key) { StaticContent staticContent = RunAsSystemAspect.runAsSystem( () -> dataService.findOneById(STATIC_CONTENT, key, StaticContent.class)); return staticContent != null ? staticContent.getContent() : null; } StaticContentServiceImpl(
      DataService dataService,
      StaticContentFactory staticContentFactory,
      UserPermissionEvaluator permissionService); @Override @Transactional boolean submitContent(String key, String content); @Transactional(readOnly = true) @Override boolean isCurrentUserCanEdit(String pluginId); @Transactional(readOnly = true) @Override String getContent(String key); void checkPermissions(String pluginId);  }