@@ -27,38 +27,25 @@ import spock.lang.Unroll
2727 */
2828class GiteaRepositoryProviderTest extends Specification {
2929
30- static final String CONFIG = '''
31- providers {
32- mygitea {
33- server = 'https://gitea.com'
34- endpoint = 'https://gitea.com/api/v1'
35- platform = 'gitea'
36- }
37- }
38- '''
39-
4030 def ' should return repo url' () {
4131 given :
42- def config = new ConfigSlurper (). parse(CONFIG )
43- def obj = new ProviderConfig (' gitea' , config. providers. mygitea as ConfigObject )
32+ def obj = new ProviderConfig (' gitea' )
4433
4534 expect :
4635 new GiteaRepositoryProvider (' pditommaso/hello' , obj). getEndpointUrl() == ' https://gitea.com/api/v1/repos/pditommaso/hello'
4736 }
4837
4938 def ' should return project URL' () {
5039 given :
51- def config = new ConfigSlurper (). parse(CONFIG )
52- def obj = new ProviderConfig (' gitea' , config. providers. mygitea as ConfigObject )
40+ def obj = new ProviderConfig (' gitea' )
5341
5442 expect :
5543 new GiteaRepositoryProvider (' pditommaso/hello' , obj). getRepositoryUrl() == ' https://gitea.com/pditommaso/hello'
5644 }
5745
5846 def ' should return content URL' () {
5947 given :
60- def config = new ConfigSlurper (). parse(CONFIG )
61- def obj = new ProviderConfig (' gitea' , config. providers. mygitea as ConfigObject )
48+ def obj = new ProviderConfig (' gitea' )
6249
6350 expect :
6451 new GiteaRepositoryProvider (' pditommaso/hello' , obj)
@@ -91,7 +78,7 @@ class GiteaRepositoryProviderTest extends Specification {
9178 def ' should read file content' () {
9279 given :
9380 def token = System . getenv(' NXF_GITEA_ACCESS_TOKEN' )
94- def config = new ProviderConfig (' gitea' , new ConfigSlurper () . parse( CONFIG ) . providers . mygitea as ConfigObject ) .setAuth(token)
81+ def config = new ProviderConfig (' gitea' ) .setAuth(token)
9582
9683 when :
9784 def repo = new GiteaRepositoryProvider (' pditommaso/test-hello' , config)
@@ -112,7 +99,7 @@ class GiteaRepositoryProviderTest extends Specification {
11299 def ' should read bytes gitea content' () {
113100 given :
114101 def token = System . getenv(' NXF_GITEA_ACCESS_TOKEN' )
115- def config = new ProviderConfig (' gitea' , new ConfigSlurper () . parse( CONFIG ) . providers . mygitea as ConfigObject ) .setAuth(token)
102+ def config = new ProviderConfig (' gitea' ) .setAuth(token)
116103 def repo = new GiteaRepositoryProvider (' pditommaso/test-hello' , config)
117104 and :
118105 def DATA = this . class. getResourceAsStream(' /test-asset.bin' ). bytes
@@ -129,7 +116,7 @@ class GiteaRepositoryProviderTest extends Specification {
129116 def ' should read bytes file content' () {
130117 given :
131118 def token = System . getenv(' NXF_GITEA_ACCESS_TOKEN' )
132- def config = new ProviderConfig (' gitea' , new ConfigSlurper () . parse( CONFIG ) . providers . mygitea as ConfigObject ). setAuth(token)
119+ def config = new ProviderConfig (' gitea' ). setAuth(token)
133120
134121 when :
135122 def repo = new GiteaRepositoryProvider (' pditommaso/test-hello' , config)
0 commit comments