DickYmlService { public Dickfile loadDickFile(Build build) throws DickFileMissingException { try (InputStream file = repositoryService.getFile(build, ".deployer.yml")) { if (file == null) { throw new DickFileMissingException(); } Yaml yaml = new Yaml(new Constructor(Dickfile.class)); return (Dickfile) yaml.load(file); } catch (IOException e) { throw Throwables.propagate(e); } }  Dickfile loadDickFile(Build build);  }
@Test public void shouldLoadDickfile() throws DickFileMissingException { Dickfile dickfile = dickYmlService.loadDickFile(new Build.Builder() .withSha("bf3d4f2b08952b27e1df8482c503c9e8df6fea96") .withRef("master") .withRepository("https: .withProject(new Project.Builder() .withRef("master") .withName("dick-the-deployer/dick") .withRepository("https: .build() ).build() ); assertThat(dickfile).isNotNull(); assertThat(dickfile.getPipeline().getStages()) .asList().hasSize(2).extracting("name").containsExactly("first", "second"); assertThat(dickfile.getJobs()).asList().hasSize(2); }