11/* 
22 * This file is part of mammoth, licensed under the MIT License. 
33 * 
4-  * Copyright (c) 2021-2022  KyoriPowered 
4+  * Copyright (c) 2021-2025  KyoriPowered 
55 * 
66 * Permission is hereby granted, free of charge, to any person obtaining a copy 
77 * of this software and associated documentation files (the "Software"), to deal 
3737import  java .util .regex .Pattern ;
3838import  org .gradle .testkit .runner .BuildResult ;
3939import  org .gradle .testkit .runner .GradleRunner ;
40- import  org .jetbrains .annotations .NotNull ;
40+ import  org .jspecify .annotations .NullMarked ;
4141import  org .junit .jupiter .api .Assertions ;
4242
4343import  static  java .util .Objects .requireNonNull ;
4949 * 
5050 * @since 1.1.0 
5151 */ 
52+ @ NullMarked 
5253public  final  class  TestContext  {
5354  private  static  final  Pattern  LINE_ENDING  = Pattern .compile ("\r \n " );
5455
@@ -78,11 +79,11 @@ public final class TestContext {
7879   * @return the output directory 
7980   * @since 1.1.0 
8081   */ 
81-   public  @ NotNull   Path  outputDirectory () {
82+   public  Path  outputDirectory () {
8283    return  this .outputDirectory ;
8384  }
8485
85-   @ NotNull   String  gradleVersion () {
86+   String  gradleVersion () {
8687    return  this .gradleVersion ;
8788  }
8889
@@ -93,7 +94,7 @@ public final class TestContext {
9394   * @throws IOException if an error occurs writing the input file to disk 
9495   * @since 1.1.0 
9596   */ 
96-   public  void  copyInput (final  @ NotNull   String  name ) throws  IOException  {
97+   public  void  copyInput (final  String  name ) throws  IOException  {
9798    this .copyInput (name , name );
9899  }
99100
@@ -105,7 +106,7 @@ public void copyInput(final @NotNull String name) throws IOException {
105106   * @throws IOException if an error occurs writing the input file to disk 
106107   * @since 1.1.0 
107108   */ 
108-   public  void  copyInput (final  @ NotNull   String  fromName , final   @ NotNull  String  toName ) throws  IOException  {
109+   public  void  copyInput (final  String  fromName , final  String  toName ) throws  IOException  {
109110    requireNonNull (fromName , "fromName" );
110111    requireNonNull (toName , "toName" );
111112    try  (final  InputStream  is  = this .resourceBase .getResourceAsStream (this .testName  + "/in/"  + fromName )) {
@@ -130,7 +131,7 @@ public void copyInput(final @NotNull String fromName, final @NotNull String toNa
130131   * @throws IOException if an error occurs writing the text 
131132   * @since 1.2.0 
132133   */ 
133-   public  void  writeText (final  @ NotNull   String  destination , final   @ NotNull  String  text ) throws  IOException  {
134+   public  void  writeText (final  String  destination , final  String  text ) throws  IOException  {
134135    requireNonNull (destination , "destination" );
135136    requireNonNull (text , "text" );
136137
@@ -149,7 +150,7 @@ public void writeText(final @NotNull String destination, final @NotNull String t
149150   * @throws IOException if thrown while attempting to read the output file 
150151   * @since 1.1.0 
151152   */ 
152-   public  @ NotNull   String  readOutput (final   @ NotNull  String  fileName ) throws  IOException  {
153+   public  String  readOutput (final  String  fileName ) throws  IOException  {
153154    final  StringBuilder  builder  = new  StringBuilder ();
154155    try  (final  BufferedReader  reader  = Files .newBufferedReader (this .outputDirectory .resolve (fileName ), StandardCharsets .UTF_8 )) {
155156      final  char [] buffer  = new  char [8192 ];
@@ -169,7 +170,7 @@ public void writeText(final @NotNull String destination, final @NotNull String t
169170   * @throws IOException if an error occurs reading the text 
170171   * @since 1.2.0 
171172   */ 
172-   public  void  assertOutputEqualsLiteral (final  @ NotNull   String  destination , final   @ NotNull  String  text ) throws  IOException  {
173+   public  void  assertOutputEqualsLiteral (final  String  destination , final  String  text ) throws  IOException  {
173174    requireNonNull (destination , "destination" );
174175    requireNonNull (text , "text" );
175176
@@ -188,7 +189,7 @@ public void assertOutputEqualsLiteral(final @NotNull String destination, final @
188189   * @throws IOException if failed to read one of the files 
189190   * @since 1.1.0 
190191   */ 
191-   public  void  assertOutputEquals (final  @ NotNull   String  resourceName , final   @ NotNull  String  fileName ) throws  IOException  {
192+   public  void  assertOutputEquals (final  String  resourceName , final  String  fileName ) throws  IOException  {
192193    final  String  actualOutput  = this .readOutput (fileName );
193194
194195    final  StringBuilder  builder  = new  StringBuilder ();
@@ -215,7 +216,7 @@ public void assertOutputEquals(final @NotNull String resourceName, final @NotNul
215216   * @return the new runner 
216217   * @since 1.1.0 
217218   */ 
218-   public  @ NotNull   GradleRunner  runner (final  @ NotNull   String @ NotNull ... extraArgs ) {
219+   public  GradleRunner  runner (final  String ... extraArgs ) {
219220    final  List <String > args  = new  ArrayList <>(this .commonArguments .size () + extraArgs .length );
220221    args .addAll (this .commonArguments );
221222    Collections .addAll (args , extraArgs );
@@ -234,7 +235,7 @@ public void assertOutputEquals(final @NotNull String resourceName, final @NotNul
234235   * @return the result of an executed build 
235236   * @since 1.1.0 
236237   */ 
237-   public  @ NotNull   BuildResult  build (final  @ NotNull   String @ NotNull ... extraArgs ) {
238+   public  BuildResult  build (final  String ... extraArgs ) {
238239    return  this .runner (extraArgs ).build ();
239240  }
240241
0 commit comments