BAEL-3734: Use Year.now() instead of LocalDate.now()
This commit is contained in:
parent
66af11b926
commit
47b80d267b
@ -8,7 +8,7 @@ import java.time.Year
|
|||||||
class BasicExtensions {
|
class BasicExtensions {
|
||||||
|
|
||||||
static int getYearOfBirth(Employee self) {
|
static int getYearOfBirth(Employee self) {
|
||||||
return LocalDate.now().getYear() - self.age;
|
return Year.now().value - self.age
|
||||||
}
|
}
|
||||||
|
|
||||||
static String capitalize(String self) {
|
static String capitalize(String self) {
|
||||||
|
@ -54,7 +54,7 @@ class MetaprogrammingUnitTest extends GroovyTestCase {
|
|||||||
|
|
||||||
void testJavaMetaClass() {
|
void testJavaMetaClass() {
|
||||||
String.metaClass.capitalize = { String str ->
|
String.metaClass.capitalize = { String str ->
|
||||||
str.substring(0, 1).toUpperCase() + str.substring(1);
|
str.substring(0, 1).toUpperCase() + str.substring(1)
|
||||||
}
|
}
|
||||||
assert "norman".capitalize() == "Norman"
|
assert "norman".capitalize() == "Norman"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user