Upgrade to Gradle 6.8 and modernize the build

Closes gh-719
This commit is contained in:
Andy Wilkinson
2021-04-19 18:21:41 +01:00
parent a1ed76ad25
commit 2ead1fb0d8
112 changed files with 1354 additions and 1053 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2021 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.
@@ -16,14 +16,14 @@
package com.example.mockmvc;
import org.springframework.test.web.servlet.MockMvc;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName;
import static org.springframework.restdocs.request.RequestDocumentation.pathParameters;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.springframework.test.web.servlet.MockMvc;
public class PathParameters {
private MockMvc mockMvc;
@@ -31,11 +31,10 @@ public class PathParameters {
public void pathParametersSnippet() throws Exception {
// tag::path-parameters[]
this.mockMvc.perform(get("/locations/{latitude}/{longitude}", 51.5072, 0.1275)) // <1>
.andExpect(status().isOk())
.andDo(document("locations", pathParameters( // <2>
parameterWithName("latitude").description("The location's latitude"), // <3>
parameterWithName("longitude").description("The location's longitude") // <4>
)));
.andExpect(status().isOk()).andDo(document("locations", pathParameters(// <2>
parameterWithName("latitude").description("The location's latitude"), // <3>
parameterWithName("longitude").description("The location's longitude") // <4>
)));
// end::path-parameters[]
}