    @Test
    public void testBuildEvents() {

        final Dashboard dashboard1 = new Dashboard()
            .setName("dashboard1")
            .setCodeRepos(Arrays.asList("http://repo1.git", "http://repo2.git"));
        final Dashboard dashboard2 = new Dashboard()
            .setName("dashboard2")
            .setCodeRepos(Arrays.asList(".*repo3.*", "http://repo4.git"));
        final Dashboard dashboard3 = new Dashboard()
            .setName("dashboard3")
            .setCodeRepos(Collections.singletonList("http://repo3.git"));

        final BuildDTO build = TestObjectFactory.createBuildDTO()
            .setKeywords(Collections.singletonList("http://repo3.git"));

        final Event event = new Event().setCollectionId(build.getBuildUrl());
        final Set<String> dashboardIds = new HashSet<>(
            Arrays.asList(dashboard1.getName(), dashboard2.getName(), dashboard3.getName())
        );

        when(buildService.getBuildsByIds(anyList())).thenReturn(Collections.singletonList(build));
        when(dashboardService.getDashboardWithNames(anyList()))
            .thenReturn(Arrays.asList(dashboard1, dashboard2, dashboard3));

        eventHandler.processEvents(Collections.singletonList(event), dashboardIds);

        verify(connectionHandler, times(0))
            .sendEventUpdateMessage(EventType.BUILD, dashboard1.getName());
        verify(connectionHandler, times(1))
            .sendEventUpdateMessage(EventType.BUILD, dashboard2.getName());
        verify(connectionHandler, times(1))
            .sendEventUpdateMessage(EventType.BUILD, dashboard3.getName());
    }