当前位置: 首页>>代码示例>>Java>>正文


Java Customer类代码示例

本文整理汇总了Java中com.ewolff.microservice.order.clients.Customer的典型用法代码示例。如果您正苦于以下问题:Java Customer类的具体用法?Java Customer怎么用?Java Customer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Customer类属于com.ewolff.microservice.order.clients包,在下文中一共展示了Customer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getById

import com.ewolff.microservice.order.clients.Customer; //导入依赖的package包/类
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ResponseEntity<Customer> getById(@PathVariable("id") long id) {

	if (id != 42) {
		return new ResponseEntity<Customer>(HttpStatus.NOT_FOUND);
	}
	return new ResponseEntity<Customer>(new Customer(42, "Eberhard",
			"Wolff", "[email protected]", "Unter den Linden",
			"Berlin"), HttpStatus.OK);
}
 
开发者ID:ewolff,项目名称:microservice-cloudfoundry,代码行数:11,代码来源:CustomerStub.java

示例2: testFindAll

import com.ewolff.microservice.order.clients.Customer; //导入依赖的package包/类
@Test
public void testFindAll() {
	Collection<Customer> result = customerClient.findAll();
	assertEquals(
			1,
			result.stream()
					.filter(c -> (c.getName().equals("Wolff")
							&& c.getFirstname().equals("Eberhard")
							&& c.getEmail().equals(
									"[email protected]")
							&& c.getStreet().equals("Unter den Linden") && c
							.getCity().equals("Berlin"))).count());
}
 
开发者ID:ewolff,项目名称:microservice-cloudfoundry,代码行数:14,代码来源:CustomerConsumerDrivenContractTest.java

示例3: testGetOne

import com.ewolff.microservice.order.clients.Customer; //导入依赖的package包/类
@Test
public void testGetOne() {
	Collection<Customer> allCustomer = customerClient.findAll();
	Long id = allCustomer.iterator().next().getCustomerId();
	Customer result = customerClient.getOne(id);
	assertEquals(id.longValue(), result.getCustomerId());
}
 
开发者ID:ewolff,项目名称:microservice-cloudfoundry,代码行数:8,代码来源:CustomerConsumerDrivenContractTest.java

示例4: testValidCustomerId

import com.ewolff.microservice.order.clients.Customer; //导入依赖的package包/类
@Test
public void testValidCustomerId() {
	Collection<Customer> allCustomer = customerClient.findAll();
	Long id = allCustomer.iterator().next().getCustomerId();
	assertTrue(customerClient.isValidCustomerId(id));
	assertFalse(customerClient.isValidCustomerId(-1));
}
 
开发者ID:ewolff,项目名称:microservice-cloudfoundry,代码行数:8,代码来源:CustomerConsumerDrivenContractTest.java

示例5: customers

import com.ewolff.microservice.order.clients.Customer; //导入依赖的package包/类
@ModelAttribute("customers")
public Collection<Customer> customers() {
	return customerClient.findAll();
}
 
开发者ID:ewolff,项目名称:microservice-cloudfoundry,代码行数:5,代码来源:OrderController.java

示例6: getAll

import com.ewolff.microservice.order.clients.Customer; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
public PagedResources<Customer> getAll() {
	return new PagedResources<Customer>(Arrays.asList(new Customer(42,
			"Eberhard", "Wolff", "[email protected]",
			"Unter den Linden", "Berlin")), new PageMetadata(1, 0, 1));
}
 
开发者ID:ewolff,项目名称:microservice-cloudfoundry,代码行数:7,代码来源:CustomerStub.java


注:本文中的com.ewolff.microservice.order.clients.Customer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。