from logging import getLogger
from unittest import TestCase

from edpopenapibuilder.builder.helper import build_yaml_from_message_handler_builder
from samplehttpmodule.messagehandlerbuilder import (
    DependencyInjectionSampleMessageHandlerBuilder,
    SampleMessageHandlerBuilder
)
from samplehttpmodule.route import add_descriptors

_LOGGER = getLogger(__name__)


class TestDependencyInjectionApiYamlBuilderInteractor(TestCase):
    def setUp(self):
        add_descriptors()

    def test_build_from_dependency_injection_message_handler_builder(self):
        message_handler_builder = DependencyInjectionSampleMessageHandlerBuilder()
        _LOGGER.info(build_yaml_from_message_handler_builder(message_handler_builder))

    def test_build_yaml_from_message_handler_builder(self):
        message_handler_builder = SampleMessageHandlerBuilder()
        _LOGGER.info(build_yaml_from_message_handler_builder(message_handler_builder))
