resource-manager/io/src/test/java/org/gcube/resourcemanagement/manager/io/codeexceptions/WebCodeExceptionTest.java

36 lines
1.0 KiB
Java

package org.gcube.resourcemanagement.manager.io.codeexceptions;
import static org.junit.Assert.*;
import java.util.Objects;
import org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.rs.RMCreateContextCode;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
/**
* Tests for {@link WebCodeException}s
*
* @author Manuele Simi (ISTI CNR)
*
*/
@RunWith(BlockJUnit4ClassRunner.class)
public class WebCodeExceptionTest {
/**
* Test method for
* {@link org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException#CodeException(org.gcube.resourcemanagement.manager.io.rs.RMCreateContextCode)}.
*/
@Test
public void testWebCodeException() {
WebCodeException exception = new WebCodeException(RMCreateContextCode.CONTEXT_ALREADY_EXISTS);
// unfortunately, we cannot test the response readEntity method on an
// outbound response
assertTrue("Unexpected code", Objects.nonNull(exception.getResponse()));
}
}