@Test public void getAuthenticatedExperimentsByName() throws Exception { when(authorization.getUser("foo")).thenReturn(username); when(experiments.getExperiments(applicationName)).thenReturn(experimentList); authorizedExperimentGetter.getAuthorizedExperimentsByName("foo", applicationName); verify(authorization).getUser("foo"); verify(authorization).checkUserPermissions(username, applicationName, READ); verify(experiments).getExperiments(applicationName); }
List<Experiment> getAuthorizedExperimentsByName(final String authorizationHeader, final Application.Name applicationName) { return getExperimentsByName(true, authorizationHeader, applicationName); }
AuthorizedExperimentGetter { List<Experiment> getAuthorizedExperimentsByName(final String authorizationHeader, final Application.Name applicationName) { return getExperimentsByName(true, authorizationHeader, applicationName); } }
AuthorizedExperimentGetter { List<Experiment> getAuthorizedExperimentsByName(final String authorizationHeader, final Application.Name applicationName) { return getExperimentsByName(true, authorizationHeader, applicationName); } @Inject  AuthorizedExperimentGetter(final Authorization authorization, final Experiments experiments); }
AuthorizedExperimentGetter { List<Experiment> getAuthorizedExperimentsByName(final String authorizationHeader, final Application.Name applicationName) { return getExperimentsByName(true, authorizationHeader, applicationName); } @Inject  AuthorizedExperimentGetter(final Authorization authorization, final Experiments experiments);  }
AuthorizedExperimentGetter { List<Experiment> getAuthorizedExperimentsByName(final String authorizationHeader, final Application.Name applicationName) { return getExperimentsByName(true, authorizationHeader, applicationName); } @Inject  AuthorizedExperimentGetter(final Authorization authorization, final Experiments experiments);   }