* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.exceptions;
+import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
import org.onap.aai.AAISetup;
-import static org.junit.Assert.assertEquals;
-
public class AAIExceptionTest extends AAISetup {
private static final String code = "4004";
private static final String details = "This is a detailed description of the exception.";
private static final Throwable cause = new RuntimeException("This is a runtime exception.");
private static final Throwable noMessage = new RuntimeException();
-
+
/**
* Test constructor with 0 params.
*
AAIException exception = new AAIException();
assertEquals(exception, exception);
}
-
+
/**
* Test constructor with 1 params.
*
AAIException exception = new AAIException(code);
assertEquals(exception, exception);
}
-
+
/**
* Test constructor with 2 params details.
*
AAIException exception = new AAIException(code, details);
assertEquals(details, exception.getMessage());
}
-
+
/**
* Test constructor with 2 params cause.
*
AAIException exception = new AAIException(code, cause);
assertEquals("java.lang.RuntimeException: This is a runtime exception.", exception.getMessage());
}
-
+
/**
* Test constructor with 2 params null message.
*
AAIException exception = new AAIException(code, noMessage);
assertEquals(noMessage.toString(), exception.getMessage());
}
-
+
/**
* Test constructor with 3 params.
*
String details = "This is a detailed description of the exception.";
assertEquals(details, exception.getMessage());
}
-
+
/**
* Test constructor with 3 params null message.
*