Support test annotations on interfaces
Prior to Java 8 it never really made much sense to author integration tests using interfaces. Consequently, the Spring TestContext Framework has never supported finding test-related annotations on interfaces in its search algorithms. However, Java 8's support for interface default methods introduces new testing use cases for which it makes sense to declare test configuration (e.g., @ContextConfiguration, etc.) on an interface containing default methods instead of on an abstract base class. This commit ensures that all non-repeatable, class-level test annotations in the Spring TestContext Framework can now be declared on test interfaces. The only test annotations that cannot be declared on interfaces are therefore @Sql and @SqlGroup. Issue: SPR-14184
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,13 @@ public class Employee extends TestBean {
|
||||
|
||||
private String co;
|
||||
|
||||
public Employee() {
|
||||
}
|
||||
|
||||
public Employee(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return co;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user