@Test(expected = IllegalArgumentException.class) public void testGetAddresseesDefault() { EventLogEvent eventLogEvent = mock(EventLogEvent.class); when(eventLogEvent.getType()).thenReturn(EventLogEventType.UNKNOWN); textProcessor.getAddressees(eventLogEvent); }
@Override public Set<String> getAddressees(EventLogEvent event) { Set<String> addressants = new HashSet<>(); EventLogEventType type = event.getType(); switch (type) { case BUCKET_CHANGED: case BUCKET_CREATED: case EXPERIMENT_CHANGED: case EXPERIMENT_CREATED: addressants.addAll(getExperimentAddressor((ExperimentEvent) event)); break; case SIMPLE_EVENT: default: throw new IllegalArgumentException("Can not handle EventType: " + type.toString()); } return addressants; }
EmailTextProcessorImpl implements EmailTextProcessor { @Override public Set<String> getAddressees(EventLogEvent event) { Set<String> addressants = new HashSet<>(); EventLogEventType type = event.getType(); switch (type) { case BUCKET_CHANGED: case BUCKET_CREATED: case EXPERIMENT_CHANGED: case EXPERIMENT_CREATED: addressants.addAll(getExperimentAddressor((ExperimentEvent) event)); break; case SIMPLE_EVENT: default: throw new IllegalArgumentException("Can not handle EventType: " + type.toString()); } return addressants; } }
EmailTextProcessorImpl implements EmailTextProcessor { @Override public Set<String> getAddressees(EventLogEvent event) { Set<String> addressants = new HashSet<>(); EventLogEventType type = event.getType(); switch (type) { case BUCKET_CHANGED: case BUCKET_CREATED: case EXPERIMENT_CHANGED: case EXPERIMENT_CREATED: addressants.addAll(getExperimentAddressor((ExperimentEvent) event)); break; case SIMPLE_EVENT: default: throw new IllegalArgumentException("Can not handle EventType: " + type.toString()); } return addressants; } @Inject  EmailTextProcessorImpl(final AuthorizationRepository authorizationRepository); }
EmailTextProcessorImpl implements EmailTextProcessor { @Override public Set<String> getAddressees(EventLogEvent event) { Set<String> addressants = new HashSet<>(); EventLogEventType type = event.getType(); switch (type) { case BUCKET_CHANGED: case BUCKET_CREATED: case EXPERIMENT_CHANGED: case EXPERIMENT_CREATED: addressants.addAll(getExperimentAddressor((ExperimentEvent) event)); break; case SIMPLE_EVENT: default: throw new IllegalArgumentException("Can not handle EventType: " + type.toString()); } return addressants; } @Inject  EmailTextProcessorImpl(final AuthorizationRepository authorizationRepository); @Override Set<String> getAddressees(EventLogEvent event); @Override Set<String> getAddressees(Application.Name app); @Override String getMessage(Application.Name app, UserInfo.Username username, EmailLinksList links); @Override String getSubject(Application.Name app); @Override String getSubject(EventLogEvent event); @Override String getMessage(EventLogEvent event); }
EmailTextProcessorImpl implements EmailTextProcessor { @Override public Set<String> getAddressees(EventLogEvent event) { Set<String> addressants = new HashSet<>(); EventLogEventType type = event.getType(); switch (type) { case BUCKET_CHANGED: case BUCKET_CREATED: case EXPERIMENT_CHANGED: case EXPERIMENT_CREATED: addressants.addAll(getExperimentAddressor((ExperimentEvent) event)); break; case SIMPLE_EVENT: default: throw new IllegalArgumentException("Can not handle EventType: " + type.toString()); } return addressants; } @Inject  EmailTextProcessorImpl(final AuthorizationRepository authorizationRepository); @Override Set<String> getAddressees(EventLogEvent event); @Override Set<String> getAddressees(Application.Name app); @Override String getMessage(Application.Name app, UserInfo.Username username, EmailLinksList links); @Override String getSubject(Application.Name app); @Override String getSubject(EventLogEvent event); @Override String getMessage(EventLogEvent event);  }