gcube-cms-suite/geoportal-service/src/test/java/org/gcube/application/geoportal/service/InexistentUseCaseDescriptor...

55 lines
1.5 KiB
Java
Raw Normal View History

2022-02-14 17:06:32 +01:00
package org.gcube.application.geoportal.service;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
2022-03-22 18:07:34 +01:00
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
2022-02-24 18:09:30 +01:00
import org.gcube.application.geoportal.service.profiledDocuments.AbstractProfiledDocumentsTests;
2022-02-14 17:06:32 +01:00
import org.junit.Test;
2022-03-30 18:39:10 +02:00
import javax.ws.rs.InternalServerErrorException;
import javax.ws.rs.WebApplicationException;
2022-02-14 17:06:32 +01:00
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
2022-03-30 18:39:10 +02:00
import java.util.UUID;
2022-02-14 17:06:32 +01:00
import static org.junit.Assert.assertEquals;
2022-03-22 18:07:34 +01:00
import static org.junit.Assume.assumeTrue;
2022-02-14 17:06:32 +01:00
2022-03-04 14:23:20 +01:00
public class InexistentUseCaseDescriptorTests extends AbstractProfiledDocumentsTests {
2022-02-16 17:12:54 +01:00
2022-03-30 18:39:10 +02:00
private static String inexistentUCID= UUID.randomUUID().toString();
2022-02-14 17:06:32 +01:00
@Override
protected WebTarget baseTarget() {
2022-03-30 18:39:10 +02:00
String testProfileId=inexistentUCID;
2022-02-14 17:06:32 +01:00
return target(InterfaceConstants.Methods.PROJECTS).path(testProfileId);
}
// GET
@Test
public void testMissingProfile(){
2022-03-22 18:07:34 +01:00
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
2022-02-14 17:06:32 +01:00
Response resp = target(InterfaceConstants.Methods.PROJECTS)
2022-03-30 18:39:10 +02:00
.path(inexistentUCID).request().get();
2022-02-14 17:06:32 +01:00
assertEquals(404,resp.getStatus());
}
2022-03-30 18:39:10 +02:00
@Override
@Test(expected = Exception.class)
public void getAll() {
super.getAll();
}
@Override
@Test(expected = Exception.class)
public void getByID() {
super.getByID();
}
2022-04-07 18:12:42 +02:00
@Override
@Test(expected = Exception.class)
public void getConfiguration() {
super.getByID();
}
2022-02-14 17:06:32 +01:00
}