String toOverride = "recipient@host.com";
notifier.setToOverride( toOverride );
ProjectGroup group = createStubProjectGroup( "foo.bar", "" );
BuildResultDao brDao = (BuildResultDao) lookup( BuildResultDao.class );
Project project = addProject( "Test Project", group );
BuildResult br = makeBuild( ContinuumProjectState.FAILED );
brDao.addBuildResult( project, br );
br = makeBuild( ContinuumProjectState.OK );
brDao.addBuildResult( project, br );
br = makeBuild( ContinuumProjectState.FAILED );
brDao.addBuildResult( project, br );
BuildResult build = makeBuild( ContinuumProjectState.OK );
assertEquals( ContinuumProjectState.OK, build.getState() );
project.setState( build.getState() );
getProjectDao().updateProject( project );
BuildDefinition buildDef = new BuildDefinition();
buildDef.setType( "maven2" );
buildDef.setBuildFile( "pom.xml" );
buildDef.setGoals( "clean install" );
buildDef.setArguments( "" );
BuildDefinitionDao buildDefDao = (BuildDefinitionDao) lookup( BuildDefinitionDao.class );
buildDef = buildDefDao.addBuildDefinition( buildDef );
build.setBuildDefinition( buildDef );
assertEquals( ContinuumProjectState.OK, build.getState() );
brDao.addBuildResult( project, build );
build = brDao.getLatestBuildResultForProjectWithDetails( project.getId() );
assertEquals( ContinuumProjectState.OK, build.getState() );
MimeMessage mailMessage =
sendNotificationAndGetMessage( project, build, buildDef, "lots out build output", toOverride );