// Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// 	@Autowired
// 	public CatalogController(CatalogService service) {
// 		super(service);
// 	}
// 
// 	@RequestMapping(value = "/v2/catalog", method = RequestMethod.GET)
// 	public Catalog getCatalog() {
// 		log.debug("getCatalog()");
// 		return catalogService.getCatalog();
// 	}
// }
// 
// Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
// 
// 	public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// 	public final static String API_VERSION_ANY = "*";
// 	public final static String API_VERSION_CURRENT = "2.8";
// 
// 	/**
// 	 * The name of the HTTP header field expected to contain the API version of the service broker client.
// 	 */
// 	private final String brokerApiVersionHeader;
// 
// 	/**
// 	 * The version of the broker API supported by the broker. A value of <code>null</code> or
// 	 * <code>API_VERSION_ANY</code> will disable API version validation.
// 	 */
// 	private final String apiVersion;
// 
// 	public BrokerApiVersion(String brokerApiVersionHeader, String apiVersion) {
// 		this.brokerApiVersionHeader = brokerApiVersionHeader;
// 		this.apiVersion = apiVersion;
// 	}
// 
// 	public BrokerApiVersion(String apiVersion) {
// 		this(DEFAULT_API_VERSION_HEADER, apiVersion);
// 	}
// 
// 	public BrokerApiVersion() {
// 		this(DEFAULT_API_VERSION_HEADER, API_VERSION_ANY);
// 	}
// }
// 
// Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/service/CatalogService.java
// public interface CatalogService {
// 
// 	/**
// 	 * Return the catalog of services provided by the service broker.
// 	 *
// 	 * @return the catalog of services
// 	 */
// 	Catalog getCatalog();
// 
// 	/**
// 	 * Get a service definition from the catalog by ID.
// 	 *
// 	 * @param serviceId  The ID of the service definition in the catalog
// 	 * @return the service definition, or null if it doesn't exist
// 	 */
// 	ServiceDefinition getServiceDefinition(String serviceId);
// 	
// }


import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.springframework.cloud.servicebroker.controller.CatalogController;
import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
package org.springframework.cloud.servicebroker.interceptor;



@RunWith(MockitoJUnitRunner.class)
public class BrokerApiVersionInterceptorIntegrationTest {

	private final static String CATALOG_PATH = "/v2/catalog";

	private MockMvc mockMvc;

	@InjectMocks
	private CatalogController controller;

	@Mock
	private CatalogService catalogService;

	@Before
	public void setup() {
		this.mockMvc = MockMvcBuilders.standaloneSetup(controller)
// Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// 	@Autowired
// 	public CatalogController(CatalogService service) {
// 		super(service);
// 	}
// 
// 	@RequestMapping(value = "/v2/catalog", method = RequestMethod.GET)
// 	public Catalog getCatalog() {
// 		log.debug("getCatalog()");
// 		return catalogService.getCatalog();
// 	}
// }
// 
// Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
// 
// 	public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// 	public final static String API_VERSION_ANY = "*";
// 	public final static String API_VERSION_CURRENT = "2.8";
// 
// 	/**
// 	 * The name of the HTTP header field expected to contain the API version of the service broker client.
// 	 */
// 	private final String brokerApiVersionHeader;
// 
// 	/**
// 	 * The version of the broker API supported by the broker. A value of <code>null</code> or
// 	 * <code>API_VERSION_ANY</code> will disable API version validation.
// 	 */
// 	private final String apiVersion;
// 
// 	public BrokerApiVersion(String brokerApiVersionHeader, String apiVersion) {
// 		this.brokerApiVersionHeader = brokerApiVersionHeader;
// 		this.apiVersion = apiVersion;
// 	}
// 
// 	public BrokerApiVersion(String apiVersion) {
// 		this(DEFAULT_API_VERSION_HEADER, apiVersion);
// 	}
// 
// 	public BrokerApiVersion() {
// 		this(DEFAULT_API_VERSION_HEADER, API_VERSION_ANY);
// 	}
// }
// 
// Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/service/CatalogService.java
// public interface CatalogService {
// 
// 	/**
// 	 * Return the catalog of services provided by the service broker.
// 	 *
// 	 * @return the catalog of services
// 	 */
// 	Catalog getCatalog();
// 
// 	/**
// 	 * Get a service definition from the catalog by ID.
// 	 *
// 	 * @param serviceId  The ID of the service definition in the catalog
// 	 * @return the service definition, or null if it doesn't exist
// 	 */
// 	ServiceDefinition getServiceDefinition(String serviceId);
// 	
// }


// Path: src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptorIntegrationTest.java
import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.springframework.cloud.servicebroker.controller.CatalogController;
import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

package org.springframework.cloud.servicebroker.interceptor;



@RunWith(MockitoJUnitRunner.class)
public class BrokerApiVersionInterceptorIntegrationTest {

	private final static String CATALOG_PATH = "/v2/catalog";

	private MockMvc mockMvc;

	@InjectMocks
	private CatalogController controller;

	@Mock
	private CatalogService catalogService;

	@Before
	public void setup() {
		this.mockMvc = MockMvcBuilders.standaloneSetup(controller)
				.addInterceptors(new BrokerApiVersionInterceptor(new BrokerApiVersion("header", "expected-version")))