com.ewolff.microservice.order.clients.Customer Java Examples

The following examples show how to use com.ewolff.microservice.order.clients.Customer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringRestDataConfig.java    From microservice-kubernetes with Apache License 2.0 5 votes vote down vote up
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {

	return new RepositoryRestConfigurerAdapter() {
		@Override
		public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
			config.exposeIdsFor(Order.class, Item.class, Customer.class);
		}
	};
}
 
Example #2
Source File: CustomerConsumerDrivenContractTest.java    From microservice with Apache License 2.0 5 votes vote down vote up
@Test
public void testValidCustomerId() {
	Collection<Customer> allCustomer = customerClient.findAll();
	Long id = allCustomer.iterator().next().getCustomerId();
	assertTrue(customerClient.isValidCustomerId(id));
	assertFalse(customerClient.isValidCustomerId(-1));
}
 
Example #3
Source File: CustomerConsumerDrivenContractTest.java    From microservice with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #4
Source File: CustomerConsumerDrivenContractTest.java    From microservice with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #5
Source File: CustomerStub.java    From microservice with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #6
Source File: SpringRestDataConfig.java    From microservice with Apache License 2.0 5 votes vote down vote up
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {

	return new RepositoryRestConfigurerAdapter() {
		@Override
		public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
			config.exposeIdsFor(Order.class, Item.class, Customer.class);
		}
	};
}
 
Example #7
Source File: CustomerConsumerDrivenContractTest.java    From microservice-consul with Apache License 2.0 5 votes vote down vote up
@Test
public void testValidCustomerId() {
	Collection<Customer> allCustomer = customerClient.findAll();
	Long id = allCustomer.iterator().next().getCustomerId();
	assertTrue(customerClient.isValidCustomerId(id));
	assertFalse(customerClient.isValidCustomerId(-1));
}
 
Example #8
Source File: CustomerConsumerDrivenContractTest.java    From microservice-consul with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #9
Source File: CustomerConsumerDrivenContractTest.java    From microservice-consul with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #10
Source File: CustomerStub.java    From microservice-consul with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #11
Source File: SpringRestDataConfig.java    From microservice-consul with Apache License 2.0 5 votes vote down vote up
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {

	return new RepositoryRestConfigurerAdapter() {
		@Override
		public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
			config.exposeIdsFor(Order.class, Item.class, Customer.class);
		}
	};
}
 
Example #12
Source File: CustomerConsumerDrivenContractTest.java    From microservice-kubernetes with Apache License 2.0 5 votes vote down vote up
@Test
public void testValidCustomerId() {
	Collection<Customer> allCustomer = customerClient.findAll();
	Long id = allCustomer.iterator().next().getCustomerId();
	assertTrue(customerClient.isValidCustomerId(id));
	assertFalse(customerClient.isValidCustomerId(-1));
}
 
Example #13
Source File: CustomerConsumerDrivenContractTest.java    From microservice-kubernetes with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #14
Source File: CustomerConsumerDrivenContractTest.java    From microservice-kubernetes with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #15
Source File: CustomerStub.java    From microservice-kubernetes with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #16
Source File: CustomerStub.java    From microservice-consul with Apache License 2.0 4 votes vote down vote up
@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));
}
 
Example #17
Source File: OrderController.java    From microservice-consul with Apache License 2.0 4 votes vote down vote up
@ModelAttribute("customers")
public Collection<Customer> customers() {
	return customerClient.findAll();
}
 
Example #18
Source File: OrderController.java    From microservice with Apache License 2.0 4 votes vote down vote up
@ModelAttribute("customers")
public Collection<Customer> customers() {
	return customerClient.findAll();
}
 
Example #19
Source File: CustomerStub.java    From microservice with Apache License 2.0 4 votes vote down vote up
@RequestMapping(method = RequestMethod.GET)
public PagedModel<Customer> getAll() {
	return new PagedModel<Customer>(Arrays.asList(new Customer(42,
			"Eberhard", "Wolff", "[email protected]",
			"Unter den Linden", "Berlin")), new PageMetadata(1, 0, 1));
}
 
Example #20
Source File: CustomerStub.java    From microservice-kubernetes with Apache License 2.0 4 votes vote down vote up
@RequestMapping(method = RequestMethod.GET)
public PagedModel<Customer> getAll() {
	return new PagedModel<Customer>(Arrays.asList(new Customer(42,
			"Eberhard", "Wolff", "[email protected]",
			"Unter den Linden", "Berlin")), new PageMetadata(1, 0, 1));
}
 
Example #21
Source File: OrderController.java    From microservice-kubernetes with Apache License 2.0 4 votes vote down vote up
@ModelAttribute("customers")
public Collection<Customer> customers() {
	return customerClient.findAll();
}