    @Test
    public void testBuildWithEnvironment() throws Exception {

        FreeStyleProject p = j.createFreeStyleProject();

        FakeChangeLogSCM scm = new FakeChangeLogSCM();
        p.setScm(scm);
        j.buildAndAssertSuccess(p);

        scm.addChange().withAuthor("danielbeck").withMsg("initial commit");

        ChangelogEnvironmentContributor c = new ChangelogEnvironmentContributor();
        c.setEntryFormat("%s | %3$s"); // format: author | message
        p.getBuildWrappersList().add(c);
        p.getBuildersList().add(new EnvironmentCheckBuilder("danielbeck | initial commit"));

        j.buildAndAssertSuccess(p);
    }