blob: 0a916eebcebd801825d69baf5767d91163aa5c1a [file] [log] [blame]
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import {IAPIPaginationResponse} from "../core/api/shared";
export function createPaginationResponseMock<T>(content: T[]): IAPIPaginationResponse<T> {
return {
content,
pageable: "INSTANCE",
last: true,
totalPages: 1,
totalElements: content?.length,
size: 0,
number: 0,
numberOfElements: content?.length,
first: true,
sort: {
sorted: false,
unsorted: true,
empty: true
},
empty: false
};
}