@@ -39,8 +39,7 @@ public void testClasspathPathName() {
39
39
pathEditor .setAsText ("classpath:" + ClassUtils .classPackageAsResourcePath (getClass ()) + "/" +
40
40
ClassUtils .getShortName (getClass ()) + ".class" );
41
41
Object value = pathEditor .getValue ();
42
- boolean condition = value instanceof Path ;
43
- assertThat (condition ).isTrue ();
42
+ assertThat (value instanceof Path ).isTrue ();
44
43
Path path = (Path ) value ;
45
44
assertThat (path .toFile ().exists ()).isTrue ();
46
45
}
@@ -57,47 +56,39 @@ public void testWithNonExistentPath() {
57
56
PropertyEditor pathEditor = new PathEditor ();
58
57
pathEditor .setAsText ("file:/no_way_this_file_is_found.doc" );
59
58
Object value = pathEditor .getValue ();
60
- boolean condition1 = value instanceof Path ;
61
- assertThat (condition1 ).isTrue ();
59
+ assertThat (value instanceof Path ).isTrue ();
62
60
Path path = (Path ) value ;
63
- boolean condition = !path .toFile ().exists ();
64
- assertThat (condition ).isTrue ();
61
+ assertThat (!path .toFile ().exists ()).isTrue ();
65
62
}
66
63
67
64
@ Test
68
65
public void testAbsolutePath () {
69
66
PropertyEditor pathEditor = new PathEditor ();
70
67
pathEditor .setAsText ("/no_way_this_file_is_found.doc" );
71
68
Object value = pathEditor .getValue ();
72
- boolean condition1 = value instanceof Path ;
73
- assertThat (condition1 ).isTrue ();
69
+ assertThat (value instanceof Path ).isTrue ();
74
70
Path path = (Path ) value ;
75
- boolean condition = !path .toFile ().exists ();
76
- assertThat (condition ).isTrue ();
71
+ assertThat (!path .toFile ().exists ()).isTrue ();
77
72
}
78
73
79
74
@ Test
80
75
public void testWindowsAbsolutePath () {
81
76
PropertyEditor pathEditor = new PathEditor ();
82
77
pathEditor .setAsText ("C:\\ no_way_this_file_is_found.doc" );
83
78
Object value = pathEditor .getValue ();
84
- boolean condition1 = value instanceof Path ;
85
- assertThat (condition1 ).isTrue ();
79
+ assertThat (value instanceof Path ).isTrue ();
86
80
Path path = (Path ) value ;
87
- boolean condition = !path .toFile ().exists ();
88
- assertThat (condition ).isTrue ();
81
+ assertThat (!path .toFile ().exists ()).isTrue ();
89
82
}
90
83
91
84
@ Test
92
85
public void testWindowsAbsoluteFilePath () {
93
86
PropertyEditor pathEditor = new PathEditor ();
94
87
pathEditor .setAsText ("file://C:\\ no_way_this_file_is_found.doc" );
95
88
Object value = pathEditor .getValue ();
96
- boolean condition1 = value instanceof Path ;
97
- assertThat (condition1 ).isTrue ();
89
+ assertThat (value instanceof Path ).isTrue ();
98
90
Path path = (Path ) value ;
99
- boolean condition = !path .toFile ().exists ();
100
- assertThat (condition ).isTrue ();
91
+ assertThat (!path .toFile ().exists ()).isTrue ();
101
92
}
102
93
103
94
@ Test
@@ -107,8 +98,7 @@ public void testUnqualifiedPathNameFound() {
107
98
ClassUtils .getShortName (getClass ()) + ".class" ;
108
99
pathEditor .setAsText (fileName );
109
100
Object value = pathEditor .getValue ();
110
- boolean condition = value instanceof Path ;
111
- assertThat (condition ).isTrue ();
101
+ assertThat (value instanceof Path ).isTrue ();
112
102
Path path = (Path ) value ;
113
103
File file = path .toFile ();
114
104
assertThat (file .exists ()).isTrue ();
@@ -126,8 +116,7 @@ public void testUnqualifiedPathNameNotFound() {
126
116
ClassUtils .getShortName (getClass ()) + ".clazz" ;
127
117
pathEditor .setAsText (fileName );
128
118
Object value = pathEditor .getValue ();
129
- boolean condition = value instanceof Path ;
130
- assertThat (condition ).isTrue ();
119
+ assertThat (value instanceof Path ).isTrue ();
131
120
Path path = (Path ) value ;
132
121
File file = path .toFile ();
133
122
assertThat (file .exists ()).isFalse ();
0 commit comments