Skip to content

Commit

Permalink
update controller advisor test formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsage1 committed Nov 8, 2023
1 parent 5d5ff8e commit 214fe5e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
import static org.mockito.Mockito.when;

import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;


@SpringJUnitConfig
@WebMvcTest(ControllerAdvisor.class)
public class ControllerAdvisorTest {
Expand Down Expand Up @@ -50,7 +49,8 @@ public void bindException_ShouldReturnResultAndException_WhenMockErrorIsPassed()
// Create a mock BindingResult
BindingResult bindingResult = new BindException(new Object(), "objectName");
bindingResult.addError(fieldError);
BindingResult handleBindException = new HandleBindException(bindException, header, status, webRequest);
BindingResult handleBindException =
new HandleBindException(bindException, header, status, webRequest);

// // Set up the mock BindException to return the mock BindingResult
when(bindException.getBindingResult()).thenReturn(bindingResult);
Expand Down

0 comments on commit 214fe5e

Please sign in to comment.