-
Notifications
You must be signed in to change notification settings - Fork 218
/
search-thing.js
24 lines (23 loc) · 965 Bytes
/
search-thing.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
* Copyright (c) 2023 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 { randomIntBetween } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js';
import { fail } from 'k6';
import { searchThingByFeature, searchThingById } from './http-util.js';
import * as common from './common.js'
export function searchThing() {
let thingId = common.GET_THING_ID(randomIntBetween(common.THINGS_START_INDEX, common.THINGS_COUNT - 1));
let response = searchThingById(thingId);
if (response.status != 200) {
fail(`Failed to search things with feature value of ${value}. Response: ${JSON.stringify(response)}`);
}
}