Class ActingIdentityTest

java.lang.Object
ubic.gemma.core.security.util.ActingIdentityTest

public class ActingIdentityTest extends Object
The scoping contract for the acting identity. Every property here is one that, if broken, writes a wrong name into the permanent record of who did what — which is worse than writing none.
  • Constructor Details

    • ActingIdentityTest

      public ActingIdentityTest()
  • Method Details

    • tearDown

      @AfterEach public void tearDown()
    • unsetByDefault

      @Test public void unsetByDefault()
    • boundInsideTheScopeAndClearedAfter

      @Test public void boundInsideTheScopeAndClearedAfter()
    • nullAndBlankBindNothing

      @Test public void nullAndBlankBindNothing()
      A null or blank name binds nothing, so callers do not have to branch before opening a scope.
    • clearedWhenTheBodyThrows

      @Test public void clearedWhenTheBodyThrows()
      It is cleared even when the body throws — an exception must not leave the name bound.
    • nestedScopeRestoresTheOuterName

      @Test public void nestedScopeRestoresTheOuterName()
      A nested scope RESTORES the outer name rather than clearing it. Nesting is not expected, but clearing would silently mis-attribute the remainder of the outer call, and a wrong attribution is the one outcome worth engineering against here.
    • notVisibleFromAnotherThread

      @Test public void notVisibleFromAnotherThread() throws Exception
      Not inherited by another thread: work handed to an executor is attributed to whoever ran it.
      Throws:
      Exception