BAEL-3734: Use Year.now() instead of LocalDate.now()

This commit is contained in:
Krzysztof Woyke 2020-01-02 14:00:45 +01:00
parent 66af11b926
commit 47b80d267b
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import java.time.Year
class BasicExtensions {
static int getYearOfBirth(Employee self) {
return LocalDate.now().getYear() - self.age;
return Year.now().value - self.age
}
static String capitalize(String self) {

View File

@ -54,7 +54,7 @@ class MetaprogrammingUnitTest extends GroovyTestCase {
void testJavaMetaClass() {
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"
}