Polishing

Adding `@author` tags to modified files.
Remove Hamcrest usage.

Original pull request #602
Related tickest #583
This commit is contained in:
Jens Schauder
2021-01-29 10:41:19 +01:00
parent 9db9632c4b
commit 66a78013a3
6 changed files with 15 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
* Integration tests to bootstrap the application.
*
* @author Oliver Gierke
* @author Divya Srivastava
*/
@ExtendWith(SpringExtension.class)
@SpringBootTest

View File

@@ -15,16 +15,17 @@
*/
package example.users;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.*;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import static org.assertj.core.api.Assertions.*;
/**
* Integration tests for {@link UserManagement}.
*
* @author Oliver Gierke
* @author Divya Srivastava
* @author Jens Schauder
*/
public class UserManagementIntegrationTests extends AbstractIntegrationTests {
@@ -38,6 +39,6 @@ public class UserManagementIntegrationTests extends AbstractIntegrationTests {
User user = userManagement.register(new Username("olivergierke"), Password.raw("foobar"));
assertThat(user.getPassword().isEncrypted(), is(true));
assertThat(user.getPassword().isEncrypted()).isTrue();
}
}

View File

@@ -24,6 +24,7 @@ import org.springframework.dao.InvalidDataAccessApiUsageException;
* Integration tests for {@link UserRepository}.
*
* @author Oliver Gierke
* @author Divya Srivastava
*/
public class UserRepositoryIntegrationTests extends AbstractIntegrationTests {

View File

@@ -15,9 +15,6 @@
*/
package example.users;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.*;
import example.users.UserController.UserPayload;
import org.junit.jupiter.api.Test;
@@ -39,11 +36,15 @@ import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import static org.assertj.core.api.Assertions.*;
/**
* Integration tests for {@link UserController} to demonstrate client-side resilience of the payload type against
* changes in the representation.
*
* @author Oliver Gierke
* @author Divya Srivastava
* @author Jens Schauder
*/
@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@@ -99,7 +100,7 @@ public class UserControllerClientTests {
private static void assertDave(UserPayload payload) {
assertThat(payload.getFirstname(), is("Dave"));
assertThat(payload.getLastname(), is("Matthews"));
assertThat(payload.getFirstname()).isEqualTo("Dave");
assertThat(payload.getLastname()).isEqualTo("Matthews");
}
}

View File

@@ -34,6 +34,7 @@ import org.springframework.test.web.servlet.ResultActions;
* Integration tests for {@link UserController}.
*
* @author Oliver Gierke
* @author Divya Srivastava
*/
@ExtendWith(SpringExtension.class)
@SpringBootTest

View File

@@ -23,6 +23,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
/**
* @author Oliver Gierke
* @author Divya Srivastava
*/
@ExtendWith(SpringExtension.class)
@SpringBootTest