experimentPaginationHelper) {
+ final HttpHeader httpHeader) {
this.authorizedExperimentGetter = authorizedExperimentGetter;
this.pages = pages;
this.experiments = experiments;
this.authorization = authorization;
this.priorities = priorities;
this.httpHeader = httpHeader;
- this.experimentPaginationHelper = experimentPaginationHelper;
}
/**
@@ -96,11 +106,11 @@ public Response getApplications(@HeaderParam(AUTHORIZATION)
/**
* Returns metadata for the specified experiment.
- *
+ *
* Does not return metadata for a deleted experiment.
*
- * @param applicationName the application name
- * @param experimentLabel the experiment label
+ * @param applicationName the application name
+ * @param experimentLabel the experiment label
* @param authorizationHeader the authorization headers
* @return Response object
*/
@@ -129,20 +139,12 @@ public Response getExperiment(@PathParam("applicationName")
/**
* Returns metadata for all experiments within an application.
- *
+ *
* Does not return metadata for a deleted or terminated experiment.
*
- * This endpoint is paginated.
- *
- * @param applicationName the application name
+ * @param applicationName the application name
* @param authorizationHeader the authentication headers
- * @param page the page which should be returned, defaults to 1
- * @param perPage the number of log entries per page, defaults to 10. -1 to get all values.
- * @param sort the sorting rules
- * @param filter the filter rules
- * @param timezoneOffset the time zone offset from UTC
- * @return a response containing a map with a list with {@code 0} to {@code perPage} experiments,
- * if that many are on the page, and a count of how many experiments match the filter criteria.
+ * @return a response containing a list with experiments
*/
@GET
@Path("/{applicationName}/experiments")
@@ -156,45 +158,16 @@ public Response getExperiments(@PathParam("applicationName")
@HeaderParam(AUTHORIZATION)
@ApiParam(value = EXAMPLE_AUTHORIZATION_HEADER, required = true)
- final String authorizationHeader,
-
- @QueryParam("page")
- @DefaultValue(DEFAULT_PAGE)
- @ApiParam(name = "page", defaultValue = DEFAULT_PAGE, value = DOC_PAGE)
- final int page,
-
- @QueryParam("per_page")
- @DefaultValue(DEFAULT_PER_PAGE)
- @ApiParam(name = "per_page", defaultValue = DEFAULT_PER_PAGE, value = DOC_PER_PAGE)
- final int perPage,
-
- @QueryParam("filter")
- @DefaultValue("")
- @ApiParam(name = "filter", defaultValue = DEFAULT_FILTER, value = DOC_FILTER)
- final String filter,
-
- @QueryParam("sort")
- @DefaultValue("")
- @ApiParam(name = "sort", defaultValue = DEFAULT_SORT, value = DOC_SORT)
- final String sort,
-
- @QueryParam("timezone")
- @DefaultValue(DEFAULT_TIMEZONE)
- @ApiParam(name = "timezone", defaultValue = DEFAULT_TIMEZONE, value = DOC_TIMEZONE)
- final String timezoneOffset) {
- List experimentList = authorizedExperimentGetter.getAuthorizedExperimentsByName(authorizationHeader,
- applicationName);
-
- Map response = experimentPaginationHelper.paginate("experiments", experimentList, filter, timezoneOffset, sort, page, perPage);
-
- return httpHeader.headers().entity(response).build();
+ final String authorizationHeader
+ ) {
+ return httpHeader.headers().entity(authorizedExperimentGetter.getAuthorizedExperimentsByName(authorizationHeader, applicationName)).build();
}
/**
* Creates a rank ordered priority list
*
- * @param applicationName the application name
- * @param experimentIDList the list of experiment ids
+ * @param applicationName the application name
+ * @param experimentIDList the list of experiment ids
* @param authorizationHeader the authorization headers
* @return Response object
*/
@@ -224,7 +197,7 @@ public Response createPriorities(@PathParam("applicationName")
* Returns the full, ordered priority list for an application
* along with experiment meta-data and associated priority
*
- * @param applicationName the application name
+ * @param applicationName the application name
* @param authorizationHeader the authorization headers
* @return Response object
*/
@@ -233,7 +206,7 @@ public Response createPriorities(@PathParam("applicationName")
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Get the priority list for an application",
notes = "The returned priority list is rank ordered.")
- // response = ??, //todo: update with proper object
+ // response = ??, //todo: update with proper object
@Timed
public Response getPriorities(@PathParam("applicationName")
@ApiParam(value = "Application Name")
@@ -252,8 +225,8 @@ public Response getPriorities(@PathParam("applicationName")
/**
* Returns the set of pages associated with the application.
*
- * @param applicationName the application name
- * @param authorizationHeader the authorization headers
+ * @param applicationName the application name
+ * @param authorizationHeader the authorization headers
* @return Response object
*/
@GET
@@ -279,9 +252,9 @@ public Response getPagesForApplication(@PathParam("applicationName")
/**
* Get the experiment information(id and allowNewAssignment) for the associated experiments for a page
*
- * @param applicationName the application name
- * @param pageName the page name
- * @param authorizationHeader the authorization headers
+ * @param applicationName the application name
+ * @param pageName the page name
+ * @param authorizationHeader the authorization headers
* @return Response object
*/
@GET
@@ -312,8 +285,8 @@ public Response getExperiments(@PathParam("applicationName")
/**
* Returns the set of pages with their associated experiments for an application.
*
- * @param applicationName the application name
- * @param authorizationHeader the authorization headers
+ * @param applicationName the application name
+ * @param authorizationHeader the authorization headers
* @return Response object
*/
@GET
@@ -322,12 +295,12 @@ public Response getExperiments(@PathParam("applicationName")
@ApiOperation(value = "Get the set of pages associated with an application.")
@Timed
public Response getPageAndExperimentsForApplication(@PathParam("applicationName")
- @ApiParam(value = "Application Name")
- final Application.Name applicationName,
+ @ApiParam(value = "Application Name")
+ final Application.Name applicationName,
- @HeaderParam(AUTHORIZATION)
- @ApiParam(value = EXAMPLE_AUTHORIZATION_HEADER, required = true)
- final String authorizationHeader) {
+ @HeaderParam(AUTHORIZATION)
+ @ApiParam(value = EXAMPLE_AUTHORIZATION_HEADER, required = true)
+ final String authorizationHeader) {
authorization.checkUserPermissions(authorization.getUser(authorizationHeader), applicationName, READ);
Map> pageExperimentListMap = pages.getPageAndExperimentList(applicationName);
diff --git a/modules/api/src/main/resources/api.properties b/modules/api/src/main/resources/api.properties
index 1ef0167f2..37de9afc5 100644
--- a/modules/api/src/main/resources/api.properties
+++ b/modules/api/src/main/resources/api.properties
@@ -13,6 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
-application.id:${application.name}-${timestamp}
+application.id:${application.name}-${scmBranch}-${buildNumber}-${timestamp}
default.time.zone:${default.time.zone}
-default.time.format:${default.time.format}
\ No newline at end of file
+default.time.format:${default.time.format}
diff --git a/modules/api/src/test/java/com/intuit/wasabi/api/ApplicationsResourceTest.java b/modules/api/src/test/java/com/intuit/wasabi/api/ApplicationsResourceTest.java
index c4b3d9509..f1202883e 100644
--- a/modules/api/src/test/java/com/intuit/wasabi/api/ApplicationsResourceTest.java
+++ b/modules/api/src/test/java/com/intuit/wasabi/api/ApplicationsResourceTest.java
@@ -15,17 +15,18 @@
*******************************************************************************/
package com.intuit.wasabi.api;
-import com.intuit.wasabi.api.pagination.PaginationHelper;
-import com.intuit.wasabi.api.pagination.comparators.impl.ExperimentComparator;
-import com.intuit.wasabi.api.pagination.filters.impl.ExperimentFilter;
import com.intuit.wasabi.authenticationobjects.UserInfo;
import com.intuit.wasabi.authorization.Authorization;
import com.intuit.wasabi.exceptions.AuthenticationException;
import com.intuit.wasabi.experiment.Experiments;
import com.intuit.wasabi.experiment.Pages;
import com.intuit.wasabi.experiment.Priorities;
-import com.intuit.wasabi.experimentobjects.*;
-import io.codearte.catchexception.shade.mockito.Mockito;
+import com.intuit.wasabi.experimentobjects.Application;
+import com.intuit.wasabi.experimentobjects.Experiment;
+import com.intuit.wasabi.experimentobjects.ExperimentIDList;
+import com.intuit.wasabi.experimentobjects.Page;
+import com.intuit.wasabi.experimentobjects.PageExperiment;
+import com.intuit.wasabi.experimentobjects.PrioritizedExperimentList;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,7 +38,6 @@
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -49,7 +49,11 @@
import static org.hamcrest.collection.IsMapContaining.hasEntry;
import static org.hamcrest.core.Is.is;
import static org.mockito.Matchers.anyCollection;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class ApplicationsResourceTest {
@@ -98,14 +102,10 @@ public class ApplicationsResourceTest {
private ArgumentCaptor