BAEL-5253 moving the tests to other module

This commit is contained in:
Matea Pejčinović 2021-11-28 18:03:38 +01:00
parent 2a3501237c
commit 9ab2a1ab0f
4 changed files with 8 additions and 78 deletions

View File

@ -24,6 +24,11 @@
<artifactId>commons-validator</artifactId>
<version>${validator.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
</dependencies>
<build>
@ -49,8 +54,8 @@
</build>
<properties>
<guava.version>28.1-jre</guava.version>
<guava.version>31.0.1-jre</guava.version>
<validator.version>1.7</validator.version>
</properties>
</project>
</project>

View File

@ -1,9 +1,9 @@
package com.baeldung.isuppercase;
import com.google.common.base.Ascii;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import com.google.common.base.Ascii;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.matchesPattern;

View File

@ -1,63 +0,0 @@
package com.baeldung.swagger2pdf.controller;
import com.baeldung.swagger2pdf.objects.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.NonNull;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@Controller
@Api(value = "/api", description = "A controller for user management")
@RequestMapping("/user")
@ResponseStatus(HttpStatus.OK)
public class UserController {
static List<User> users;
static {
users = new ArrayList<>();
users.add(new User("Mark", "Thompson", 23));
users.add(new User("Kate", "Jordan", 22));
}
@ApiOperation(value = "Retrieves all the users")
@RequestMapping(value = "/users",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public List<User> getUsers() {
return users;
}
@ApiOperation(value = "Retrieves a user based on first name")
@RequestMapping(value = "/user",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public User getUser(@NonNull @RequestParam String firstName) {
if (firstName.isEmpty()) {
return null;
}
return users.stream()
.filter(user -> user.getFirstName().equals(firstName))
.findAny()
.orElse(null);
}
@ApiOperation(value = "Adds a user.")
@RequestMapping(value = "/user",
method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_VALUE)
public List<User> addUser(@NonNull @RequestBody User user) {
users.add(user);
return users;
}
}

View File

@ -1,12 +0,0 @@
package com.baeldung.swagger2pdf.objects;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class User {
private String firstName;
private String lastName;
private int age;
}