@@ -27,38 +27,25 @@ import spock.lang.Unroll
27
27
*/
28
28
class GiteaRepositoryProviderTest extends Specification {
29
29
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
-
40
30
def ' should return repo url' () {
41
31
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' )
44
33
45
34
expect :
46
35
new GiteaRepositoryProvider (' pditommaso/hello' , obj). getEndpointUrl() == ' https://gitea.com/api/v1/repos/pditommaso/hello'
47
36
}
48
37
49
38
def ' should return project URL' () {
50
39
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' )
53
41
54
42
expect :
55
43
new GiteaRepositoryProvider (' pditommaso/hello' , obj). getRepositoryUrl() == ' https://gitea.com/pditommaso/hello'
56
44
}
57
45
58
46
def ' should return content URL' () {
59
47
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' )
62
49
63
50
expect :
64
51
new GiteaRepositoryProvider (' pditommaso/hello' , obj)
@@ -91,7 +78,7 @@ class GiteaRepositoryProviderTest extends Specification {
91
78
def ' should read file content' () {
92
79
given :
93
80
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)
95
82
96
83
when :
97
84
def repo = new GiteaRepositoryProvider (' pditommaso/test-hello' , config)
@@ -112,7 +99,7 @@ class GiteaRepositoryProviderTest extends Specification {
112
99
def ' should read bytes gitea content' () {
113
100
given :
114
101
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)
116
103
def repo = new GiteaRepositoryProvider (' pditommaso/test-hello' , config)
117
104
and :
118
105
def DATA = this . class. getResourceAsStream(' /test-asset.bin' ). bytes
@@ -129,7 +116,7 @@ class GiteaRepositoryProviderTest extends Specification {
129
116
def ' should read bytes file content' () {
130
117
given :
131
118
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)
133
120
134
121
when :
135
122
def repo = new GiteaRepositoryProvider (' pditommaso/test-hello' , config)
0 commit comments