### Question:
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; }  TdBProduct getProductInfo(Long productId);  }### Answer:
@Test public void getProductInfo() throws Exception { Long productId = 99999830L; given(tdBProductRepository.findOne(productId)).willReturn(mockDiscnt(productId)); TdBProduct productInfo = productService.getProductInfo(99999830L); assertThat(productInfo.getProductId()).isEqualTo(productId); }
@Test(expected = ResourceNotFoundException.class) public void getProductInfoResourceNotFoundException() throws Exception { Long productId = 1L; productService.getProductInfo(99999830L); }