Skip to content

Commit b4a5025

Browse files
refactor(retrofit2): cleaned up unused comments, imports etc
1 parent 5ccbffa commit b4a5025

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

clouddriver-consul/clouddriver-consul.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
dependencies {
22
implementation project(":clouddriver-core")
33

4-
implementation "com.jakewharton.retrofit:retrofit1-okhttp3-client"
5-
implementation "com.squareup.retrofit:converter-jackson"
64
implementation "org.apache.groovy:groovy"
75
implementation "org.apache.groovy:groovy-json"
86
implementation "org.springframework.boot:spring-boot-starter-web"

clouddriver-docker/src/test/groovy/com/netflix/spinnaker/clouddriver/docker/registry/api/v2/auth/DockerBearerTokenServiceSpec.groovy

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,6 @@ class DockerBearerTokenServiceSpec extends Specification {
5252

5353
def setup() {
5454
tokenService = new DockerBearerTokenService(serviceClientProvider)
55-
/*
56-
wireMockServer = new WireMockServer(WireMockConfiguration.options().dynamicPort())
57-
wireMockServer.start();
58-
REALM1 = "http://localhost:" + wireMockServer.port()
59-
def dockerBearerToken = new DockerBearerToken()
60-
dockerBearerToken.setToken("token123")
61-
wireMockServer.stubFor(WireMock.get(WireMock.urlEqualTo("/" + PATH1 + "?service=" + SERVICE1 + "&scope=" +
62-
URLEncoder.encode(SCOPE1, StandardCharsets.UTF_8)))
63-
// .withQueryParam("service", WireMock.equalTo("registry.docker.io"))
64-
// .withQueryParam("scope", WireMock.matching("repository:library/ubuntu:push,pull"))
65-
.willReturn(WireMock.aResponse()
66-
.withHeader("Content-Type", "application/json")
67-
.withBody(objectMapper.writeValueAsString(dockerBearerToken))))
68-
69-
*/
7055
}
7156

7257
void "should parse Www-Authenticate header with full privileges and path."() {

clouddriver-docker/src/test/groovy/com/netflix/spinnaker/clouddriver/docker/registry/api/v2/client/DockerRegistryClientSpec.groovy

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import retrofit2.mock.Calls;
3131
import spock.lang.Shared
3232
import spock.lang.Specification
3333

34-
import java.util.concurrent.TimeUnit
3534

3635
/*
3736
* These tests all communicate with dockerhub (index.docker.io), and will either fail
@@ -47,21 +46,15 @@ class DockerRegistryClientSpec extends Specification {
4746

4847
def stubbedRegistryService = Stub(DockerRegistryClient.DockerRegistryService){
4948
String tagsJson = "{\"name\":\"library/ubuntu\",\"tags\":[\"latest\",\"xenial\",\"rolling\"]}"
50-
// TypedInput tagsTypedInput = new TypedByteArray("application/json", tagsJson.getBytes())
5149
Response tagsResponse = Response.success(200, ResponseBody.create(MediaType.parse("application/json"), tagsJson))
52-
// Response tagsResponse = new Response("/v2/{repository}/tags/list",200, "nothing", Collections.EMPTY_LIST, tagsTypedInput)
5350
getTags(_,_,_) >> Calls.response(tagsResponse)
5451

5552
String checkJson = "{}"
56-
// TypedInput checkTypedInput = new TypedByteArray("application/json", checkJson.getBytes())
5753
Response checkResponse = Response.success(200, ResponseBody.create(MediaType.parse("application/json"), checkJson))
58-
// Response checkResponse = new Response("/v2/",200, "nothing", Collections.EMPTY_LIST, checkTypedInput)
5954
checkVersion(_,_) >> Calls.response(checkResponse)
6055

6156
String json = "{\"repositories\":[\"armory-io/armorycommons\",\"armory/aquascan\",\"other/keel\"]}"
62-
// TypedInput catalogTypedInput = new TypedByteArray("application/json", json.getBytes())
6357
Response catalogResponse = Response.success(200, ResponseBody.create(MediaType.parse("application/json"), json))
64-
// Response catalogResponse = new Response("/v2/_catalog/",200, "nothing", Collections.EMPTY_LIST, catalogTypedInput)
6558
getCatalog(_,_,_) >> Calls.response(catalogResponse)
6659

6760
String schemaJson = '''{
@@ -80,9 +73,7 @@ class DockerRegistryClientSpec extends Specification {
8073
}
8174
]
8275
}'''
83-
// TypedInput schemaV2Input = new TypedByteArray("application/json", schemaJson.getBytes())
8476
Response schemaV2Response = Response.success(200, ResponseBody.create(MediaType.parse("application/json"), schemaJson))
85-
// Response schemaV2Response = new Response("/v2/{name}/manifests/{reference}",200, "nothing", Collections.EMPTY_LIST, schemaV2Input)
8677
getSchemaV2Manifest(_,_,_,_) >> Calls.response(schemaV2Response)
8778

8879
String configDigestContentJson = '''{
@@ -113,9 +104,7 @@ class DockerRegistryClientSpec extends Specification {
113104
"os": "linux",
114105
"rootfs": {}
115106
}'''
116-
// TypedInput configDigestContentInput = new TypedByteArray("application/json", configDigestContentJson.getBytes())
117107
Response contentDigestResponse = Response.success(200, ResponseBody.create(MediaType.parse("application/json"), configDigestContentJson))
118-
// Response contentDigestResponse = new Response("/v2/{repository}/blobs/{digest}",200, "nothing", Collections.EMPTY_LIST, configDigestContentInput)
119108
getDigestContent(_,_,_,_) >> Calls.response(contentDigestResponse)
120109
}
121110

0 commit comments

Comments
 (0)