SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.3 KiB

package de.superx.servlet;
import static org.junit.Assert.*;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.junit.Test;
public class SuperXAdminTest extends BaseServletTest {
private SuperXAdmin superXAdmin = new SuperXAdmin();
/**
* @author hiber Test method for
* {@link de.superx.servlet.SuperXAdmin#doPost(HttpServletRequest, HttpServletResponse)}.
*/
@Test
public void testDoPost() {
final String EXPECTED_EXCEPTION_MESSAGE = "dopost nicht unterstützt";
Exception expectedException = null;
try {
this.superXAdmin.doPost(this.request, this.response);
}catch(Exception e) {
expectedException = e;
}
assertTrue("exception has been thrown", expectedException != null);
assertTrue("exception message equals expected message ", expectedException.getMessage().equals(EXPECTED_EXCEPTION_MESSAGE));
assertTrue("exception is instance of UnsupportedOperationException", expectedException instanceof UnsupportedOperationException);
}
/**
* @author hiber Test method for
* {@link de.superx.servlet.SuperXAdmin#getServletInfo()}.
*/
@Test
public void testGetServletInfo() {
final String EXPECTED_INFO = "<i>SuperXDBServlet, v.1.2</i>";
assertTrue("servlet info equals expected info", this.superXAdmin.getServletInfo().equals(EXPECTED_INFO));
}
}