Skip to content

Commit 38e0ca6

Browse files
committed
chore: Update tests
1 parent 507ebcb commit 38e0ca6

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ build --protocopt=--experimental_allow_proto3_optional
66
build --cxxopt=-std=c++14
77
build --host_cxxopt=-std=c++14
88

9-
test --test_env=test_current_year=2025
9+
test --test_env=TEST_CURRENT_YEAR=2025

gapic-generator-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
</additionalClasspathElement>
325325
</additionalClasspathElements>
326326
<environmentVariables>
327-
<test_current_year>2025</test_current_year>
327+
<TEST_CURRENT_YEAR>2025</TEST_CURRENT_YEAR>
328328
</environmentVariables>
329329
</configuration>
330330
</plugin>

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/CommentComposer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public class CommentComposer {
8181
"https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library")));
8282

8383
private static String getCurrentYear() {
84-
String testCurrentYear = System.getenv("test_current_year");
84+
String testCurrentYear = System.getenv("TEST_CURRENT_YEAR");
8585
int currentYearFromCalendar = Calendar.getInstance().get(Calendar.YEAR);
8686
return Strings.isNullOrEmpty(testCurrentYear)
8787
? String.valueOf(currentYearFromCalendar)

hermetic_build/library_generation/tests/owlbot/java_unit_tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_deprecate_method(self):
173173
)
174174
os.chdir(cwd)
175175

176-
@mock.patch("java.CURRENT_YEAR", TEST_CURRENT_YEAR)
176+
@mock.patch.object(java, 'CURRENT_YEAR', 2025)
177177
def test_fix_proto_license(self):
178178
with tempfile.TemporaryDirectory() as tempdir:
179179
cwd = os.getcwd()
@@ -190,7 +190,7 @@ def test_fix_proto_license(self):
190190
)
191191
os.chdir(cwd)
192192

193-
@mock.patch("java.CURRENT_YEAR", TEST_CURRENT_YEAR)
193+
@mock.patch.object(java, "CURRENT_YEAR", 2025)
194194
def test_fix_proto_license_idempotent(self):
195195
with tempfile.TemporaryDirectory() as tempdir:
196196
cwd = os.getcwd()
@@ -209,7 +209,7 @@ def test_fix_proto_license_idempotent(self):
209209
)
210210
os.chdir(cwd)
211211

212-
@mock.patch("java.CURRENT_YEAR", TEST_CURRENT_YEAR)
212+
@mock.patch.object(java, "CURRENT_YEAR", 2025)
213213
def test_fix_grpc_license(self):
214214
with tempfile.TemporaryDirectory() as tempdir:
215215
cwd = os.getcwd()
@@ -226,7 +226,7 @@ def test_fix_grpc_license(self):
226226
)
227227
os.chdir(cwd)
228228

229-
@mock.patch("java.CURRENT_YEAR", TEST_CURRENT_YEAR)
229+
@mock.patch.object(java, "CURRENT_YEAR", 2025)
230230
def test_fix_grpc_license_idempotent(self):
231231
with tempfile.TemporaryDirectory() as tempdir:
232232
cwd = os.getcwd()

0 commit comments

Comments
 (0)