// Path: acmeair-customer-service/src/main/java/com/acmeair/service/CustomerService.java
// public interface CustomerService {
//     Customer createCustomer(String username, String password, Customer.MemberShipStatus status, int total_miles, int miles_ytd, String phoneNumber,
//                                    Customer.PhoneType phoneNumberType, CustomerAddressImpl address
//     );
//     
//     CustomerAddressImpl createAddress(String streetAddress1, String streetAddress2, String city, String stateProvince, String country, String postalCode);
//     
//     Customer updateCustomer(Customer customer);
//     
//     Customer getCustomerByUsername(String username);
//     
//     boolean validateCustomer(String username, String password);
//     
//     Customer getCustomerByUsernameAndPassword(String username, String password);
//     
//     CustomerSession validateSession(String sessionid);
//     
//     CustomerSession createSession(String customerId);
//     
//     void invalidateSession(String sessionid);
//     
//     Long count();
//     
//     Long countSessions();
// }
// 
// Path: acmeair-customer-service/src/main/java/com/acmeair/service/CustomerServiceSupport.java
// public abstract class CustomerServiceSupport implements CustomerService {
// 	protected static final int DAYS_TO_ALLOW_SESSION = 1;
// 	
// 	@Inject
// 	protected KeyGenerator keyGenerator;
// 	
// 	
// 	protected abstract Customer getCustomer(String username);
// 	
// 	@Override
// 	public Customer getCustomerByUsername(String username) {
// 		Customer c = getCustomer(username);
// 		if (c != null) {
// 			c.setPassword(null);
// 		}
// 		return c;
// 	}
// 
// 	@Override
// 	public boolean validateCustomer(String username, String password) {
// 		boolean validatedCustomer = false;
// 		Customer customerToValidate = getCustomer(username);
// 		if (customerToValidate != null) {
// 			validatedCustomer = password.equals(customerToValidate.getPassword());
// 		}
// 		return validatedCustomer;
// 	}
// 	
// 	@Override
// 	public Customer getCustomerByUsernameAndPassword(String username, String password) {
// 		Customer c = getCustomer(username);
// 		if (c != null && !c.getPassword().equals(password)) {
// 			return null;
// 		}
// 		// Should we also set the password to null?
// 		return c;
// 	}
// 		
// 	@Override
// 	public CustomerSession validateSession(String sessionid) {
// 		CustomerSession cSession = getSession(sessionid);
// 		if (cSession == null) {
// 			return null;
// 		}
// 
// 		Date now = new Date();
// 
// 		if (cSession.getTimeoutTime().before(now)) {
// 			removeSession(cSession);
// 			return null;
// 		}
// 		return cSession;		
// 	}
// 	
// 	protected abstract CustomerSession getSession(String sessionid);
// 	
// 	protected abstract void removeSession(CustomerSession session);
// 	
// 	@Override
// 	public CustomerSession createSession(String customerId) {
// 		String sessionId = keyGenerator.generate().toString();
// 		Date now = new Date();
// 		Calendar c = Calendar.getInstance();
// 		c.setTime(now);
// 		c.add(Calendar.DAY_OF_YEAR, DAYS_TO_ALLOW_SESSION);
// 		Date expiration = c.getTime();
// 		
// 		return createSession(sessionId, customerId, now, expiration);
// 	}
// 	
// 	protected abstract CustomerSession createSession(String sessionId, String customerId, Date creation, Date expiration);
// 	
// }


import au.com.dius.pact.provider.junit.PactRunner;
import au.com.dius.pact.provider.junit.Provider;
import au.com.dius.pact.provider.junit.State;
import au.com.dius.pact.provider.junit.loader.PactFolder;
import au.com.dius.pact.provider.junit.target.HttpTarget;
import au.com.dius.pact.provider.junit.target.Target;
import au.com.dius.pact.provider.junit.target.TestTarget;
import br.com.six2six.fixturefactory.Fixture;
import br.com.six2six.fixturefactory.loader.FixtureFactoryLoader;
import com.acmeair.entities.Customer;
import com.acmeair.morphia.entities.CustomerAddressImpl;
import com.acmeair.morphia.entities.CustomerImpl;
import com.acmeair.service.CustomerService;
import com.acmeair.service.CustomerServiceSupport;
import com.acmeair.web.dto.CustomerSessionInfo;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import test.com.acmeair.service.CustomerRestApplication;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.when;
package com.acmeair.web;




@RunWith(PactRunner.class)
@PactFolder("../target/pacts")
// Path: acmeair-customer-service/src/main/java/com/acmeair/service/CustomerService.java
// public interface CustomerService {
//     Customer createCustomer(String username, String password, Customer.MemberShipStatus status, int total_miles, int miles_ytd, String phoneNumber,
//                                    Customer.PhoneType phoneNumberType, CustomerAddressImpl address
//     );
//     
//     CustomerAddressImpl createAddress(String streetAddress1, String streetAddress2, String city, String stateProvince, String country, String postalCode);
//     
//     Customer updateCustomer(Customer customer);
//     
//     Customer getCustomerByUsername(String username);
//     
//     boolean validateCustomer(String username, String password);
//     
//     Customer getCustomerByUsernameAndPassword(String username, String password);
//     
//     CustomerSession validateSession(String sessionid);
//     
//     CustomerSession createSession(String customerId);
//     
//     void invalidateSession(String sessionid);
//     
//     Long count();
//     
//     Long countSessions();
// }
// 
// Path: acmeair-customer-service/src/main/java/com/acmeair/service/CustomerServiceSupport.java
// public abstract class CustomerServiceSupport implements CustomerService {
// 	protected static final int DAYS_TO_ALLOW_SESSION = 1;
// 	
// 	@Inject
// 	protected KeyGenerator keyGenerator;
// 	
// 	
// 	protected abstract Customer getCustomer(String username);
// 	
// 	@Override
// 	public Customer getCustomerByUsername(String username) {
// 		Customer c = getCustomer(username);
// 		if (c != null) {
// 			c.setPassword(null);
// 		}
// 		return c;
// 	}
// 
// 	@Override
// 	public boolean validateCustomer(String username, String password) {
// 		boolean validatedCustomer = false;
// 		Customer customerToValidate = getCustomer(username);
// 		if (customerToValidate != null) {
// 			validatedCustomer = password.equals(customerToValidate.getPassword());
// 		}
// 		return validatedCustomer;
// 	}
// 	
// 	@Override
// 	public Customer getCustomerByUsernameAndPassword(String username, String password) {
// 		Customer c = getCustomer(username);
// 		if (c != null && !c.getPassword().equals(password)) {
// 			return null;
// 		}
// 		// Should we also set the password to null?
// 		return c;
// 	}
// 		
// 	@Override
// 	public CustomerSession validateSession(String sessionid) {
// 		CustomerSession cSession = getSession(sessionid);
// 		if (cSession == null) {
// 			return null;
// 		}
// 
// 		Date now = new Date();
// 
// 		if (cSession.getTimeoutTime().before(now)) {
// 			removeSession(cSession);
// 			return null;
// 		}
// 		return cSession;		
// 	}
// 	
// 	protected abstract CustomerSession getSession(String sessionid);
// 	
// 	protected abstract void removeSession(CustomerSession session);
// 	
// 	@Override
// 	public CustomerSession createSession(String customerId) {
// 		String sessionId = keyGenerator.generate().toString();
// 		Date now = new Date();
// 		Calendar c = Calendar.getInstance();
// 		c.setTime(now);
// 		c.add(Calendar.DAY_OF_YEAR, DAYS_TO_ALLOW_SESSION);
// 		Date expiration = c.getTime();
// 		
// 		return createSession(sessionId, customerId, now, expiration);
// 	}
// 	
// 	protected abstract CustomerSession createSession(String sessionId, String customerId, Date creation, Date expiration);
// 	
// }


// Path: acmeair-customer-service/src/test/java/com/acmeair/web/CustomerServiceContractTest.java
import au.com.dius.pact.provider.junit.PactRunner;
import au.com.dius.pact.provider.junit.Provider;
import au.com.dius.pact.provider.junit.State;
import au.com.dius.pact.provider.junit.loader.PactFolder;
import au.com.dius.pact.provider.junit.target.HttpTarget;
import au.com.dius.pact.provider.junit.target.Target;
import au.com.dius.pact.provider.junit.target.TestTarget;
import br.com.six2six.fixturefactory.Fixture;
import br.com.six2six.fixturefactory.loader.FixtureFactoryLoader;
import com.acmeair.entities.Customer;
import com.acmeair.morphia.entities.CustomerAddressImpl;
import com.acmeair.morphia.entities.CustomerImpl;
import com.acmeair.service.CustomerService;
import com.acmeair.service.CustomerServiceSupport;
import com.acmeair.web.dto.CustomerSessionInfo;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import test.com.acmeair.service.CustomerRestApplication;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.when;

package com.acmeair.web;




@RunWith(PactRunner.class)
@PactFolder("../target/pacts")
@Provider("CustomerService")