Adapt CodeExceptionTest to web exceptions.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@161931 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a70350c9df
commit
8aff6e850e
|
@ -2,6 +2,8 @@ package org.gcube.resourcemanagement.manager.io.exceptions;
|
|||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.gcube.resourcemanagement.manager.io.exceptions.WebCodeException;
|
||||
import org.gcube.resourcemanagement.manager.io.rs.RMCode;
|
||||
import org.junit.Test;
|
||||
|
@ -23,8 +25,8 @@ public class CodeExceptionTest {
|
|||
@Test
|
||||
public void testCodeException() {
|
||||
WebCodeException exception = new WebCodeException(RMCode.CONTEXT_ALREADY_EXIST);
|
||||
assertTrue("Unexpected id", exception.getErrorCode() == RMCode.CONTEXT_ALREADY_EXIST.getId());
|
||||
assertTrue("Unexpected message", exception.getErrorMsg().equals(RMCode.CONTEXT_ALREADY_EXIST.getMessage()));
|
||||
//unfortunately, we cannot test the response readEntity method on an outbound response
|
||||
assertTrue("Unexpected code", Objects.nonNull(exception.getResponse()));
|
||||
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue