Skip to content

Commit 7788c29

Browse files
authored
Merge pull request #3344 from hazendaz/pom-cleanup
Further cleanup of tests
2 parents c2a647c + ca1f7bd commit 7788c29

27 files changed

+67
-45
lines changed

src/test/java/org/apache/ibatis/domain/blog/Author.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -121,8 +121,7 @@ public boolean equals(Object o) {
121121

122122
@Override
123123
public int hashCode() {
124-
int result;
125-
result = id;
124+
int result = id;
126125
result = 31 * result + (username != null ? username.hashCode() : 0);
127126
result = 31 * result + (password != null ? password.hashCode() : 0);
128127
result = 31 * result + (email != null ? email.hashCode() : 0);

src/test/java/org/apache/ibatis/domain/blog/ComplexImmutableAuthor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public boolean equals(Object o) {
5252

5353
final ComplexImmutableAuthor that = (ComplexImmutableAuthor) o;
5454

55-
if ((bio != null ? !bio.equals(that.bio) : that.bio != null) || (favouriteSection != that.favouriteSection)
55+
if ((bio != null ? !bio.equals(that.bio) : that.bio != null) || favouriteSection != that.favouriteSection
5656
|| (theComplexImmutableAuthorId != null ? !theComplexImmutableAuthorId.equals(that.theComplexImmutableAuthorId)
5757
: that.theComplexImmutableAuthorId != null)) {
5858
return false;

src/test/java/org/apache/ibatis/domain/blog/ComplexImmutableAuthorId.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ public boolean equals(Object o) {
5555

5656
final ComplexImmutableAuthorId that = (ComplexImmutableAuthorId) o;
5757

58-
if ((id != that.id) || (email != null ? !email.equals(that.email) : that.email != null)
58+
if (id != that.id || (email != null ? !email.equals(that.email) : that.email != null)
5959
|| (password != null ? !password.equals(that.password) : that.password != null)
6060
|| (username != null ? !username.equals(that.username) : that.username != null)) {
6161
return false;

src/test/java/org/apache/ibatis/domain/blog/ImmutableAuthor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -88,8 +88,7 @@ public boolean equals(Object o) {
8888

8989
@Override
9090
public int hashCode() {
91-
int result;
92-
result = id;
91+
int result = id;
9392
result = 31 * result + (username != null ? username.hashCode() : 0);
9493
result = 31 * result + (password != null ? password.hashCode() : 0);
9594
result = 31 * result + (email != null ? email.hashCode() : 0);

src/test/java/org/apache/ibatis/domain/blog/PostLite.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ public boolean equals(Object o) {
5454

5555
final PostLite that = (PostLite) o;
5656

57-
if ((blogId != that.blogId) || (theId != null ? !theId.equals(that.theId) : that.theId != null)) {
57+
if (blogId != that.blogId || (theId != null ? !theId.equals(that.theId) : that.theId != null)) {
5858
return false;
5959
}
6060

src/test/java/org/apache/ibatis/executor/loader/SerializableProxyTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.apache.ibatis.executor.loader;
1717

18-
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
1918
import static org.junit.jupiter.api.Assertions.assertEquals;
2019
import static org.junit.jupiter.api.Assertions.assertFalse;
2120
import static org.junit.jupiter.api.Assertions.fail;

src/test/java/org/apache/ibatis/mapping/VendorDatabaseIdProviderTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616
package org.apache.ibatis.mapping;
1717

18-
import static org.junit.jupiter.api.Assertions.*;
18+
import static org.junit.jupiter.api.Assertions.assertEquals;
19+
import static org.junit.jupiter.api.Assertions.assertNull;
20+
import static org.junit.jupiter.api.Assertions.fail;
1921
import static org.mockito.Mockito.mock;
2022
import static org.mockito.Mockito.when;
2123

src/test/java/org/apache/ibatis/reflection/ArrayUtilTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,8 +27,7 @@ class ArrayUtilTest {
2727

2828
@Test
2929
void testHashCode() {
30-
Object arr;
31-
arr = new long[] { 1 };
30+
Object arr = new long[] { 1 };
3231
assertEquals(Arrays.hashCode((long[]) arr), ArrayUtil.hashCode(arr));
3332
arr = new int[] { 1 };
3433
assertEquals(Arrays.hashCode((int[]) arr), ArrayUtil.hashCode(arr));
@@ -84,8 +83,7 @@ void testequals() {
8483

8584
@Test
8685
void testToString() {
87-
Object arr;
88-
arr = new long[] { 1 };
86+
Object arr = new long[] { 1 };
8987
assertEquals(Arrays.toString((long[]) arr), ArrayUtil.toString(arr));
9088
arr = new int[] { 1 };
9189
assertEquals(Arrays.toString((int[]) arr), ArrayUtil.toString(arr));

src/test/java/org/apache/ibatis/reflection/property/PropertyTokenizerTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
package org.apache.ibatis.reflection.property;
1717

1818
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
19-
import static org.junit.jupiter.api.Assertions.*;
19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertFalse;
21+
import static org.junit.jupiter.api.Assertions.assertNull;
22+
import static org.junit.jupiter.api.Assertions.assertTrue;
2023

2124
import org.junit.jupiter.api.Test;
2225

src/test/java/org/apache/ibatis/reflection/wrapper/BeanWrapperTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
*/
1616
package org.apache.ibatis.reflection.wrapper;
1717

18-
import static org.junit.jupiter.api.Assertions.*;
18+
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertFalse;
21+
import static org.junit.jupiter.api.Assertions.assertNull;
22+
import static org.junit.jupiter.api.Assertions.assertTrue;
23+
import static org.junit.jupiter.api.Assertions.fail;
1924

2025
import java.util.ArrayList;
2126
import java.util.Arrays;

0 commit comments

Comments
 (0)