Hi. I have an `Enum` ```@Serializable enum class ...
# kotest
c
Hi. I have an
Enum
Copy code
@Serializable
enum class Certificate {
  @SerialName("Certificate_A") A
}
that I've overridden in
src/test
. I did this by copying the one in
src/main
into
src/test
at the same package. I want to be able to access the one in
src/main
in a test. How?
c
why is this copied? You have access to all the compiled code from
main
in your tests.
c
@Chris Lee, I added an
Enum
entry for the purposes of testing a failure case.
c
Hmm. Generally you don’t ‘override’ code - you can mock it, provide an alternate implementation that lives in your tests, etc. Perhaps review what it is your are testing to see if there’s a cleaner approach.
c
OK. How do I make a mock
Certificate
Enum
entry that doesn't exist in
src/main
?
@Chris Lee, ^
c
Not sure, haven’t explicitly had that requirement. Review various mocking libraries (I tend to use mockk, there are other capable ones).