1. 28 8月, 2019 3 次提交
  2. 23 8月, 2019 1 次提交
  3. 09 8月, 2019 1 次提交
  4. 31 7月, 2019 2 次提交
  5. 30 7月, 2019 2 次提交
  6. 28 7月, 2019 3 次提交
    • S
      Polish MergedTestPropertySources · bfbe8f87
      Sam Brannen 提交于
      bfbe8f87
    • S
      Overhaul repeatable @TestPropertySource support · 136af0b1
      Sam Brannen 提交于
      Prior to this commit, if multiple, directly present
      `@TestPropertySource` annotations declared the same property, the
      precedence ordering was top-down instead of bottom-up, in contrast to
      the semantics for class hierarchies. In other words, a subsequent
      `@TestPropertySource` annotation could not override a property in a
      previous `@TestPropertySource` annotation.
      
      This commit overhauls the internals of `TestPropertySourceUtils` in
      order to provide proper support for property overrides within local,
      directly present `@TestPropertySource` declarations.
      
      Specifically, the `locations` and `properties` attributes from all
      `@TestPropertySource` declarations that are directly present or
      meta-present on a given class are now merged into a single instance of
      `TestPropertySourceAttributes` internally, with assertions in place to
      ensure that such "same level" `@TestPropertySource` declarations do not
      configure different values for the `inheritLocations` and
      `inheritProperties` flags. Effectively, all "same level"
      `@TestPropertySource` declarations are treated internally as if there
      were only one such annotation declared by the user.
      
      See gh-23320
      136af0b1
    • A
      Support @TestPropertySource as a repeatable annotation · 2e476ca1
      Anatoliy Korovin 提交于
      Prior to this commit, @TestPropertySource could not be declared as a
      repeatable annotation. In addition, a local declaration of
      @TestPropertySource would silently override a meta-present
      @TestPropertySource.
      
      This commit addresses this issue by introducing @TestPropertySources as
      a container for @TestPropertySource. This commit also updates the
      search and algorithms within TestPropertySourceUtils.
      
      Closes gh-23320
      2e476ca1
  7. 12 7月, 2019 2 次提交
    • S
      Polishing · 09c10232
      Sam Brannen 提交于
      See gh-23224
      09c10232
    • S
      Change @TestConstructor.autowire attribute into an enum · fc38bb4f
      Sam Brannen 提交于
      Prior to this commit, @TestConstructor supported a boolean `autowire`
      attribute which naturally limited the configuration to two states: on
      or off. Since we may need to support additional autowiring modes in the
      future, the use of a boolean is limiting.
      
      This commit address this issue by introducing a new AutowireMode enum
      in @TestConstructor with ALL and ANNOTATED constants. In addition, the
      attribute has been renamed to `autowireMode`, and the system property
      has been renamed to `spring.test.constructor.autowire.mode` for greater
      clarity of purpose.
      
      Closes gh-23224
      fc38bb4f
  8. 27 5月, 2019 2 次提交
  9. 08 5月, 2019 1 次提交
    • S
      Support automatic constructor injection in JUnit Jupiter · 77eef474
      Sam Brannen 提交于
      Prior to this commit, dependency injection of all arguments in a test
      class constructor invoked by JUnit Jupiter was only possible if the
      constructor was explicitly annotated with @Autowired.
      
      This commit introduces support for a configurable "test constructor
      autowire" mode which defaults to false in order to remain backwards
      compatible.
      
      Specifically, this mode can be configured globally for an entire test
      suite via a new "spring.test.constructor.autowire" JVM system property
      that can alternatively be configured via the SpringProperties
      mechanism. In addition, the global "test constructor autowire" mode can
      be overridden locally on a per-class basis via the new @TestConstructor
      annotation.
      
      Closes gh-22286
      77eef474
  10. 06 4月, 2019 1 次提交
    • S
      Add support to query if ApplicationContext is available in the TCF · c3d0459a
      Sam Brannen 提交于
      This commit introduces support in the Spring TestContext Framework
      (TCF) to query whether the test's ApplicationContext is available.
      
      Specifically, this commit introduces the following two `default`
      methods along with corresponding implementations in DefaultTestContext
      and DefaultCacheAwareContextLoaderDelegate.
      
      - `boolean hasApplicationContext()` in the TestContext API
      
      - `boolean isContextLoaded(MergedContextConfiguration)` in the
        CacheAwareContextLoaderDelegate API
      
      Closes gh-22756
      c3d0459a
  11. 23 3月, 2019 1 次提交
  12. 22 3月, 2019 1 次提交
  13. 09 2月, 2019 1 次提交
  14. 24 8月, 2018 1 次提交
  15. 02 8月, 2018 2 次提交
  16. 28 6月, 2018 3 次提交
  17. 25 2月, 2018 1 次提交
  18. 22 2月, 2018 1 次提交
  19. 22 1月, 2018 1 次提交
  20. 18 1月, 2018 1 次提交
  21. 12 1月, 2018 1 次提交
  22. 15 9月, 2017 1 次提交
    • S
      Revisit nullability annotations · 1bc93e3d
      Sebastien Deleuze 提交于
      This commit introduces the following changes.
      
      1) It adds a new Spring @NonNull annotation which allows to apply
      @NonNullApi semantic on a specific element, like @Nullable does.
      Combined with @Nullable, it allows partial null-safety support when
      package granularity is too broad.
      
      2) @Nullable and @NonNull can apply to ElementType.TYPE_USE in order
      to be used on generic type arguments (SPR-15942).
      
      3) Annotations does not apply to ElementType.TYPE_PARAMETER anymore
      since it is not supported yet (applicability for such use case is
      controversial and need to be discussed).
      
      4) @NonNullApi does not apply to ElementType.FIELD anymore since in a
      lot of use cases (private, protected) it is not part for the public API
      + its usage should remain opt-in. A dedicated @NonNullFields annotation
      has been added in order to set fields default to non-nullable.
      
      5) Updated Javadoc and reference documentation.
      
      Issue: SPR-15756
      1bc93e3d
  23. 17 8月, 2017 1 次提交
  24. 20 7月, 2017 1 次提交
  25. 30 6月, 2017 1 次提交
  26. 13 6月, 2017 1 次提交
  27. 09 6月, 2017 1 次提交
    • J
      Consistent use of @Nullable in spring-test · fd53d2a5
      Juergen Hoeller 提交于
      This commit also removes nullability from two common spots: ResolvableType.getType() and TargetSource.getTarget(), both of which are never effectively null with any regular implementation. For such scenarios, a non-null empty type/target is the cleaner contract.
      
      Issue: SPR-15540
      fd53d2a5
  28. 31 5月, 2017 1 次提交
  29. 27 5月, 2017 1 次提交
    • S
      Introduce null-safety of Spring Framework API · 87598f48
      Sebastien Deleuze 提交于
      This commit introduces 2 new @Nullable and @NonNullApi
      annotations that leverage JSR 305 (dormant but available via
      Findbugs jsr305 dependency and already used by libraries
      like OkHttp) meta-annotations to specify explicitly
      null-safety of Spring Framework parameters and return values.
      
      In order to avoid adding too much annotations, the
      default is set at package level with @NonNullApi and
      @Nullable annotations are added when needed at parameter or
      return value level. These annotations are intended to be used
      on Spring Framework itself but also by other Spring projects.
      
      @Nullable annotations have been introduced based on Javadoc
      and search of patterns like "return null;". It is expected that
      nullability of Spring Framework API will be polished with
      complementary commits.
      
      In practice, this will make the whole Spring Framework API
      null-safe for Kotlin projects (when KT-10942 will be fixed)
      since Kotlin will be able to leverage these annotations to
      know if a parameter or a return value is nullable or not. But
      this is also useful for Java developers as well since IntelliJ
      IDEA, for example, also understands these annotations to
      generate warnings when unsafe nullable usages are detected.
      
      Issue: SPR-15540
      87598f48