Fixed deprecation usage in spring-boot
This commit is contained in:
parent
cb4470edea
commit
832a3dc176
|
@ -5,10 +5,10 @@ import java.util.Map;
|
|||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
|
|
@ -5,10 +5,10 @@ import java.util.Map;
|
|||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
|
|
@ -45,10 +45,10 @@ public class EmployeeControllerIntegrationTest {
|
|||
@Test
|
||||
public void whenPostEmployee_thenCreateEmployee() throws Exception {
|
||||
Employee alex = new Employee("alex");
|
||||
given(service.save(Mockito.anyObject())).willReturn(alex);
|
||||
given(service.save(Mockito.any())).willReturn(alex);
|
||||
|
||||
mvc.perform(post("/api/employees").contentType(MediaType.APPLICATION_JSON).content(JsonUtil.toJson(alex))).andExpect(status().isCreated()).andExpect(jsonPath("$.name", is("alex")));
|
||||
verify(service, VerificationModeFactory.times(1)).save(Mockito.anyObject());
|
||||
verify(service, VerificationModeFactory.times(1)).save(Mockito.any());
|
||||
reset(service);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue