@Test
public void sample() throws ParseException {
//read response
Response response = client().path("cardex").path("changes").get();
Assert.assertNotNull(response);
Assert.assertTrue(response.getStatus() == 200);
//read response as a set
Set<CardexDBTO> jsonResponse = new HashSet<>();
jsonResponse = response.readEntity(new GenericType<Set<CardexDBTO>>() {
});
//create a set same as the (test)object received
Set<CardexDBTO> collect = new HashSet<>();
CardexDBTO cardexResponse = null;
cardexResponse = new CardexDBTO();
cardexResponse.setNombre("Mario");
cardexResponse.setEmail("mario@rossi.it");
collect.add(cardexResponse);
//iterate and test
for (CardexDBTO it : collect) {
for (CardexDBTO it1 : jsonResponse) {
Assert.assertEquals(it.getNombre(), it1.getNombre());
Assert.assertEquals(it.getEmail(), it1.getEmail());
}
}
}
Iscriviti a:
Commenti sul post (Atom)
How to deploy Podman images to OpenShift Container Platform (CRC on localhost)
I have a microservice on localhost and I want to deploy its Podman image on OCP, which I am running using CRC on localhost. 1. Get the...
-
My intent is to configure SSO on Keycloak and Liferay. I have createad a docker-compose environment with Keycloak: #####################...
-
Precondizione: La precondizione di un metodo e' una condizione che deve essere verificata prima che quel metodo sia invocato. Le preco...
Nessun commento:
Posta un commento