### Question:
MsoOpenstackException extends MsoException { @Override public String toString() { return statusCode + " " + statusMessage + ": " + errorDetail; } MsoOpenstackException(int code, String message, String detail);  MsoOpenstackException(int code, String message, String detail, Exception e); @Override String toString();  }### Answer:
@Test public void testConstructor() { MsoOpenstackException msoOpenstackException = new MsoOpenstackException(404, "test", "test"); Assert.assertEquals("test", msoOpenstackException.getMessage()); Assert.assertEquals("404 test: test", msoOpenstackException.toString()); Assert.assertEquals(MsoExceptionCategory.OPENSTACK, msoOpenstackException.category); }
@Test public void testOverloadedConstructor() { MsoOpenstackException msoOpenstackExceptionEx = new MsoOpenstackException(404, "test", "test", new Exception()); Assert.assertEquals("test", msoOpenstackExceptionEx.getMessage()); Assert.assertEquals("404 test: test", msoOpenstackExceptionEx.toString()); Assert.assertEquals(MsoExceptionCategory.OPENSTACK, msoOpenstackExceptionEx.category); Assert.assertNotNull(msoOpenstackExceptionEx.getCause()); }