@@ -78,8 +78,9 @@ void placeholdersAreResolvedInOperationName() throws IOException {
7878 PlaceholderResolver resolver = mock (PlaceholderResolver .class );
7979 given (resolver .resolvePlaceholder ("a" )).willReturn ("alpha" );
8080 given (this .placeholderResolverFactory .create (context )).willReturn (resolver );
81- Writer writer = this .resolver .resolve ("{a}" , "bravo" , context );
82- assertSnippetLocation (writer , new File (outputDirectory , "alpha/bravo.adoc" ));
81+ try (Writer writer = this .resolver .resolve ("{a}" , "bravo" , context )) {
82+ assertSnippetLocation (writer , new File (outputDirectory , "alpha/bravo.adoc" ));
83+ }
8384 }
8485
8586 @ Test
@@ -89,8 +90,9 @@ void placeholdersAreResolvedInSnippetName() throws IOException {
8990 PlaceholderResolver resolver = mock (PlaceholderResolver .class );
9091 given (resolver .resolvePlaceholder ("b" )).willReturn ("bravo" );
9192 given (this .placeholderResolverFactory .create (context )).willReturn (resolver );
92- Writer writer = this .resolver .resolve ("alpha" , "{b}" , context );
93- assertSnippetLocation (writer , new File (outputDirectory , "alpha/bravo.adoc" ));
93+ try (Writer writer = this .resolver .resolve ("alpha" , "{b}" , context )) {
94+ assertSnippetLocation (writer , new File (outputDirectory , "alpha/bravo.adoc" ));
95+ }
9496 }
9597
9698 private RestDocumentationContext createContext (String outputDir ) {
0 commit comments