@@ -78,8 +78,9 @@ void placeholdersAreResolvedInOperationName() throws IOException {
78
78
PlaceholderResolver resolver = mock (PlaceholderResolver .class );
79
79
given (resolver .resolvePlaceholder ("a" )).willReturn ("alpha" );
80
80
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
+ }
83
84
}
84
85
85
86
@ Test
@@ -89,8 +90,9 @@ void placeholdersAreResolvedInSnippetName() throws IOException {
89
90
PlaceholderResolver resolver = mock (PlaceholderResolver .class );
90
91
given (resolver .resolvePlaceholder ("b" )).willReturn ("bravo" );
91
92
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
+ }
94
96
}
95
97
96
98
private RestDocumentationContext createContext (String outputDir ) {
0 commit comments