templates.util.CheckResultTest.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoplsp Show documentation
Show all versions of autoplsp Show documentation
Maven plugin to generate Java classes from StoredProcedure and Functions in Database
package ${javaPackage}.util;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class CheckResultTest {
@InjectMocks
CheckResultImpl checkResult;
@Test
public void testInputNull() throws java.sql.SQLException {
checkResult.check(null);
}
@Test
public void testInputNotNullFail() throws java.sql.SQLException {
java.util.Map map = new java.util.HashMap<<#if !diamond>String, Object>();
checkResult.check(map);
}
@Test(expected = java.sql.SQLException.class)
public void testInputResponseError() throws java.sql.SQLException {
java.util.Map map = new java.util.HashMap<<#if !diamond>String, Object>();
map.put("${outParameterCode}", 1${successCode}1);
map.put("${outParameterMessage}", "ERROR");
checkResult.check(map);
}
@Test
public void testInputOk() throws java.sql.SQLException {
java.util.Map map = new java.util.HashMap<<#if !diamond>String, Object>();
map.put("${outParameterCode}", ${successCode});
map.put("${outParameterMessage}", "OK");
checkResult.check(map);
}
}