Skip to content

Commit a2779d4

Browse files
authored
Merge pull request eugenp#11657 from hkhan/JAVA-9347-split-spring-rest-http-module
[JAVA-9347] Split spring-rest-http module
2 parents 3547a84 + c895b71 commit a2779d4

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

spring-web-modules/spring-rest-http-2/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Spring REST HTTP 2
22

3-
This module contains articles about HTTP in REST APIs with Spring
3+
This module contains articles about HTTP in REST APIs with Spring.
44

55
### The Course
66
The "REST With Spring 2" Classes: http://bit.ly/restwithspring
@@ -10,3 +10,5 @@ The "REST With Spring 2" Classes: http://bit.ly/restwithspring
1010
- [How to Turn Off Swagger-ui in Production](https://www.baeldung.com/swagger-ui-turn-off-in-production)
1111
- [Setting a Request Timeout for a Spring REST API](https://www.baeldung.com/spring-rest-timeout)
1212
- [Long Polling in Spring MVC](https://www.baeldung.com/spring-mvc-long-polling)
13+
- [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder)
14+
- More articles: [[<-- prev]](../spring-rest-http)

spring-web-modules/spring-rest-http/src/test/java/com/baeldung/uribuilder/SpringUriBuilderIntegrationTest.java renamed to spring-web-modules/spring-rest-http-2/src/test/java/com/baeldung/uribuilder/SpringUriBuilderUnitTest.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
11
package com.baeldung.uribuilder;
22

3-
import static org.junit.Assert.assertEquals;
4-
5-
import java.util.Collections;
6-
73
import org.junit.Test;
84
import org.springframework.web.util.UriComponents;
95
import org.springframework.web.util.UriComponentsBuilder;
106

11-
public class SpringUriBuilderIntegrationTest {
7+
import java.util.Collections;
8+
9+
import static org.junit.Assert.assertEquals;
10+
11+
public class SpringUriBuilderUnitTest {
1212

1313
@Test
1414
public void constructUri() {
15-
UriComponents uriComponents = UriComponentsBuilder.newInstance().scheme("http").host("www.baeldung.com").path("/junit-5").build();
15+
UriComponents uriComponents = UriComponentsBuilder.newInstance()
16+
.scheme("http").host("www.baeldung.com").path("/junit-5")
17+
.build();
1618

1719
assertEquals("http://www.baeldung.com/junit-5", uriComponents.toUriString());
1820
}
1921

2022
@Test
2123
public void constructUriEncoded() {
22-
UriComponents uriComponents = UriComponentsBuilder.newInstance().scheme("http").host("www.baeldung.com").path("/junit 5").build().encode();
24+
UriComponents uriComponents = UriComponentsBuilder.newInstance()
25+
.scheme("http").host("www.baeldung.com").path("/junit 5")
26+
.build().encode();
2327

2428
assertEquals("http://www.baeldung.com/junit%205", uriComponents.toUriString());
2529
}
2630

2731
@Test
2832
public void constructUriFromTemplate() {
29-
UriComponents uriComponents = UriComponentsBuilder.newInstance().scheme("http").host("www.baeldung.com").path("/{article-name}").buildAndExpand("junit-5");
33+
UriComponents uriComponents = UriComponentsBuilder.newInstance()
34+
.scheme("http").host("www.baeldung.com").path("/{article-name}")
35+
.buildAndExpand("junit-5");
3036

3137
assertEquals("http://www.baeldung.com/junit-5", uriComponents.toUriString());
3238
}
3339

3440
@Test
3541
public void constructUriWithQueryParameter() {
36-
UriComponents uriComponents = UriComponentsBuilder.newInstance().scheme("http").host("www.google.com").path("/").query("q={keyword}").buildAndExpand("baeldung");
42+
UriComponents uriComponents = UriComponentsBuilder.newInstance()
43+
.scheme("http").host("www.google.com").path("/").query("q={keyword}")
44+
.buildAndExpand("baeldung");
3745

3846
assertEquals("http://www.google.com/?q=baeldung", uriComponents.toUriString());
3947
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
## Spring REST HTTP
22

3-
This module contains articles about HTTP in REST APIs with Spring
3+
This module contains articles about HTTP in REST APIs with Spring.
44

55
### The Course
66
The "REST With Spring" Classes: http://bit.ly/restwithspring
77

88
### Relevant Articles:
99

10-
- [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder)
1110
- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) - The tests contained for this article rely on the sample application within the [spring-resttemplate](/spring-resttemplate) module
1211
- [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code)
1312
- [Spring RequestMapping](https://www.baeldung.com/spring-requestmapping)
1413
- [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result)
1514
- [Using JSON Patch in Spring REST APIs](https://www.baeldung.com/spring-rest-json-patch)
1615
- [OpenAPI JSON Objects as Query Parameters](https://www.baeldung.com/openapi-json-query-parameters)
1716
- [Dates in OpenAPI Files](https://www.baeldung.com/openapi-dates)
17+
- More articles: [[next -->]](../spring-rest-http-2)

0 commit comments

Comments
 (0)