File tree 2 files changed +14
-3
lines changed
main/java/org/springframework/web/util
test/java/org/springframework/web/util
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2021 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ public class UriTemplate implements Serializable {
66
66
* @param uriTemplate the URI template string
67
67
*/
68
68
public UriTemplate (String uriTemplate ) {
69
- Assert .hasText (uriTemplate , "'uriTemplate' must not be null" );
69
+ Assert .notNull (uriTemplate , "'uriTemplate' must not be null" );
70
70
this .uriTemplate = uriTemplate ;
71
71
this .uriComponents = UriComponentsBuilder .fromUriString (uriTemplate ).build ();
72
72
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
27
27
28
28
import static org .assertj .core .api .Assertions .assertThat ;
29
29
import static org .assertj .core .api .Assertions .assertThatIllegalArgumentException ;
30
+ import static org .assertj .core .api .Assertions .assertThatNoException ;
30
31
31
32
/**
32
33
* @author Arjen Poutsma
35
36
*/
36
37
class UriTemplateTests {
37
38
39
+ @ Test
40
+ void emptyPathDoesNotThrowException () {
41
+ assertThatNoException ().isThrownBy (() -> new UriTemplate ("" ));
42
+ }
43
+
44
+ @ Test
45
+ void nullPathThrowsException () {
46
+ assertThatIllegalArgumentException ().isThrownBy (() -> new UriTemplate (null ));
47
+ }
48
+
38
49
@ Test
39
50
void getVariableNames () {
40
51
UriTemplate template = new UriTemplate ("/hotels/{hotel}/bookings/{booking}" );
You can’t perform that action at this time.
0 commit comments