@Test(expected = WasabiEmailException.class) public void testNoAdminsForApp() { UserRoleList roleListMock = mock(UserRoleList.class); UserRole roleBad = mock(UserRole.class); when(roleBad.getUserEmail()).thenReturn("really invalid email"); when(roleListMock.getRoleList()).thenReturn(Arrays.asList(roleBad)); when(repoMock.getApplicationUsers(appName)).thenReturn(roleListMock); textProcessor.getAddressees(appName); }
@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);  }