fix test names, missing templates

This commit is contained in:
Loredana
2018-12-09 20:36:56 +02:00
parent bae846571a
commit 95b1a9b158
30 changed files with 277 additions and 33 deletions

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,4 +1,4 @@
package org.baeldung.persistence.model;
package com.baeldung.persistence.model;
import javax.persistence.Column;
import javax.persistence.Entity;

View File

@@ -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;

View File

@@ -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

View File

@@ -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 {

View File

@@ -1,4 +1,4 @@
package org.baeldung.web;
package com.baeldung.web;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

View File

@@ -1,4 +1,4 @@
package org.baeldung.web.exception;
package com.baeldung.web.exception;
public class BookIdMismatchException extends RuntimeException {

View File

@@ -1,4 +1,4 @@
package org.baeldung.web.exception;
package com.baeldung.web.exception;
public class BookNotFoundException extends RuntimeException {

View File

@@ -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";

View File

@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;