Skip to content

Null Pointer Exception while integrating swagger coverage with karate framework #145

Open
@dtk72

Description

@dtk72

I'm submitting a ...

  • bug report

Error when running mvn clean test

java.lang.NullPointerException: Cannot invoke "java.nio.file.attribute.FileTime.toInstant()" because "this.minResultTime" is null

If the current behavior is a bug, please provide steps to reproduce, broken swagger specification and swagger-coverage-output:

Followed this code example provided in the README to generate a swagger coverage report after running karate tests for my own API:

import java.net.URI;
import com..viclovsky.swagger.coverage.karate.SwaggerCoverageRunner;
import com.intuit.karate.Results;
import org.junit.jupiter.api.Test;

public class CoverageReportRunner {

    @Test
    void testAll(){
        Results results = SwaggerCoverageRunner.path("classpath:some/path")
                .coverageDir("api-test-coverage")
                .swaggerSpec(URI.create("https://petstore3.swagger.io/api/v3/openapi.json"))
                .oas3()
                .outputJunitXml(true)
                .karateEnv("dev")
                .parallel(1);
    }
}

The error seems to arise when the code reaches .parallel(1)

Other information

  • The swaggerSpec() is passed a path to the .yaml file instead of a URL
  • The Coverage directory and naming conventions are followed appropriately, dependencies are added (Maven), and Java 16 and Junit5 are being used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions