Open jchuquen opened 3 months ago
//given Vendor vendor = getVendor1();
//mockito BDD syntax given(vendorRepository.findById(anyLong())).willReturn(Optional.of(vendor));
//when VendorDTO vendorDTO = vendorService.getVendorById(1L);
//then then(vendorRepository).should(times(1)).findById(anyLong());
//JUnit Assert that with matchers assertThat(vendorDTO.getName(), is(equalTo(NAME_1)));
Please take as base project spring5-mvc-rest in branch vendor-api
//given Vendor vendor = getVendor1();
//mockito BDD syntax given(vendorRepository.findById(anyLong())).willReturn(Optional.of(vendor));
//when VendorDTO vendorDTO = vendorService.getVendorById(1L);
//then then(vendorRepository).should(times(1)).findById(anyLong());
//JUnit Assert that with matchers assertThat(vendorDTO.getName(), is(equalTo(NAME_1)));