All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.util.CheckResultTest.ftl Maven / Gradle / Ivy

Go to download

Maven plugin to generate Java classes from StoredProcedure and Functions in Database

There is a newer version: 1.8.20
Show newest version
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);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy