kandi background
Explore Kits

rest-assured | Java DSL for easy testing of REST services | REST library

 by   rest-assured Java Version: Current License: Apache-2.0

 by   rest-assured Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | rest-assured Summary

rest-assured is a Java library typically used in Web Services, REST, Spring Boot, Docker, JPA applications. rest-assured has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.
Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • rest-assured has a highly active ecosystem.
  • It has 5812 star(s) with 1650 fork(s). There are 330 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 435 open issues and 869 have been closed. On average issues are closed in 134 days. There are 26 open pull requests and 0 closed requests.
  • It has a positive sentiment in the developer community.
  • The latest version of rest-assured is current.
rest-assured Support
Best in #REST
Average in #REST
rest-assured Support
Best in #REST
Average in #REST

quality kandi Quality

  • rest-assured has 0 bugs and 0 code smells.
rest-assured Quality
Best in #REST
Average in #REST
rest-assured Quality
Best in #REST
Average in #REST

securitySecurity

  • rest-assured has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • rest-assured code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
rest-assured Security
Best in #REST
Average in #REST
rest-assured Security
Best in #REST
Average in #REST

license License

  • rest-assured is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
rest-assured License
Best in #REST
Average in #REST
rest-assured License
Best in #REST
Average in #REST

buildReuse

  • rest-assured releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • rest-assured saves you 22575 person hours of effort in developing the same functionality from scratch.
  • It has 45131 lines of code, 5132 functions and 561 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
rest-assured Reuse
Best in #REST
Average in #REST
rest-assured Reuse
Best in #REST
Average in #REST
Top functions reviewed by kandi - BETA

kandi has reviewed rest-assured and discovered the below as its top functions. This is intended to give you an instant insight into rest-assured implemented functionality, and help decide if they suit your requirements.

  • Send the request .
  • Merges two configurations into one .
  • Add multi - part parts
  • Log the request params and headers .
  • Print response body to output stream
  • Url decode a string .
  • Parse the response .
  • Gets the value as list .
  • Checks if the given content matches the schema .
  • Apply the given response specification to the response object .

rest-assured Key Features

Java DSL for easy testing of REST services

Examples

copy iconCopydownload iconDownload
get("/lotto").then().assertThat().body("lotto.lottoId", equalTo(5));

Can Rest-Assured's response payload be stored and used across multiple classes?

copy iconCopydownload iconDownload
public class RestUtil {

  public static void verify200(Response response) {
    int statusCode = response.getStatusCode();
    System.out.println("Status code: " + statusCode);
    assertThat(response.getStatusCode()).isEqualTo(200);

  }

}
public class MyClass{
    
      private Response response;
     
      public void sendGetRequestT() {
        RequestSpecification httpRequest = given()
                .header("Content-Type", "application/json");
    
        response = httpRequest
                .when()
                .get(restUtil.getUrl()).andReturn();
      }     
     
      public void verifyStatusCode() {
        RestUtil.verify200( response); 
      }}
  
-----------------------
public class RestUtil {

  public static void verify200(Response response) {
    int statusCode = response.getStatusCode();
    System.out.println("Status code: " + statusCode);
    assertThat(response.getStatusCode()).isEqualTo(200);

  }

}
public class MyClass{
    
      private Response response;
     
      public void sendGetRequestT() {
        RequestSpecification httpRequest = given()
                .header("Content-Type", "application/json");
    
        response = httpRequest
                .when()
                .get(restUtil.getUrl()).andReturn();
      }     
     
      public void verifyStatusCode() {
        RestUtil.verify200( response); 
      }}
  

Serenity Cucumber 7 parallel execution not working

copy iconCopydownload iconDownload
<?xml version="1.0" encoding="UTF-8"?>
<groupId>com.d</groupId>
<artifactId>Automation</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <serenity.version>3.2.0</serenity.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <encoding>UTF-8</encoding>
    <tags></tags>
    <parallel.tests>5</parallel.tests>
    <webdriver.base.url></webdriver.base.url>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <java.version>11</java.version>
</properties>
<dependencies>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-rest-assured</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-junit</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.lambdaj</groupId>
        <artifactId>lambdaj</artifactId>
        <version>2.3.3</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.12.4</version>
    </dependency>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.1.1</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jettison</groupId>
        <artifactId>jettison</artifactId>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>commons-dbutils</groupId>
        <artifactId>commons-dbutils</artifactId>
        <version>1.7</version>
    </dependency>
    <dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>mssql-jdbc</artifactId>
        <version>9.4.0.jre11</version>
    </dependency>
    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>1.0.2</version>
    </dependency>
    <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>4.1.1</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <includes>
                    <include>**/*Runner.java</include>
                </includes>
                <systemPropertyVariables>
                    <webdriver.base.url>${webdriver.base.url}</webdriver.base.url>
                </systemPropertyVariables>
                <parallel>methods</parallel>
                <threadCount>${parallel.tests}</threadCount>
                <!-- <forkCount>${parallel.tests}</forkCount>-->
                <!--<useUnlimitedThreads>true</useUnlimitedThreads>-->
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.0</version>
            <configuration>
                <source>11</source>
                <target>11</target>
                <compilerArgs>
                    <arg>-parameters</arg>
                </compilerArgs>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <configuration>
                <tags>${tags}</tags>
                <reports>single-page-html</reports>
            </configuration>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>net.serenity-bdd</groupId>
                    <artifactId>serenity-single-page-report</artifactId>
                    <version>${serenity.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<groupId>com.d</groupId>
<artifactId>Automation</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <serenity.version>3.2.0</serenity.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <encoding>UTF-8</encoding>
    <tags></tags>
    <parallel.tests>5</parallel.tests>
    <webdriver.base.url></webdriver.base.url>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <java.version>11</java.version>
</properties>
<dependencies>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-rest-assured</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-junit</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.lambdaj</groupId>
        <artifactId>lambdaj</artifactId>
        <version>2.3.3</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.12.4</version>
    </dependency>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.1.1</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jettison</groupId>
        <artifactId>jettison</artifactId>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>commons-dbutils</groupId>
        <artifactId>commons-dbutils</artifactId>
        <version>1.7</version>
    </dependency>
    <dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>mssql-jdbc</artifactId>
        <version>9.4.0.jre11</version>
    </dependency>
    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>1.0.2</version>
    </dependency>
    <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>4.1.1</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <includes>
                    <include>**/*Runner.java</include>
                </includes>
                <systemPropertyVariables>
                    <webdriver.base.url>${webdriver.base.url}</webdriver.base.url>
                </systemPropertyVariables>
                <parallel>methods</parallel>
                <threadCount>${parallel.tests}</threadCount>
                <!-- <forkCount>${parallel.tests}</forkCount>-->
                <!--<useUnlimitedThreads>true</useUnlimitedThreads>-->
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.0</version>
            <configuration>
                <source>11</source>
                <target>11</target>
                <compilerArgs>
                    <arg>-parameters</arg>
                </compilerArgs>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <configuration>
                <tags>${tags}</tags>
                <reports>single-page-html</reports>
            </configuration>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>net.serenity-bdd</groupId>
                    <artifactId>serenity-single-page-report</artifactId>
                    <version>${serenity.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

How to assert that a property in body has only a few predefined values

copy iconCopydownload iconDownload
.body("result.object.type",  everyItem(isOneOf("mattress", "pillow")));

JSON get string with values only

copy iconCopydownload iconDownload
function getValuesOnly(obj) {
 let values = []

 for(key in obj) {
   values.push(obj[key])
 }

 return values
}
function getValuesOnlyNested(obj) {
  let values = [];
  for (key in obj) {
    if (typeof obj[key] !== "object") {
      values.push(obj[key]);
    } else {
      values = values.concat(getValuesOnlyNested(obj[key]));
    }
  }
  return values;
}
-----------------------
function getValuesOnly(obj) {
 let values = []

 for(key in obj) {
   values.push(obj[key])
 }

 return values
}
function getValuesOnlyNested(obj) {
  let values = [];
  for (key in obj) {
    if (typeof obj[key] !== "object") {
      values.push(obj[key]);
    } else {
      values = values.concat(getValuesOnlyNested(obj[key]));
    }
  }
  return values;
}

Is it possible to rewrite WHILE loop with Rest-Assured requests attempts using Java Stream api

copy iconCopydownload iconDownload
Optional<Response> response = IntStream.range(0, 3)
    .mapToObj(i -> getResponse(requestBody, token, url))
    .filter(r -> r.getStatusCode() == HttpStatus.SC_OK)
    .findFirst();
return response.orElse(null);
Optional<Response> response = IntStream.range(0, 2)
    .mapToObj(i -> getResponse(requestBody, token, url))
    .filter(r -> r.getStatusCode() == HttpStatus.SC_OK)
    .findFirst();
return response.orElseGet(() -> getResponse(requestBody, token, url));
-----------------------
Optional<Response> response = IntStream.range(0, 3)
    .mapToObj(i -> getResponse(requestBody, token, url))
    .filter(r -> r.getStatusCode() == HttpStatus.SC_OK)
    .findFirst();
return response.orElse(null);
Optional<Response> response = IntStream.range(0, 2)
    .mapToObj(i -> getResponse(requestBody, token, url))
    .filter(r -> r.getStatusCode() == HttpStatus.SC_OK)
    .findFirst();
return response.orElseGet(() -> getResponse(requestBody, token, url));

Allure report with restassured not showing request response in report

copy iconCopydownload iconDownload
RequestSpecification request = given()
                                        .filter(new AllureRestAssured())
                                        .filter(new RequestLoggingFilter(requestCapture));

Quarkus with Camel call external endpoint. Error: Map at least one servlet to a path using quarkus.camel.servlet.url-patterns

copy iconCopydownload iconDownload
quarkus.camel.servlet.url-patterns = /services/*

Springboot RestAssured accessing elements of JSON array and validating fields not working

copy iconCopydownload iconDownload
.body("$", hasSize(2))
.body("[0].id", equalTo(22))
.body("[0].type", equalTo("House"))
.body("[0].size", equalTo(3000))
.body("[0].soldDate", equalTo("2021-03-10"))
.body("id", hasItems(22, 27))
.body("type", hasItems("House", "Appartment"))
.body("getAt('size')", hasItems(3000, 750)) //In response: 3000, "750"
.body("soldDate", hasItems("2021-03-10", "2020-01-22"))

InjectMock does not work with RestClient for ApplicationScoped Bean in Quarkus

copy iconCopydownload iconDownload
ch.zhaw.ba.rest.client.CloudEventPublisher/mp-rest/scope=javax.inject.Singleton

RestAssured: 'no supported Content-Type was specified in response. Content-Type was 'text/html;charset=ISO-8859-1'' for content type that has support

copy iconCopydownload iconDownload
.then()
.statusCode(500)
.extract().asString()
-----------------------
                .extract().body().asPrettyString();

Community Discussions

Trending Discussions on rest-assured
  • jakarta.servlet with Tomcat 9 - Not Found Issue
  • Using SoftAssert with Parallel Execution in TestNG produces unexpected results
  • Can Rest-Assured's response payload be stored and used across multiple classes?
  • Serenity Cucumber 7 parallel execution not working
  • How do I force Quarkus to use test/resources/ for a QuarkusIntegrationTest?
  • How to assert that a property in body has only a few predefined values
  • java.lang.NoClassDefFoundError: io/cucumber/core/runtime/TypeRegistryConfigurerSupplier
  • JSON get string with values only
  • Error integration Allure reporting with Jenkins. Can't find allure commandline &lt;null&gt;
  • quarkus: reactive mutiny returns object Uni reference instead of string value
Trending Discussions on rest-assured

QUESTION

jakarta.servlet with Tomcat 9 - Not Found Issue

Asked 2022-Mar-24 at 09:19

I have a application which I am running using eclipse and tomcat 9 server. When I run the application, its opens then index.html page in browser, but the API's called inside index page are erroring with 404 status.

I tried multiple things from various stackoverflow page but nothing seems to work.

I have a Httpservlet with following declaration

@WebServlet("/api/modules")
public class ModuleController extends HttpServlet {
@Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
     // logic
}
}

Even if I directly try to hit localhost:8080/application-context/api/modules I get the same 404 error.

Also my application doesn't have a web.xml.

Note: The application is working fine on other people's system.

Following is the pom.xml for reference.

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>ch.bfh.ti</groupId>
    <artifactId>academia-02</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <!-- General properties -->
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Version properties -->
        <servlet.version>5.0.0</servlet.version>
        <jackson.version>2.13.1</jackson.version>
        <postgresql.version>42.3.2</postgresql.version>
        <jetty.version>11.0.8</jetty.version>
        <h2.version>2.1.210</h2.version>
        <junit.version>5.8.2</junit.version>
        <rest-assured.version>4.5.0</rest-assured.version>

        <!-- Checkstyle properties -->
        <checkstyle.config.location>src/etc/checkstyle.xml</checkstyle.config.location>
        <checkstyle.header.file>src/etc/checkstyle-header.txt</checkstyle.header.file>
    </properties>

    <dependencies>
        <!-- Servlet dependencies -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>${servlet.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <!-- Database dependency -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgresql.version}</version>
        </dependency>

        <dependency>
            <groupId>com.wordnik</groupId>
            <artifactId>swagger-jaxrs_2.10</artifactId>
            <version>1.3.1</version>
            <scope>compile</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-annotations</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>${h2.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest-assured.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.3.2</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M5</version>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.11.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>site</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.basedir}/target/site/images</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/site/markdown/images</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.2.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.1.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.0.0-M5</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>

404 error reference:

HTTP Status 404 – Not Found

Type Status Report

Message The requested resource [/academia-02/api/modules] is not available

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Also I have already tried the following:

  • Changing tomcat version
  • adding a web.xml
  • clean build the application and then run on tomcat
  • checked that generated classes contains the Servlet class in proper location
  • Update tomcat properties -> Switch location
  • Update tomcat properties -> user tomcat installation in server location

Can you please let me know what can be done here ?

ANSWER

Answered 2022-Mar-24 at 09:19

You're declaring a dependency on Servlet Spec 5.0 (and explicitly state that you're using a Jakarta servlet).

Thus, it's mandatory that you're using Tomcat 10. Works as declared/designed. Not an issue.

Source https://stackoverflow.com/questions/71598257

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install rest-assured

You can download it from GitHub, Maven.
You can use rest-assured like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the rest-assured component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

Getting startedDownloadsUsage Guide (click here for legacy documentation)JavadocRest Assured JavadocRest AssuredMockMvc JavadocXmlPath JavadocJsonPath JavadocRelease NotesFAQ

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.