Skip to content

Commit

Permalink
changes to jakarta e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaleotti committed Nov 1, 2023
1 parent 32c082c commit bbb3fcc
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 62 deletions.
61 changes: 22 additions & 39 deletions e2e-tests/spring-rest-jakarta/pom.xml
Original file line number Diff line number Diff line change
@@ -1,65 +1,57 @@
<?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">

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-e2e-tests</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>


<modelVersion>4.0.0</modelVersion>

<artifactId>evomaster-e2e-tests-spring-rest-jakarta</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependencies>

<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.0</version>
<version>${jakarta.validation-api.version}</version>
</dependency>

<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.1.0</version>
<version>${jakarta.persistence-api.version}</version>
</dependency>

<dependency>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-e2e-tests-utils</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-client-java-controller</artifactId>
</dependency>
<dependency>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-core</artifactId>
<scope>test</scope>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>${jakarta.ws.rs-api.version}</version>
</dependency>

<dependency>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-client-java-instrumentation</artifactId>
<type>test-jar</type>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${springboot3.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${springboot3.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<artifactId>spring-boot-starter-security</artifactId>
<version>${springboot3.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>

<dependency>
Expand All @@ -72,19 +64,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-web</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-parser</artifactId>
</dependency>



</dependencies>


<profiles>
<profile>
<id>skipE2E_V2</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
package com.foo.jakarta.entity;
package com.foo.jakarta;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.security.core.Authentication;
import org.springframework.web.context.request.WebRequest;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import static springfox.documentation.builders.PathSelectors.regex;

public class SwaggerConfiguration {
@EnableSwagger2
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
public class PersonApplication {

public static void main(String[] args) {
SpringApplication.run(PersonApplication.class, args);
}

@Bean
public Docket docketApi() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.foo.jakarta.entity;
package com.foo.jakarta;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.ElementCollection;
import jakarta.persistence.Id;
import jakarta.validation.constraints.*;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import java.time.LocalDate;
import java.util.List;

Expand Down Expand Up @@ -61,6 +65,7 @@ public class PersonEntity {
private String nickname;

@Size(min = 0, max = 100, message = "Must contain between 0 and 100 items")
@ElementCollection
private List<String> otherDetails;

@Digits(integer = 6, fraction = 2, message = "Invalid format, max 6 digits with 2 decimal places")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.foo.jakarta.entity;
package com.foo.jakarta;

import org.springframework.data.repository.CrudRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.foo.jakarta.entity;
package com.foo.jakarta;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MediaType;
import java.util.List;

@RestController
@RequestMapping(path = "/api/jakarta/person")
public class JakartaRest {
public class PersonRest {

@Autowired
private PersonRepository repository;
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<swagger.parser-v3.version>2.1.8</swagger.parser-v3.version>
<swagger.annotations.version>2.2.7</swagger.annotations.version>
<springboot.version>2.5.4</springboot.version>
<springboot3.version>3.1.5</springboot3.version>
<springfox.version>3.0.0</springfox.version>
<springdoc.version>1.6.9</springdoc.version>
<jetty.version>9.4.29.v20200521</jetty.version>
Expand Down Expand Up @@ -158,6 +159,9 @@
<okhttp.client.version>2.4.0</okhttp.client.version>
<dns.cache.manipulator.version>1.8.0</dns.cache.manipulator.version>
<jakarta.annotation.version>2.0.0</jakarta.annotation.version>
<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
<jakarta.persistence-api.version>3.1.0</jakarta.persistence-api.version>
<jakarta.ws.rs-api.version>3.1.0</jakarta.ws.rs-api.version>
<micronaut.version>3.2.7</micronaut.version>
<micronaut.openapi.version>3.2.0</micronaut.openapi.version>
<micronaut.test.version>3.0.5</micronaut.test.version>
Expand Down

0 comments on commit bbb3fcc

Please sign in to comment.