// Path: booking-service/src/main/java/de/codecentric/resilient/booking/entity/Address.java
// @Embeddable
// public class Address {
// 
//     @Basic
//     private String country;
// 
//     @Basic
//     private String city;
// 
//     @Basic
//     private String postcode;
// 
//     @Basic
//     private String street;
// 
//     @Basic
//     private String streetNumber;
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// }
// 
// Path: booking-service/src/main/java/de/codecentric/resilient/booking/entity/Booking.java
// @Entity
// public class Booking {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     @Embedded
//     private Customer customer;
// 
//     private Long connote;
// 
//     @Column(name = "created", nullable = false)
//     private LocalDateTime created = LocalDateTime.now();
// 
//     @Embedded
//     @AttributeOverrides({
//             @AttributeOverride(name="street",column=@Column(name="receiverStreet")),
//             @AttributeOverride(name="city",column=@Column(name="receiverCity")),
//             @AttributeOverride(name="postcode",column=@Column(name="receiverPostcode")),
//             @AttributeOverride(name="country",column=@Column(name="receiverCountry")),
//             @AttributeOverride(name="streetNumber",column=@Column(name="receiverStreeNumber"))
//     })
//     private Address receiverAddress;
// 
//     @Embedded
//     @AttributeOverrides({
//             @AttributeOverride(name="street",column=@Column(name="senderStreet")),
//             @AttributeOverride(name="city",column=@Column(name="senderCity")),
//             @AttributeOverride(name="postcode",column=@Column(name="senderPostcode")),
//             @AttributeOverride(name="country",column=@Column(name="senderCountry")),
//             @AttributeOverride(name="streetNumber",column=@Column(name="senderStreeNumber"))
//             })
//     private Address senderAddress;
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public Customer getCustomer() {
//         return customer;
//     }
// 
//     public void setCustomer(Customer customer) {
//         this.customer = customer;
//     }
// 
//     public Long getConnote() {
//         return connote;
//     }
// 
//     public void setConnote(Long connote) {
//         this.connote = connote;
//     }
// 
//     public LocalDateTime getCreated() {
//         return created;
//     }
// 
//     public Address getReceiverAddress() {
//         return receiverAddress;
//     }
// 
//     public void setReceiverAddress(Address receiverAddress) {
//         this.receiverAddress = receiverAddress;
//     }
// 
//     public Address getSenderAddress() {
//         return senderAddress;
//     }
// 
//     public void setSenderAddress(Address senderAddress) {
//         this.senderAddress = senderAddress;
//     }
// }
// 
// Path: booking-service/src/main/java/de/codecentric/resilient/booking/entity/Customer.java
// @Embeddable
// public class Customer {
// 
//     private Long customerId;
// 
//     private String customerName;
// 
//     public Long getCustomerId() {
//         return customerId;
//     }
// 
//     public void setCustomerId(Long customerId) {
//         this.customerId = customerId;
//     }
// 
//     public String getCustomerName() {
//         return customerName;
//     }
// 
//     public void setCustomerName(String customerName) {
//         this.customerName = customerName;
//     }
// }


import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import de.codecentric.resilient.booking.entity.Address;
import de.codecentric.resilient.booking.entity.Booking;
import de.codecentric.resilient.booking.entity.Customer;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
package de.codecentric.resilient.booking.repository;



/**
 * @author Benjamin Wilms (xd98870)
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,properties = {"spring.cloud.config.discovery.enabled=false","spring.cloud.config.enabled=false"})
public class BookingRepositoryTest {

    @Autowired
    private BookingRepository bookingRepository;

    @Test
    public void checkSaveBooking() throws Exception {
        Customer customer = new Customer();
        customer.setCustomerId(1L);
        customer.setCustomerName("Meier");

// Path: booking-service/src/main/java/de/codecentric/resilient/booking/entity/Address.java
// @Embeddable
// public class Address {
// 
//     @Basic
//     private String country;
// 
//     @Basic
//     private String city;
// 
//     @Basic
//     private String postcode;
// 
//     @Basic
//     private String street;
// 
//     @Basic
//     private String streetNumber;
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// }
// 
// Path: booking-service/src/main/java/de/codecentric/resilient/booking/entity/Booking.java
// @Entity
// public class Booking {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     @Embedded
//     private Customer customer;
// 
//     private Long connote;
// 
//     @Column(name = "created", nullable = false)
//     private LocalDateTime created = LocalDateTime.now();
// 
//     @Embedded
//     @AttributeOverrides({
//             @AttributeOverride(name="street",column=@Column(name="receiverStreet")),
//             @AttributeOverride(name="city",column=@Column(name="receiverCity")),
//             @AttributeOverride(name="postcode",column=@Column(name="receiverPostcode")),
//             @AttributeOverride(name="country",column=@Column(name="receiverCountry")),
//             @AttributeOverride(name="streetNumber",column=@Column(name="receiverStreeNumber"))
//     })
//     private Address receiverAddress;
// 
//     @Embedded
//     @AttributeOverrides({
//             @AttributeOverride(name="street",column=@Column(name="senderStreet")),
//             @AttributeOverride(name="city",column=@Column(name="senderCity")),
//             @AttributeOverride(name="postcode",column=@Column(name="senderPostcode")),
//             @AttributeOverride(name="country",column=@Column(name="senderCountry")),
//             @AttributeOverride(name="streetNumber",column=@Column(name="senderStreeNumber"))
//             })
//     private Address senderAddress;
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public Customer getCustomer() {
//         return customer;
//     }
// 
//     public void setCustomer(Customer customer) {
//         this.customer = customer;
//     }
// 
//     public Long getConnote() {
//         return connote;
//     }
// 
//     public void setConnote(Long connote) {
//         this.connote = connote;
//     }
// 
//     public LocalDateTime getCreated() {
//         return created;
//     }
// 
//     public Address getReceiverAddress() {
//         return receiverAddress;
//     }
// 
//     public void setReceiverAddress(Address receiverAddress) {
//         this.receiverAddress = receiverAddress;
//     }
// 
//     public Address getSenderAddress() {
//         return senderAddress;
//     }
// 
//     public void setSenderAddress(Address senderAddress) {
//         this.senderAddress = senderAddress;
//     }
// }
// 
// Path: booking-service/src/main/java/de/codecentric/resilient/booking/entity/Customer.java
// @Embeddable
// public class Customer {
// 
//     private Long customerId;
// 
//     private String customerName;
// 
//     public Long getCustomerId() {
//         return customerId;
//     }
// 
//     public void setCustomerId(Long customerId) {
//         this.customerId = customerId;
//     }
// 
//     public String getCustomerName() {
//         return customerName;
//     }
// 
//     public void setCustomerName(String customerName) {
//         this.customerName = customerName;
//     }
// }


// Path: booking-service/src/test/java/de/codecentric/resilient/booking/repository/BookingRepositoryTest.java
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import de.codecentric.resilient.booking.entity.Address;
import de.codecentric.resilient.booking.entity.Booking;
import de.codecentric.resilient.booking.entity.Customer;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

package de.codecentric.resilient.booking.repository;



/**
 * @author Benjamin Wilms (xd98870)
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,properties = {"spring.cloud.config.discovery.enabled=false","spring.cloud.config.enabled=false"})
public class BookingRepositoryTest {

    @Autowired
    private BookingRepository bookingRepository;

    @Test
    public void checkSaveBooking() throws Exception {
        Customer customer = new Customer();
        customer.setCustomerId(1L);
        customer.setCustomerName("Meier");

        Address senderAddress = createAddress();