-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
ebf67b2
to
2ea8fc1
Compare
import com.fasterxml.jackson.databind.PropertyNamingStrategy; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | ||
|
||
public class ObjectMapperFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Class name should be clear about what this class does...maybe...YamlObjectMapperFactory
import org.mockito.runners.MockitoJUnitRunner; | ||
|
||
@RunWith(MockitoJUnitRunner.class) | ||
public class YamlParserTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test class is inconsistent. One test uses mocks, then the other tests switch to an implementation of the YamlParser. It should be one or the other or two different test classes for clarity.
public class YamlParser { | ||
|
||
@Inject | ||
protected ObjectMapperFactory objectMapperFactory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
|
||
private YamlParser yamlParser() { | ||
final YamlParser yamlParser = new YamlParser(); | ||
yamlParser.objectMapperFactory = new ObjectMapperFactory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the ObjectMapperFactory needs injecting use @SPY with mocking, or ReflectionUtils with a new instance. That way the injection can be private.
2ea8fc1
to
02ddc82
Compare
No description provided.