Add initial support for jpos injections in tests.#243
Conversation
b78bd36 to
da7b1c6
Compare
|
This is really great. My only (very minor) comment is that maybe we can use a more specific name for the module, like |
Thank you very much, I don't like the name very much either, maybe As it is now we would need a test module per source module, for example, we couldn't put db module tests in this module because it would depend on db module even for modules that don't use jposs-ee-db. |
|
We have |
That looks very interesting. I've not played with that feature before. |
This first commit adds support for injecting a log source, and a mocked mux for jpos based application junit tests.
Also: - rename unused parameter to ignored. - fixed code example in README.md
da7b1c6 to
9ae3486
Compare
This first commit adds support for injecting a log source, and a mocked MUX for jPOS based application JUnit tests.
It is intended to be used by test classpaths in order to avoid boilerplate for logging or mocked versions of jpos or jPOS-EE components such as
MUXandDBobjects(currently, only MUX is supported). Actually for jPOS-EE specific components a test module by referenced module maybe necessary to avoid unneeded dependencies.This PR is marked as draft for discussion, specially the classes and annotations names. But if it seems OK, then we can merge it as is
Module for aiding in unit tests
This module provides annotations to inject some mock or frequently needed objects during testing.
For example, it provides an injection for a
Logobject, and aMUXmock.Loginjection exampleIn the following example, if the logger does not already exist, a default one, that logs to standard output is created with the given
loggername, and assigned to theLoginstance.MUXmocking injection exampleThis test class is actually executed in this module's test.