last wrong assert fixed

This commit is contained in:
Alessia Bardi 2020-06-23 11:36:04 +02:00
parent 71ef7d9e66
commit fcabee9242
1 changed files with 3 additions and 7 deletions

View File

@ -12,7 +12,6 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import eu.dnetlib.dhp.oa.graph.dump.gcat.GCatAPIClient; import eu.dnetlib.dhp.oa.graph.dump.gcat.GCatAPIClient;
import sun.jvm.hotspot.utilities.Assert;
/** /**
* NEVER EVER ENABLE THIS CLASS UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING: with the proper parameters set it can * NEVER EVER ENABLE THIS CLASS UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING: with the proper parameters set it can
@ -44,14 +43,11 @@ public class GCatAPIClientTest {
String json = IOUtils String json = IOUtils
.toString(getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/dump/gcat/gcat_pub.json")); .toString(getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/dump/gcat/gcat_pub.json"));
System.out.println("Creating item..."); System.out.println("Creating item...");
Assert.that(client.publish(json) == HttpStatus.SC_CREATED, "Item not created"); Assertions.assertEquals(HttpStatus.SC_CREATED, client.publish(json));
System.out.println("item created, now listing..."); System.out.println("item created, now listing...");
Assert.that(client.list(0, 10).size() == 1, "List has more elements than expected"); Assertions.assertEquals(1, client.list(0, 10).size());
// and then drop it // and then drop it
Assert Assertions.assertTrue(client.purge(objidentifier));
.that(
client.purge(objidentifier),
"It should return true! I just created item with name from " + objidentifier);
System.out.println("item purged"); System.out.println("item purged");
} }