@@ -69,7 +69,7 @@ void remoteCacheUrlCanBeConfigured(String cacheUrl) {
69
69
@ Test
70
70
void remoteCacheServerCanBeConfigured () {
71
71
Map <String , String > env = new HashMap <>();
72
- env .put ("GRADLE_ENTERPRISE_CACHE_SERVER " , "https://ge.example.com" );
72
+ env .put ("DEVELOCITY_CACHE_SERVER " , "https://ge.example.com" );
73
73
new BuildCacheConventions (DevelocityBuildCache .class , env ).execute (this .buildCache );
74
74
assertThat (this .buildCache .remote .isEnabled ()).isTrue ();
75
75
assertThat (this .buildCache .remote .getServer ()).isEqualTo ("https://ge.example.com" );
@@ -80,7 +80,7 @@ void remoteCacheServerCanBeConfigured() {
80
80
void remoteCacheServerHasPrecedenceOverRemoteCacheUrl () {
81
81
Map <String , String > env = new HashMap <>();
82
82
env .put ("GRADLE_ENTERPRISE_CACHE_URL" , "https://ge-cache.example.com/cache/" );
83
- env .put ("GRADLE_ENTERPRISE_CACHE_SERVER " , "https://ge.example.com" );
83
+ env .put ("DEVELOCITY_CACHE_SERVER " , "https://ge.example.com" );
84
84
new BuildCacheConventions (DevelocityBuildCache .class , env ).execute (this .buildCache );
85
85
assertThat (this .buildCache .remote .isEnabled ()).isTrue ();
86
86
assertThat (this .buildCache .remote .getServer ()).isEqualTo ("https://ge.example.com" );
@@ -90,13 +90,30 @@ void remoteCacheServerHasPrecedenceOverRemoteCacheUrl() {
90
90
@ Test
91
91
void whenAccessTokenIsProvidedInALocalEnvironmentThenPushingToTheRemoteCacheIsNotEnabled () {
92
92
new BuildCacheConventions (DevelocityBuildCache .class ,
93
- Collections .singletonMap ("GRADLE_ENTERPRISE_ACCESS_KEY " , "ge.example.com=a1b2c3d4" ))
93
+ Collections .singletonMap ("DEVELOCITY_ACCESS_KEY " , "ge.example.com=a1b2c3d4" ))
94
94
.execute (this .buildCache );
95
95
assertThat (this .buildCache .remote .isPush ()).isFalse ();
96
96
}
97
97
98
98
@ Test
99
99
void whenAccessTokenIsProvidedInACiEnvironmentThenPushingToTheRemoteCacheIsNotEnabled () {
100
+ Map <String , String > env = new HashMap <>();
101
+ env .put ("DEVELOCITY_ACCESS_KEY" , "ge.example.com=a1b2c3d4" );
102
+ env .put ("CI" , "true" );
103
+ new BuildCacheConventions (DevelocityBuildCache .class , env ).execute (this .buildCache );
104
+ assertThat (this .buildCache .remote .isPush ()).isTrue ();
105
+ }
106
+
107
+ @ Test
108
+ void whenLegacyAccessTokenIsProvidedInALocalEnvironmentThenPushingToTheRemoteCacheIsNotEnabled () {
109
+ new BuildCacheConventions (DevelocityBuildCache .class ,
110
+ Collections .singletonMap ("GRADLE_ENTERPRISE_ACCESS_KEY" , "ge.example.com=a1b2c3d4" ))
111
+ .execute (this .buildCache );
112
+ assertThat (this .buildCache .remote .isPush ()).isFalse ();
113
+ }
114
+
115
+ @ Test
116
+ void whenLegacyAccessTokenIsProvidedInACiEnvironmentThenPushingToTheRemoteCacheIsNotEnabled () {
100
117
Map <String , String > env = new HashMap <>();
101
118
env .put ("GRADLE_ENTERPRISE_ACCESS_KEY" , "ge.example.com=a1b2c3d4" );
102
119
env .put ("CI" , "true" );
0 commit comments