本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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));
}
示例5: customers
import com.ewolff.microservice.order.clients.Customer; //导入依赖的package包/类
@ModelAttribute("customers")
public Collection<Customer> customers() {
return customerClient.findAll();
}
示例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));
}