Open
Description
Description
Download the project https://github.com/SalithaUCSC/spring-boot-testing
Try to generate tests for OrderService.createOrder
method with default settings.
Expected behavior
One test for this method containing one line is generated.
Actual behavior
There is a second erroneous test
@Test
@DisplayName("createOrder: return orderRepository.save(order) : True -> ThrowClassCastException")
public void testCreateOrder_OrderRepositorySave_1() {
byte[] byteArray = {};
// Order save(Order entity);
(when(orderRepositoryMock.save(any()))).thenReturn(byteArray);
/* This test fails because method [com.rest.order.services.OrderService.createOrder] produces [java.lang.ClassCastException: class]
orderService.createOrder(null);
}
Additional context
Yuri strongly recommends to refactor Traverser.updateGenericTypeInfo
.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo