@@ -0,0 +1,1434 @@
+//////////////////////////////////////////////////////////////////////////////%0A// %0A//                    Copyright 2020, Cornutum Project%0A//                             www.cornutum.org%0A//%0A//////////////////////////////////////////////////////////////////////////////%0A%0Apackage org.cornutum.tcases.openapi;%0A%0Aimport org.cornutum.tcases.openapi.reader.OpenApiReader;%0A%0Aimport io.swagger.v3.oas.models.OpenAPI;%0Aimport org.junit.Test;%0Aimport static org.apache.commons.lang3.StringUtils.trimToNull;%0Aimport static org.hamcrest.MatcherAssert.*;%0Aimport static org.hamcrest.Matchers.*;%0A%0Aimport java.io.File;%0Aimport java.util.Optional;%0A%0A/**%0A * Utility for checking results of the OpenAPI parser.%0A */%0Apublic class OpenApiParserTest extends OpenApiTest%0A  %7B%0A  @Test%0A  public void parse()%0A    %7B%0A    // Given...%0A    if( apiFile_ != null)%0A      %7B%0A      // When...%0A      OpenAPI api;%0A      try( OpenApiReader reader = new OpenApiReader( apiFile_))%0A        %7B%0A        api = reader.read();%0A        %7D%0A%0A      // Then...%0A      assertThat( %22OpenAPI spec valid%22, api != null, is( !failureExpected_));%0A      %7D%0A    %7D%0A%0A  private final File apiFile_ =%0A    Optional.ofNullable( trimToNull( System.getProperty( %22api%22)))%0A    .map( path -%3E new File( path))%0A    .orElse( null);%0A%0A  private final boolean failureExpected_ =%0A    Optional.ofNullable( trimToNull( System.getProperty( %22failure%22)))%0A    .map( failure -%3E Boolean.parseBoolean( failure))%0A    .orElse( false);%0A  %7D%0A

Add OpenApiParserTest: Utility for checking results of the OpenAPI parser.