File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
modules/swagger-compat-spec-parser/src/test/java/io/swagger/parserExtensions Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ package io .swagger .parserExtensions ;
2+
3+ import io .swagger .models .Swagger ;
4+ import io .swagger .parser .SwaggerCompatConverter ;
5+ import org .testng .annotations .Test ;
6+
7+ import java .io .IOException ;
8+
9+ import static org .testng .Assert .assertTrue ;
10+
11+ public class SwaggerCompatConverterTest {
12+ @ Test
13+ public void loadsSpecFromClasspath () throws IOException {
14+ SwaggerCompatConverter converter = new SwaggerCompatConverter ();
15+ Swagger result = converter .read ("/specs/v1_2/singleFile.json" );
16+ assertTrue (result != null , "Didn't load spec from classpath" );
17+ }
18+
19+ @ Test
20+ public void failsOnNonExistentSpec () throws IOException {
21+ SwaggerCompatConverter converter = new SwaggerCompatConverter ();
22+ Swagger result = converter .read ("specs/v1_2/not-exists.json" );
23+ assertTrue (result == null );
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments