Commit Graph

28 Commits (23d9998269b50554c93cd111996096fd9cea4843)

Author SHA1 Message Date
Andy Wilkinson 4b6bddd476 Merge branch '1.4.x' into 1.5.x 6 years ago
Andy Wilkinson 6920c39349 Merge branch '1.3.x' into 1.4.x 6 years ago
Andy Wilkinson 0e009ef047 Use HTTPS to link to the Apache license 6 years ago
Phillip Webb e75d8eaf40 Switch to spring-javaformat plugin
Use `spring-javaformat` to format and check code. Code formatting can
now be applied using the `spring-javaformat-maven-plugin` from the
command line. Existing checkstyle rules have also been replaced and
the CONTRIBUTING.adoc file has been updated.

Closes gh-13255
7 years ago
Phillip Webb e69296d7d3 Fix checkstyle violations in samples 7 years ago
Stephane Nicoll d49b022ce3 Shade json in configuration processor
This commit shades the json API in the configuration processor so that
it doesn't bring `android-json` to the classpath anymore.

Closes gh-10307
7 years ago
Stephane Nicoll 07bb33d8ed Prevent the accidental use of Flyway's StringUtils
See gh-11396
7 years ago
Andy Wilkinson 654fe9a31c Use Checkstyle to police accidental use of unwanted imports
Closes gh-11271
7 years ago
Andy Wilkinson d2201d5284 Correct copyright dates and enforce that starting year is 2012
Closes gh-7923
8 years ago
Andy Wilkinson 918e122ddc Fix remote DevTools' support for adding and removing classes
Previously, remote DevTools only correctly supported modifying
existing classes. New classes that were added would be missed, and
deleted classes could cause a failure as they would be found by
component scanning but hidden by RestartClassLoader.

This commit introduces a DevTools-specific ResourcePatternResolver
that is installed as the application context's resource loader. This
custom resolver is aware of the files that have been added and
deleted and modifies the result returned from getResource and
getResources accordingly.

New intergration tests have been introduced to verify DevTools'
behaviour. The tests cover four scenarios:

- Adding a new controller
- Removing an existing controller
- Adding a request mapping to a controller
- Removing a request mapping from a controller

These four scenarios are tested with:

- DevTools updating a local application
- DevTools updating a remote application packaged in a jar file
- DevTools updating a remote application that's been exploded

Closes gh-7379
8 years ago
Stephane Nicoll 00a10bcf61 Restore checkstyle
Rather than disabling checkstyle altogether, this commit enables it
again, relaxing the javadoc requirement only.

See gh-7142
8 years ago
Phillip Webb 56544c8dd5 Polish 8 years ago
Johnny Lim 37c8c3669b Polish
Closes gh-6671
8 years ago
Johnny Lim 65128c0ad1 Remove severity elements from checkstyle.xml
Remove `error` severity elements from `checkstyle.xml` and rely on the
default setting instead.

Closes gh-6442
8 years ago
Phillip Webb 57bed2e5f6 Use fully qualified checkstyle class names
Update `checkstyle.xml` to use fully qualified class names. This reduces
the number of warning log messages when running `mvn -X` and should also
be slightly faster.
9 years ago
Phillip Webb e664d585d9 Allow MockRest static imports
Update checkstyle rules to allow static imports from
MockRestRequestMatchers and MockRestResponseCreators.
9 years ago
Andy Wilkinson de0bcaa50e Update WebMvcTest to auto-configure supported template engines
Closes gh-5801
9 years ago
Andy Wilkinson eb3180d581 Provide test auto-configuration for Spring REST Docs
This commit introduces a new annotation, @AutoConfigureRestDocs,
which can be used to enable auto-configuration of Spring REST Docs.
The auto-configuration removes the need to use Spring REST Docs' JUnit
rule and will automatically configure MockMvc. Combined with the new
auto-configuration for MockMvc it allows a test class to be free of
boilerplate configuration:

@RunWith(SpringRunner.class)
@WebMvcTest
@AutoConfigureRestDocs(outputDir = "target/generated-snippets",
        uriScheme = "https", uriHost = "api.example.com",
        uriPort = 443)
public class ExampleDocumentationTests {

    @Autowired
    private MockMvc mvc;

    @Test
    public void documentIndex() {
        // …
    }

}

For more advanced customization a RestDocsMockMvcConfigurationCustomizer
bean can be used.

If a RestDocumentationResultHandler is found in the context, it will
be passed to the ConfigurableMockMvcBuilder's alwaysDo method as part
of its customization.

Closes gh-5563
9 years ago
Andy Wilkinson 33f0ea3480 Rework SpringApplicationTest to support web modes
Rework the new testing support so that @SpringApplicationTest can be
used for standard integration tests, web integration tests with a
mock Servlet environment and web integration tests with an embedded
servlet container. This means that it a replacement for 1.3's
@IntegrationTest and @WebIntegrationTest and allows all
SpringApplication testing to be configured using a common annotation.

The old @IntegrationTest and @WebIntegrationTest along with their
supporting classes have been reinstated to their previous form (while
remaining deprecated). This should ensure that they continue to work
in 1.4 exactly as they did in 1.3 giving users a smooth path to
@SpringApplicationTest.

See gh-5477
9 years ago
Phillip Webb 893a6c32f3 Upgrade to checkstyle 6.17
Fixes gh-5547
9 years ago
Phillip Webb cc5d4b8b7f Add AssertJ checkstyle rule
Closes gh-5083
9 years ago
Andy Wilkinson d1b47c8a8f Add integration tests for default launch script
This commit adds a suit of integration tests for the launch script. See
the accompanying README.adoc for further details.

Closes gh-4872
9 years ago
Ruben Dijkstra 02830989be Configure Checkstyle line separator so it does not use system default
In its default configuration, Checkstyle would fail on Windows as it
would expect CRLF, the system default line separator.

Closes gh-4666
9 years ago
Phillip Webb cf68f83ef6 Update checkstyle import order rules
See gh-4234
9 years ago
Phillip Webb 822820f256 Revert "Relax `ParenPad` checkstyle rule"
The updated formatter means that we can reinstate the rule.

This reverts commit 82fffe3062.
9 years ago
Phillip Webb 2a16c25977 Replace import-control checkstyle file with regex
Fix Eclipse build warnings by replacing checkstyle's import-control file
with a simple regex rule.

Fixes gh-4006
9 years ago
Phillip Webb 82fffe3062 Relax `ParenPad` checkstyle rule
Eclipse Mars has a formatter bug (#479291) that sometimes adds
additional whitespace on annotations. Until it's fixed we need to relax
the `ParenPad` checkstyle rule.
9 years ago
Stephane Nicoll e70f02c4a2 Relocate checkstyle configuration
See gh-3928
9 years ago