Skip to content

Commit

Permalink
Revert "feat(sql): CRUD Tests for SqlStorageService"
Browse files Browse the repository at this point in the history
This reverts commit 6724d0f6c779ebc50fc50b2985b8265487c456e1.
  • Loading branch information
ajordens committed Jul 8, 2019
1 parent f6f06ab commit e3a725a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 215 deletions.
17 changes: 6 additions & 11 deletions front50-sql/front50-sql.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
apply from: "$rootDir/gradle/kotlin.gradle"

dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.2.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.2.1"

implementation "com.netflix.spinnaker.front50:front50-core:${front50Version}"

implementation "com.netflix.spinnaker.kork:kork-sql"
implementation "com.netflix.spinnaker.kork:kork-exceptions"

implementation "org.jooq:jooq:3.11.11"
implementation "io.strikt:strikt-core"
implementation "com.netflix.hystrix:hystrix-core"
implementation "com.netflix.spinnaker.kork:kork-sql"
implementation "io.github.resilience4j:resilience4j-retry"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.2.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.2.1"

runtimeOnly "mysql:mysql-connector-java"
runtime "mysql:mysql-connector-java:8.0.12"

testImplementation "dev.minutest:minutest"
testImplementation "org.testcontainers:mysql"
testImplementation "com.netflix.spinnaker.kork:kork-sql-test"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package com.netflix.spinnaker.front50.model

import com.fasterxml.jackson.databind.ObjectMapper
import com.netflix.spectator.api.Registry
import com.netflix.spinnaker.front50.exception.NotFoundException
import com.netflix.spinnaker.security.AuthenticatedRequest
import org.jooq.DSLContext
import org.jooq.impl.DSL
Expand Down Expand Up @@ -72,7 +71,7 @@ class SqlStorageService(
.from(definitionsByType[objectType]!!.tableName)
.where(field("id", String::class.java).eq(objectKey))
.fetchOne()
} ?: throw NotFoundException("Object not found (key: $objectKey)")
}

return objectMapper.readValue(result.get(field("body", String::class.java)), objectType.clazz as Class<T>)
}
Expand Down Expand Up @@ -138,7 +137,6 @@ class SqlStorageService(
}

override fun listObjectKeys(objectType: ObjectType): Map<String, Long> {
val startTime = System.currentTimeMillis()
val resultSet = jooq.withRetry(sqlRetryProperties.reads) { ctx ->
ctx
.select(
Expand All @@ -157,12 +155,6 @@ class SqlStorageService(
objectKeys.put(resultSet.getString(1), resultSet.getLong(2))
}

log.debug("Took {}ms to fetch {} object keys for {}",
System.currentTimeMillis() - startTime,
objectKeys.size,
objectType
)

return objectKeys
}

Expand Down

This file was deleted.

This file was deleted.

0 comments on commit e3a725a

Please sign in to comment.