GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( a930d8...6caa5b )
by Glythcing
04:02 queued 17s
created

tching.junit.extension.util.ExtensionUtil.ExtensionUtil()   A

Complexity

Conditions 1

Importance

Changes 0
Metric Value
dl 0
c 0
b 0
f 0
rs 10
cc 1
1
package io.github.glytching.junit.extension.util;
2
3
import org.junit.jupiter.api.extension.ExtensionContext;
4
5
public class ExtensionUtil {
6
7
  // this is a utility class - hide the public ctor
8
  private ExtensionUtil() {}
9
10
  /**
11
   * Creates a {@link ExtensionContext.Store} for a given {@code extensionContext}. A {@link
12
   * ExtensionContext.Store} is bound to an {@link ExtensionContext} so different test invocations
13
   * do not share the same store. For example a test invocation on {@code ClassA.testMethodA} will
14
   * have a different {@link ExtensionContext.Store} instance to that associated with a test
15
   * invocation on {@code ClassA.testMethodB} or test invocation on {@code ClassC.testMethodC}.
16
   *
17
   * @param extensionContext the <em>context</em> in which the current test or container is being
18
   *     executed
19
   * @return a {@link ExtensionContext.Store} for the given {@code extensionContext}
20
   */
21
  public static ExtensionContext.Store getStore(ExtensionContext extensionContext, Class clazz) {
22
    return extensionContext.getStore(namespace(extensionContext, clazz));
23
  }
24
25
  /**
26
   * Creates a {@link ExtensionContext.Namespace} in which extension state is stored on creation for
27
   * post execution destruction. Storing data in a custom namespace prevents accidental cross
28
   * pollination of data between extensions and between different invocations within the lifecycle
29
   * of a single extension.
30
   *
31
   * @param extensionContext the <em>context</em> in which the current test or container is being
32
   *     executed
33
   * @return a {@link ExtensionContext.Namespace} describing the scope for an extension
34
   */
35
  private static ExtensionContext.Namespace namespace(
36
      ExtensionContext extensionContext, Class clazz) {
37
    return ExtensionContext.Namespace.create(clazz, extensionContext);
38
  }
39
}
40