[BAEL-5355] removed final modifiers (#12964)

This commit is contained in:
lukaswlodkowski 2022-11-05 09:01:14 +01:00 committed by GitHub
parent f0686dd5bd
commit adbb7e27bc
2 changed files with 13 additions and 13 deletions

View File

@ -12,10 +12,10 @@ public class SameObjectIdUnitTest {
@Test
public void givenSameDateAndCounter_whenComparingObjectIds_thenTheyAreNotEqual() {
final Date date = new Date();
final ObjectId objectIdDate = new ObjectId(date);
final ObjectId objectIdDateCounter1 = new ObjectId(date, 100);
final ObjectId objectIdDateCounter2 = new ObjectId(date, 100);
Date date = new Date();
ObjectId objectIdDate = new ObjectId(date);
ObjectId objectIdDateCounter1 = new ObjectId(date, 100);
ObjectId objectIdDateCounter2 = new ObjectId(date, 100);
assertThat(objectIdDate).isNotEqualTo(objectIdDateCounter1);
assertThat(objectIdDate).isNotEqualTo(objectIdDateCounter2);
@ -25,11 +25,11 @@ public class SameObjectIdUnitTest {
@Test
public void givenSameArrayOfBytes_whenComparingObjectIdsCreatedViaDifferentMethods_thenTheObjectIdsAreEqual() {
final byte[] bytes = "123456789012".getBytes();
final ObjectId objectIdBytes = new ObjectId(bytes);
byte[] bytes = "123456789012".getBytes();
ObjectId objectIdBytes = new ObjectId(bytes);
final ByteBuffer buffer = ByteBuffer.wrap(bytes);
final ObjectId objectIdByteBuffer = new ObjectId(buffer);
ByteBuffer buffer = ByteBuffer.wrap(bytes);
ObjectId objectIdByteBuffer = new ObjectId(buffer);
assertThat(objectIdBytes).isEqualTo(objectIdByteBuffer);
}

View File

@ -33,9 +33,9 @@ public class SameObjectIdUsedToInsertSameObjectIdUnitTest {
@Test
public void givenUserInDatabase_whenInsertingAnotherUserWithTheSameObjectId_DKEThrownAndInsertRetried() {
//given
final String userName = "Kevin";
final User firstUser = new User(ObjectId.get(), userName);
final User secondUser = new User(ObjectId.get(), userName);
String userName = "Kevin";
User firstUser = new User(ObjectId.get(), userName);
User secondUser = new User(ObjectId.get(), userName);
mongoTemplate.insert(firstUser);
@ -47,10 +47,10 @@ public class SameObjectIdUsedToInsertSameObjectIdUnitTest {
}
//then
final Query query = new Query();
Query query = new Query();
query.addCriteria(Criteria.where(User.NAME_FIELD)
.is(userName));
final List<User> users = mongoTemplate.find(query, User.class);
List<User> users = mongoTemplate.find(query, User.class);
assertThat(users).usingRecursiveComparison()
.isEqualTo(Lists.newArrayList(firstUser, secondUser));