1. 24 Mar, 2016 34 commits
    • Stephane Nicoll's avatar
      Fix typo · e8766f21
      Stephane Nicoll authored
      e8766f21
    • Stephane Nicoll's avatar
      Info contributor documentation · 18d53d1c
      Stephane Nicoll authored
      This commit documents the new `InfoContributor` infrastructure.
      
      Closes gh-2559
      18d53d1c
    • Andy Wilkinson's avatar
      Add a BuildInfo task for generating build.properties with Gradle · 58ca9a1c
      Andy Wilkinson authored
      The commit adds a new BuildInfo task that can be used to generate
      a build.properties file, intended for inclusion in the Actuator's
      info endpoint.
      
      A default instance of the task can be configure using the plugin's
      DSL:
      
      springBoot {
      	buildInfo()
      }
      
      Additional properties can also be configured using the DSL:
      
      springBoot {
      	buildInfo {
      		additionalProperties = [
      			'foo': 'bar'
      		]
      	}
      }
      
      When configured via the DSL, the Java plugin's classes task is
      configured to depend on the build info task. Alternatively, if more
      control is required, the task can be declared and configured manually:
      
      task buildInfo(type: org.springframework.boot.gradle.buildinfo.BuildInfo) {
      	additionalProperties = [
      		'foo': 'bar'
      	]
      }
      
      classes {
      	dependsOn buildInfo
      }
      
      See gh-2559
      58ca9a1c
    • Phillip Webb's avatar
      41674697
    • Phillip Webb's avatar
      Document test improvements in 1.4 · 88f3fa4f
      Phillip Webb authored
      Closes gh-4901
      88f3fa4f
    • Phillip Webb's avatar
      Add a new spring-boot-sample-test application · 247bdf9c
      Phillip Webb authored
      Add a sample application that demonstrates recently added testing
      features.
      
      See gh-4901
      247bdf9c
    • Phillip Webb's avatar
      Add @DataJpaTest annotation · 81d56355
      Phillip Webb authored
      Add @DataJpaTest and @AutoConfigureTestDatabase annotations to allow
      testing of an application "slice" that only deals JPA.
      
      See gh-4901
      81d56355
    • Phillip Webb's avatar
      Add @WebMvcTest annotation · bbc91cc0
      Phillip Webb authored
      Add @WebMvcTest and @AutoConfigureMockMvc annotations to allow testing
      of an application "slice" that only deals with Spring MVC.
      
      See gh-4901
      bbc91cc0
    • Phillip Webb's avatar
      Add @JsonTest annotation · 0bd89017
      Phillip Webb authored
      Add @JsonTest and @AutoConfigureJsonTesters annotations to allow testing
      of an application "slice" that only deals with JSON marshalling.
      
      See gh-4901
      0bd89017
    • Phillip Webb's avatar
      Add TypeExcludeFilters support · 56fd4e1f
      Phillip Webb authored
      Provide a way for auto-configuration tests to easily filter scanned
      components.
      
      See gh-4901
      56fd4e1f
    • Phillip Webb's avatar
      Add @PropertyMapping support · 46099c75
      Phillip Webb authored
      Add @PropertyMapping annotation which can be used to mark annotation
      attributes that should contribute Environment properties.
      
      Provides a quick way for tests to change auto-configuration behavior in
      a structured way.
      
      Fixes gh-4901
      46099c75
    • Phillip Webb's avatar
      Print AutoConfigureReport on test failures · e5f22411
      Phillip Webb authored
      Add a TestExecutionListener to print the auto-configuration report
      when a test cannot load.
      
      See gh-4901
      e5f22411
    • Phillip Webb's avatar
      Add spring-boot-test-autoconfigure module · 6d934bb2
      Phillip Webb authored
      Add a new test module to deal with auto-configuration in tests.
      
      See gh-4901
      6d934bb2
    • Phillip Webb's avatar
      Support override enable auto-configuration · fb70a56c
      Phillip Webb authored
      Provide a way for full auto-configuration to be disabled
      programmatically. Primarily added to allow special test annotations to
      take over partial auto-configuration but still load
      @SpringBootApplication classes.
      
      See gh-4901
      fb70a56c
    • Phillip Webb's avatar
      Make @ImportAutoConfiguration a meta-annotation · 47f801d5
      Phillip Webb authored
      Update `@ImportAutoConfiguration` so that it can be used as a
      meta-annotation. Also relocate it from the `test` package.
      
      Fixes gh-5473
      47f801d5
    • Phillip Webb's avatar
      Allow @Import to be used directly on test classes · ae1d352d
      Phillip Webb authored
      Remove the need for a nested @Configuration class when writing a test
      that need to @Import configuration.
      
      Primarily added to allow @ImportAutoConfiguration to be used directly
      on test classes.
      
      Fixes gh-5473
      ae1d352d
    • Phillip Webb's avatar
      Provide TestRestTemplate for @WebIntegrationTests · ab7b48de
      Phillip Webb authored
      Add a ContextCustomizerFactory to provide TestRestTemplate as a bean for
      tests annotated with WebIntegrationTests. Additionally provide support
      for automatically expanding URLs of the form `/example` to
      `http://localhost:${local.server.port}/example`.
      
      Fixes gh-5227
      ab7b48de
    • Phillip Webb's avatar
      Support HtmlUnit and Selenium localhost resolution · cbea16ec
      Phillip Webb authored
      Provide variants of `WebClient` and `WebConnectionHtmlUnitDriver` that
      automatically resolve relative URLs to "localhost:${local.server.port}".
      
      Fixes gh-5472
      cbea16ec
    • Phillip Webb's avatar
      Add utilities to help with JSON testing · 24ab2bd8
      Phillip Webb authored
      Add Jackson, Gson and Basic String helper classes that allow AssertJ
      assertions to be used to test JSON.
      
      Fixes gh-5471
      24ab2bd8
    • Phillip Webb's avatar
      Add @MockBean support · 45c4f5f3
      Phillip Webb authored
      Add a `@MockBean` annotation which can be used to setup and inject mocks
      into an application context. The annotation can be used on test classes,
      test fields, configuration classes or configuration fields. When used on
      a field the annotation also acts as an injection point.
      
      Fixes gh-5042
      45c4f5f3
    • Phillip Webb's avatar
      Drop superfluous annotations · 0829a1bd
      Phillip Webb authored
      Update internal tests to drop annotations that can now
      be inferred.
      
      Fixes gh-5470
      0829a1bd
    • Phillip Webb's avatar
      Unify use of @BootStrapWith · 7dffb702
      Phillip Webb authored
      Update @IntegrationTest to use @BootstrapWith rather than an explicitly
      defined set of test execution listeners.
      
      Also introduce a new @SpringApplicationTest annotation that is similar
      to  @SpringApplicationConfiguration but a bootstrapper.
      
      Fixes gh-5230
      7dffb702
    • Phillip Webb's avatar
      Automatically find test configurations · 90950cfb
      Phillip Webb authored
      Allow detection of `@SpringBootConfiguration` classes for both standard
      spring tests and bootstrap (@IntegrationTest @WebIntegrationTest) based
      tests.
      
      Closes gh-5295
      90950cfb
    • Phillip Webb's avatar
      Auto-exclude test components from scanning · 600a06af
      Phillip Webb authored
      Add TestTypeExcludeFilter which will automatically attempt to exclude
      test only configurations. All `@Configuration` annotated inner-classes
      of tests are automatically excluded. The `@TestConfiguration` annotation
      can be used to explicitly if a configuration needs explicit exclusion.
      
      See gh-5295
      See gh-4901
      600a06af
    • Phillip Webb's avatar
      Add TestExcludeFilter for component scanning · 513dec71
      Phillip Webb authored
      Add a new TypeFilter specifically for excluding candidate components.
      The filter is applied to `@SpringBootApplication` and allows tests to
      dynamically contribute exclude filters so that specific classes of
      component can be excluded.
      
      See gh-5295
      See gh-4901
      513dec71
    • Phillip Webb's avatar
      Introduce @SpringBootConfiguration annotation · 965dd33e
      Phillip Webb authored
      Add a new @SpringBootConfiguration annotation that can be used to
      indicate the primary application configuration. The new annotation is
      primarily indented to allow test automatically code to find the main
      configuration class.
      
      See gh-5295
      965dd33e
    • Phillip Webb's avatar
      Fix SpringApplicationContextLoader customizers · 40c2e24a
      Phillip Webb authored
      Update SpringApplicationContextLoader to call ContextCustomizers in the
      same way as other classes in `spring-test`.
      
      Fixes gh-5294
      40c2e24a
    • Phillip Webb's avatar
      Migrate SpringJUnit4ClassRunner to SpringRunner · c28f5528
      Phillip Webb authored
      Replace all existing SpringJUnit4ClassRunner references with the new
      SpringRunner alias.
      
      Fixes gh-5292
      c28f5528
    • Phillip Webb's avatar
      Migrate existing tests from deprecated package · 2f815a90
      Phillip Webb authored
      Update the existing tests to use the relocated `spring-boot-test`
      classes. Restructuring was achieved using the following command:
      
      find . -type f -name '*.java' -exec sed -i '' \
      -e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\
      org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
      -e s/org.springframework.boot.test.EnvironmentTestUtils/\
      org.springframework.boot.test.util.EnvironmentTestUtils/g \
      -e s/org.springframework.boot.test.IntegrationTest/\
      org.springframework.boot.test.context.IntegrationTest/g \
      -e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\
      org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \
      -e s/org.springframework.boot.test.OutputCapture/\
      org.springframework.boot.test.rule.OutputCapture/g \
      -e s/org.springframework.boot.test.SpringApplicationConfiguration/\
      org.springframework.boot.test.context.SpringApplicationConfiguration/g \
      -e s/org.springframework.boot.test.SpringApplicationContextLoader/\
      org.springframework.boot.test.context.SpringApplicationContextLoader/g \
      -e s/org.springframework.boot.test.SpringBootMockServletContext/\
      org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
      -e s/org.springframework.boot.test.TestRestTemplate/\
      org.springframework.boot.test.web.client.TestRestTemplate/g \
      -e s/org.springframework.boot.test.WebIntegrationTest/\
      org.springframework.boot.test.context.web.WebIntegrationTest/g {} \;
      
      See gh-5293
      2f815a90
    • Phillip Webb's avatar
      Restructure spring-boot-test packages · aef7f4bc
      Phillip Webb authored
      Create a new package structure for `spring-boot-test` and deprecate
      existing classes.
      
      Fixes gh-5293
      aef7f4bc
    • Phillip Webb's avatar
      Add JSONassert and JsonPath to the test starter · da1e4970
      Phillip Webb authored
      Update spring-boot-starter-test to include JSONassert and JsonPath.
      Both are generally useful libraries when writing MVC tests.
      
      Fixes gh-5469
      da1e4970
    • Phillip Webb's avatar
      Set "proxy target class" for transaction managers · 47fb614b
      Phillip Webb authored
      Update `@EnableTransactionManagement` so that `proxyTargetClass` is
      set to true. This ensures that @Transactional beans that aren't
      interface based can still be proxied.
      
      Fixes gh-5423
      47fb614b
    • Phillip Webb's avatar
      Call afterProperties set in LogFileMvcEndpoint · 4352707e
      Phillip Webb authored
      Call afterPropertiesSet on the delegate `ResourceHttpRequestHandler`
      to prevent an NPE. This change is required following SPR-13834.
      4352707e
    • Phillip Webb's avatar
      Polish · 1b6c2a3e
      Phillip Webb authored
      1b6c2a3e
  2. 23 Mar, 2016 2 commits
  3. 22 Mar, 2016 4 commits