Polish
Closes gh-5714
This commit is contained in:
committed by
Stephane Nicoll
parent
15dee60049
commit
6d48ee9593
@@ -34,7 +34,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
|
||||
/**
|
||||
* {@code @WebIntegrationTest} for {@link SampleTestApplication}.
|
||||
* {@code @SpringBootTest} with a random port for {@link SampleTestApplication}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
|
||||
@@ -47,14 +47,14 @@ public class UserEntityTests {
|
||||
private TestEntityManager entityManager;
|
||||
|
||||
@Test
|
||||
public void createWhenUserIdIsNullShouldThrowException() throws Exception {
|
||||
public void createWhenUsernameIsNullShouldThrowException() throws Exception {
|
||||
this.thrown.expect(IllegalArgumentException.class);
|
||||
this.thrown.expectMessage("Username must not be empty");
|
||||
new User(null, VIN);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createWhenUserIdIsEmptyShouldThrowException() throws Exception {
|
||||
public void createWhenUsernameIsEmptyShouldThrowException() throws Exception {
|
||||
this.thrown.expect(IllegalArgumentException.class);
|
||||
this.thrown.expectMessage("Username must not be empty");
|
||||
new User("", VIN);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class VehicleIdentificationNumberTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void equalsAndHashShouldBeBasedOnVin() throws Exception {
|
||||
public void equalsAndHashCodeShouldBeBasedOnVin() throws Exception {
|
||||
VehicleIdentificationNumber vin1 = new VehicleIdentificationNumber(SAMPLE_VIN);
|
||||
VehicleIdentificationNumber vin2 = new VehicleIdentificationNumber(SAMPLE_VIN);
|
||||
VehicleIdentificationNumber vin3 = new VehicleIdentificationNumber(
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* JSON Tests for {@link VehicleDetails}.
|
||||
* JSON tests for {@link VehicleDetails}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
|
||||
@@ -67,7 +67,7 @@ public class UserVehicleControllerApplicationTests {
|
||||
|
||||
@Test
|
||||
public void welcomeCommandLineRunnerShouldBeAvailable() throws Exception {
|
||||
// Since we're a @SpringApplicationTest all beans should be available
|
||||
// Since we're a @SpringBootTest all beans should be available.
|
||||
assertThat(this.applicationContext.getBean(WelcomeCommandLineRunner.class))
|
||||
.isNotNull();
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class UserVehicleControllerTests {
|
||||
|
||||
@Test(expected = NoSuchBeanDefinitionException.class)
|
||||
public void welcomeCommandLineRunnerShouldBeAvailable() throws Exception {
|
||||
// Since we're a @WebMvcTest WelcomeCommandLineRunner should not be available
|
||||
// Since we're a @WebMvcTest WelcomeCommandLineRunner should not be available.
|
||||
assertThat(this.applicationContext.getBean(WelcomeCommandLineRunner.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class UserVehicleServiceTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getVehicleDetailsWhenUserNameNotFoundShouldThrowException()
|
||||
public void getVehicleDetailsWhenUsernameNotFoundShouldThrowException()
|
||||
throws Exception {
|
||||
given(this.userRepository.findByUsername(anyString())).willReturn(null);
|
||||
this.thrown.expect(UserNameNotFoundException.class);
|
||||
|
||||
Reference in New Issue
Block a user