Skip to content

Commit

Permalink
Fix names of methods getConstantByCode and getConstantCode
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Feb 5, 2020
1 parent 9644287 commit 7a30801
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Ref.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ trait Ref {
}

Number getRefIdByCode(CharSequence code) {
def id = Constants.getContstantByCode(code)
def id = Constants.getConstantByCode(code)
if (id) {
return id
}
Expand Down Expand Up @@ -167,7 +167,7 @@ trait Ref {
}

String getRefCode(def id) {
String code = Constants.getContstantCode(id)
String code = Constants.getConstantCode(id)
if (code) {
return code
}
Expand Down
4 changes: 2 additions & 2 deletions src/org/camunda/latera/bss/utils/Constants.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class Constants {
return null
}

static Integer getContstantByCode(CharSequence code) {
static Integer getConstantByCode(CharSequence code) {
def lang = getLang(code?.replace('LANG_', ''))
if (lang) {
return lang
Expand All @@ -464,7 +464,7 @@ class Constants {
return field?.get()
}

static String getContstantCode(Number value) {
static String getConstantCode(Number value) {
def field = Constants.declaredFields.find { def it ->
!isPrivate(it.modifiers) && isStatic(it.modifiers) && it.get() == value
}
Expand Down
8 changes: 4 additions & 4 deletions test/org/camunda/latera/bss/utils/ConstantsSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class ConstantsSpec extends Specification {
null |null
}

def "#getContstantByCode"() {
def "#getConstantByCode"() {
expect:
Constants.getContstantByCode(code) == result
Constants.getConstantByCode(code) == result

where:
code |result
Expand All @@ -39,9 +39,9 @@ class ConstantsSpec extends Specification {
null |null
}

def "#getContstantCode"() {
def "#getConstantCode"() {
expect:
Constants.getContstantCode(code) == result
Constants.getConstantCode(code) == result

where:
code |result
Expand Down

0 comments on commit 7a30801

Please sign in to comment.