Skip to content

Commit

Permalink
refactor: deprecated class reference
Browse files Browse the repository at this point in the history
* Also followed the pattern followed elsewhere in this code for specifying the class for the constant explicitly in the code.
  • Loading branch information
swalchemist committed Jan 12, 2024
1 parent f05569a commit 2de4c38
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.cloudfoundry.credhub.controllers.v1.credentials

import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.PropertyNamingStrategy
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import org.assertj.core.api.Assertions.assertThat
import org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider
import org.cloudfoundry.credhub.audit.CEFAuditRecord
Expand Down Expand Up @@ -78,7 +78,7 @@ class CredentialsControllerGenerateTest {

@Before
fun setUp() {
objectMapper.propertyNamingStrategy = PropertyNamingStrategy.SNAKE_CASE
objectMapper.propertyNamingStrategy = PropertyNamingStrategies.SNAKE_CASE

val credentialController = CredentialsController(
spyCredentialsHandler,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cloudfoundry.credhub.handlers

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.PropertyNamingStrategy
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.google.protobuf.ByteString
import io.grpc.Status
import io.grpc.StatusRuntimeException
Expand Down Expand Up @@ -85,7 +85,7 @@ class RemoteCredentialsHandlerTest {
Security.addProvider(BouncyCastleFipsProvider())
}

objectMapper.propertyNamingStrategy = PropertyNamingStrategy.SNAKE_CASE
objectMapper.propertyNamingStrategy = PropertyNamingStrategies.SNAKE_CASE

subject = RemoteCredentialsHandler(
userContextHolder,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cloudfoundry.credhub.helpers

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.PropertyNamingStrategy.SNAKE_CASE
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import org.cloudfoundry.credhub.util.TimeModuleFactory
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
Expand All @@ -24,7 +24,7 @@ class MockMvcFactory {
val objectMapper = ObjectMapper()
.registerModule(TimeModuleFactory.createTimeModule())
.registerKotlinModule()
.setPropertyNamingStrategy(SNAKE_CASE)
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)

converter.objectMapper = objectMapper
return converter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cloudfoundry.credhub.services

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.PropertyNamingStrategy
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.google.protobuf.ByteString
import io.grpc.Status
import io.grpc.StatusRuntimeException
Expand Down Expand Up @@ -37,7 +37,7 @@ class RemoteCertificateAuthorityServiceTest {

@Before
fun beforeEach() {
objectMapper.propertyNamingStrategy = PropertyNamingStrategy.SNAKE_CASE
objectMapper.propertyNamingStrategy = PropertyNamingStrategies.SNAKE_CASE

subject = RemoteCertificateAuthorityService(userContextHolder, objectMapper, client)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cloudfoundry.credhub

import com.fasterxml.jackson.databind.Module
import com.fasterxml.jackson.databind.PropertyNamingStrategy
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.module.kotlin.KotlinModule
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
Expand All @@ -14,7 +14,7 @@ class ObjectMapperConfig {
return Jackson2ObjectMapperBuilder().apply {
modules(javaTimeModule, KotlinModule() as Module?)
failOnUnknownProperties(true)
propertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
propertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.cloudfoundry.credhub.helpers
import com.fasterxml.jackson.core.JsonProcessingException
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.PropertyNamingStrategy.SNAKE_CASE
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import org.cloudfoundry.credhub.util.TimeModuleFactory
import org.hamcrest.BaseMatcher
import org.hamcrest.Description
Expand All @@ -22,7 +22,7 @@ class JsonTestHelper private constructor() {
fun createObjectMapper(): ObjectMapper {
return ObjectMapper()
.registerModule(TimeModuleFactory.createTimeModule())
.setPropertyNamingStrategy(SNAKE_CASE)
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)
}

@JvmStatic
Expand Down

0 comments on commit 2de4c38

Please sign in to comment.