Skip to content

Commit 188f825

Browse files
committed
HHH-19846 Drop JUnit 4 usage
1 parent c960920 commit 188f825

29 files changed

+835
-730
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Building.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import jakarta.persistence.Entity;
78
import jakarta.persistence.GeneratedValue;
89
import jakarta.persistence.Id;
@@ -14,7 +15,9 @@
1415
*/
1516
@Entity
1617
public class Building {
17-
@Id @GeneratedValue private Long id;
18+
@Id
19+
@GeneratedValue
20+
private Long id;
1821

1922
@ManyToOne @JoinColumn(name="company_id", referencedColumnName = "name")
2023
private BuildingCompany company;

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/BuildingCompany.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import java.util.Date;
78
import jakarta.persistence.Entity;
89
import jakarta.persistence.GeneratedValue;
@@ -13,7 +14,10 @@
1314
*/
1415
@Entity
1516
public class BuildingCompany extends Company {
16-
@Id @GeneratedValue private Long id;
17+
@Id
18+
@GeneratedValue
19+
private Long id;
20+
1721
private Date foundedIn;
1822

1923
public Date getFoundedIn() {

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Cat.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import java.util.Set;
78
import jakarta.persistence.EmbeddedId;
89
import jakarta.persistence.Entity;
@@ -52,9 +53,7 @@ public void setAge(int age) {
5253

5354
public boolean equals(Object o) {
5455
if ( this == o ) return true;
55-
if ( !( o instanceof Cat ) ) return false;
56-
57-
final Cat cat = (Cat) o;
56+
if ( !(o instanceof Cat cat) ) return false;
5857

5958
if ( !id.equals( cat.id ) ) return false;
6059

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/City.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import jakarta.persistence.Entity;
78
import jakarta.persistence.GeneratedValue;
89
import jakarta.persistence.Id;

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Contractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import java.io.Serializable;
78
import jakarta.persistence.Entity;
89

@@ -12,7 +13,6 @@
1213
* @author Emmanuel Bernard
1314
*/
1415
@Entity
15-
@SuppressWarnings("serial")
1616
public class Contractor extends Employee implements Serializable {
1717

1818
private float hourlyRate;

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Employee.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import java.io.Serializable;
78
import java.util.Collection;
89
import jakarta.persistence.CascadeType;
@@ -24,7 +25,6 @@
2425
*/
2526
@Entity
2627
@Inheritance(strategy = InheritanceType.JOINED)
27-
@SuppressWarnings("serial")
2828
public class Employee implements Serializable {
2929
private Integer id;
3030
private Collection<Employer> employers;

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Employer.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@
2525
*/
2626
@Entity()
2727
@Table(name="`Employer`")
28-
@SuppressWarnings({"serial", "unchecked"})
2928
public class Employer implements Serializable {
3029
private Integer id;
31-
private Collection employees;
32-
private List contractors;
30+
private Collection<Employee> employees;
31+
private List<Contractor> contractors;
3332

3433
@ManyToMany(
3534
targetEntity = Contractor.class,
@@ -42,11 +41,11 @@ public class Employer implements Serializable {
4241
)
4342
@Cascade({org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.MERGE})
4443
@OrderBy("name desc")
45-
public List getContractors() {
44+
public List<Contractor> getContractors() {
4645
return contractors;
4746
}
4847

49-
public void setContractors(List contractors) {
48+
public void setContractors(List<Contractor> contractors) {
5049
this.contractors = contractors;
5150
}
5251

@@ -61,7 +60,7 @@ public void setContractors(List contractors) {
6160
)
6261
@Cascade({org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.MERGE})
6362
@OrderBy("name asc")
64-
public Collection getEmployees() {
63+
public Collection<Employee> getEmployees() {
6564
return employees;
6665
}
6766

@@ -71,7 +70,7 @@ public Integer getId() {
7170
return id;
7271
}
7372

74-
public void setEmployees(Collection set) {
73+
public void setEmployees(Collection<Employee> set) {
7574
employees = set;
7675
}
7776

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Friend.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import java.io.Serializable;
78
import java.util.Set;
89
import jakarta.persistence.CascadeType;

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Group.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import java.util.Collection;
78
import jakarta.persistence.CascadeType;
89
import jakarta.persistence.Entity;

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/manytomany/Inspector.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright Red Hat Inc. and Hibernate Authors
44
*/
55
package org.hibernate.orm.test.annotations.manytomany;
6+
67
import java.io.Serializable;
78
import jakarta.persistence.Column;
89
import jakarta.persistence.Entity;

0 commit comments

Comments
 (0)