Back

translate-property (clj)

(source)

multimethod

Examples

hikari-cp
(ns hikari-cp.core-test
  (:require [hikari-cp.core :refer :all])
  (:use expectations)
  (:import (com.zaxxer.hikari.pool HikariPool$PoolInitializationException)
           (com.codahale.metrics MetricRegistry)
           (com.codahale.metrics.health HealthCheckRegistry)
           (com.zaxxer.hikari.metrics.prometheus PrometheusMetricsTrackerFactory)))

(expect "tinyInt1isBit" (translate-property :tinyInt1isBit))
(expect "tinyInt1isBit" (translate-property :tiny-int1is-bit))
(expect "useSSL" (translate-property :useSSL))
(expect "useSSL" (translate-property :use-ssl))
(expect "useFoo" (translate-property :useFOO))

;; translate-property is extensible
(defmethod translate-property ::extend-translate-test [_] 42)
(expect 42 (translate-property ::extend-translate-test))
tomekw/hikari-cp
(ns hikari-cp.core-test
  (:require [hikari-cp.core :refer :all])
  (:use expectations)
  (:import (com.zaxxer.hikari.pool HikariPool$PoolInitializationException)
           (com.codahale.metrics MetricRegistry)
           (com.codahale.metrics.health HealthCheckRegistry)
           (com.zaxxer.hikari.metrics.prometheus PrometheusMetricsTrackerFactory)))

(expect "tinyInt1isBit" (translate-property :tinyInt1isBit))
(expect "tinyInt1isBit" (translate-property :tiny-int1is-bit))
(expect "useSSL" (translate-property :useSSL))
(expect "useSSL" (translate-property :use-ssl))
(expect "useFoo" (translate-property :useFOO))

;; translate-property is extensible
(defmethod translate-property ::extend-translate-test [_] 42)
(expect 42 (translate-property ::extend-translate-test))