fix test names, missing templates
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<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>org.baeldung</groupId>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>spring-boot-bootstrap</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>spring-boot-bootstrap</name>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -9,9 +9,9 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
@ServletComponentScan
|
||||
@SpringBootApplication
|
||||
@ComponentScan("org.baeldung")
|
||||
@EnableJpaRepositories("org.baeldung.persistence.repo")
|
||||
@EntityScan("org.baeldung.persistence.model")
|
||||
@ComponentScan("com.baeldung")
|
||||
@EnableJpaRepositories("com.baeldung.persistence.repo")
|
||||
@EntityScan("com.baeldung.persistence.model")
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung.cloud.config;
|
||||
package com.baeldung.cloud.config;
|
||||
|
||||
import org.springframework.cloud.config.java.AbstractCloudConfig;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung.config;
|
||||
package com.baeldung.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung.persistence.model;
|
||||
package com.baeldung.persistence.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -1,8 +1,9 @@
|
||||
package org.baeldung.persistence.repo;
|
||||
package com.baeldung.persistence.repo;
|
||||
|
||||
import org.baeldung.persistence.model.Book;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
import com.baeldung.persistence.model.Book;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package org.baeldung.web;
|
||||
package com.baeldung.web;
|
||||
|
||||
import org.baeldung.persistence.model.Book;
|
||||
import org.baeldung.persistence.repo.BookRepository;
|
||||
import org.baeldung.web.exception.BookIdMismatchException;
|
||||
import org.baeldung.web.exception.BookNotFoundException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
@@ -17,6 +13,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baeldung.persistence.model.Book;
|
||||
import com.baeldung.persistence.repo.BookRepository;
|
||||
import com.baeldung.web.exception.BookIdMismatchException;
|
||||
import com.baeldung.web.exception.BookNotFoundException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.baeldung.web;
|
||||
package com.baeldung.web;
|
||||
|
||||
import org.baeldung.web.exception.BookIdMismatchException;
|
||||
import org.baeldung.web.exception.BookNotFoundException;
|
||||
import org.hibernate.exception.ConstraintViolationException;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -12,6 +10,9 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
|
||||
|
||||
import com.baeldung.web.exception.BookIdMismatchException;
|
||||
import com.baeldung.web.exception.BookNotFoundException;
|
||||
|
||||
@ControllerAdvice
|
||||
public class RestExceptionHandler extends ResponseEntityExceptionHandler {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung.web;
|
||||
package com.baeldung.web;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung.web.exception;
|
||||
package com.baeldung.web.exception;
|
||||
|
||||
public class BookIdMismatchException extends RuntimeException {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung.web.exception;
|
||||
package com.baeldung.web.exception;
|
||||
|
||||
public class BookNotFoundException extends RuntimeException {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
||||
import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
|
||||
@@ -7,15 +7,16 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.baeldung.persistence.model.Book;
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import com.baeldung.persistence.model.Book;
|
||||
|
||||
import io.restassured.RestAssured;
|
||||
import io.restassured.response.Response;
|
||||
|
||||
public class SpringBootBootstrapIntegrationTest {
|
||||
public class SpringBootBootstrapLiveTest {
|
||||
|
||||
private static final String API_ROOT = "http://localhost:8080/api/books";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
Reference in New Issue
Block a user