@Test
public void should_get_a_widget_with_template_and_controller_by_its_id() throws Exception {

    String templateFileName = "input.tpl.html";
    String controllerFileName = "input.ctrl.js";
    Widget expectedWidget = aWidget().id("input").template("@" + templateFileName).controller("@" + controllerFileName).build();
    addToDirectory(widgetDirectory, expectedWidget);
    String htmlContent = "<div></div>";
    Files.write(widgetDirectory.resolve(expectedWidget.getId()).resolve(templateFileName), htmlContent.getBytes(StandardCharsets.UTF_8));
    String jsContent = "function ($scope) {}";
    Files.write(widgetDirectory.resolve(expectedWidget.getId()).resolve(controllerFileName), jsContent.getBytes(StandardCharsets.UTF_8));
    Widget widget = widgetLoader.get(widgetDirectory.resolve("input/input.json"));
    assertThat(widget.getTemplate()).isEqualTo(htmlContent);
    assertThat(widget.getController()).isEqualTo(jsContent);
}