-
Notifications
You must be signed in to change notification settings - Fork 11
/
IdentifierServiceTest.java
54 lines (44 loc) · 2.21 KB
/
IdentifierServiceTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
* Copyright (c) 2024 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.services;
import static org.junit.Assert.assertNotNull;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.IdentifierService;
import org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.ServerInfoResponseImpl;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.utils.RestServerTest;
import org.junit.Test;
/**
* Test the {@link IdentifierService}
*
* @author Vlad Arama
*/
public class IdentifierServiceTest extends RestServerTest {
/**
* Test basic operations on the Identifier Service
*/
@Test
public void testIdentifier() {
WebTarget application = getApplicationEndpoint();
WebTarget identifierEndpoint = application.path("identifier");
Response response = identifierEndpoint.request(MediaType.APPLICATION_JSON)
.get();
ServerInfoResponseImpl responseValues = response.readEntity(ServerInfoResponseImpl.class);
assertNotNull("Server version should not be null", responseValues.getVersion());
assertNotNull("OS should not be null", responseValues.getOs());
assertNotNull("OS Architecture should not be null", responseValues.getOsArch());
assertNotNull("OS Version should not be null", responseValues.getOsVersion());
assertNotNull("CPU count should not be null", responseValues.getCpuCount());
assertNotNull("Max memory should not be null", responseValues.getMaxMemory());
assertNotNull("Product ID should not be null", responseValues.getProductId());
}
}