Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

add yaml parser #35

Merged
merged 1 commit into from
May 3, 2019
Merged

add yaml parser #35

merged 1 commit into from
May 3, 2019

Conversation

MohamedFarouk-HMCTS
Copy link
Collaborator

No description provided.

@coveralls
Copy link

coveralls commented May 2, 2019

Coverage Status

Coverage increased (+0.1%) to 98.301% when pulling 02ddc82 on add-yaml-parser into 86ac7d8 on master.

@MohamedFarouk-HMCTS MohamedFarouk-HMCTS force-pushed the add-yaml-parser branch 2 times, most recently from ebf67b2 to 2ea8fc1 Compare May 2, 2019 15:56
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;

public class ObjectMapperFactory {
Copy link
Contributor

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 {
Copy link
Contributor

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;
Copy link
Contributor

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();
Copy link
Contributor

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.

@mapingo mapingo merged commit 4f09fc5 into master May 3, 2019
@mapingo mapingo deleted the add-yaml-parser branch May 3, 2019 11:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants