// Path: src/test/java/salarycalculation/matchers/RecordNotFoundExceptionMatcher.java
// public static RecordNotFoundExceptionMatcher isClass(Class<?> expectEntityClass) {
//     return new RecordNotFoundExceptionMatcher(expectEntityClass, null, null);
// }
// 
// Path: src/test/java/salarycalculation/matchers/RecordNotFoundExceptionMatcher.java
// public static RecordNotFoundExceptionMatcher isKeys(Object... expectKeys) {
//     return new RecordNotFoundExceptionMatcher(null, null, expectKeys);
// }
// 
// Path: src/test/java/salarycalculation/dbsetup/CapabilitySetupSupport.java
// public interface CapabilitySetupSupport {
// 
//     default Operation capabilityInsert() {
//         Operation capability = insertInto("capability").columns("rank", "amount")
//                                                        .values("AS", 50000)
//                                                        .values("PG", 100000)
//                                                        .values("SE", 150000)
//                                                        .values("PL", 270000)
//                                                        .values("PM", 300000).build();
//         return capability;
//     }
// }
// 
// Path: src/test/java/salarycalculation/dbsetup/OrganizationSetupSupport.java
// public interface OrganizationSetupSupport {
// 
//     default Operation organizationInsert() {
//         Operation organization = insertInto("organization").columns("code", "name")
//                                                            .values("DEV1", "開発部1")
//                                                            .values("DEV2", "開発部2")
//                                                            .values("DEV3", "開発部3")
//                                                            .values("DEV", "開発部").build();
//         return organization;
//     }
// }
// 
// Path: src/test/java/salarycalculation/dbsetup/RoleSetupSupport.java
// public interface RoleSetupSupport {
// 
//     default Operation roleInsert() {
//         Operation role = insertInto("role").columns("rank", "amount")
//                                            .values("A1", 190000)
//                                            .values("A2", 192000)
//                                            .values("A3", 195000)
//                                            .values("C1", 200000)
//                                            .values("C2", 201000)
//                                            .values("C3", 202000)
//                                            .values("C4", 203000)
//                                            .values("C5", 204000)
//                                            .values("M1", 300000)
//                                            .values("M2", 320000)
//                                            .values("M3", 350000)
//                                            .values("CE", 500000).build();
//         return role;
//     }
// }


import static com.ninja_squad.dbsetup.Operations.deleteAllFrom;
import static com.ninja_squad.dbsetup.Operations.insertInto;
import static com.ninja_squad.dbsetup.Operations.sequenceOf;
import static com.ninja_squad.dbsetup.destination.DriverManagerDestination.with;
import static org.assertj.core.api.Assertions.assertThat;
import static salarycalculation.matchers.RecordNotFoundExceptionMatcher.isClass;
import static salarycalculation.matchers.RecordNotFoundExceptionMatcher.isKeys;
import java.sql.Connection;
import java.sql.DriverManager;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.internal.util.reflection.Whitebox;
import com.ninja_squad.dbsetup.DbSetup;
import com.ninja_squad.dbsetup.DbSetupTracker;
import com.ninja_squad.dbsetup.operation.Operation;
import salarycalculation.database.model.WorkRecord;
import salarycalculation.dbsetup.CapabilitySetupSupport;
import salarycalculation.dbsetup.OrganizationSetupSupport;
import salarycalculation.dbsetup.RoleSetupSupport;
import salarycalculation.exception.RecordNotFoundException;

        // 事前データの準備
        Operation truncate = deleteAllFrom("work", "employee", "role", "capability", "organization");
        Operation role = roleInsert();
        Operation capability = capabilityInsert();
        Operation organization = organizationInsert();
        Operation employee = insertInto("employee").columns("no", "organization", "name", "roleRank",
                                                            "capabilityRank")
                                                   .values(1, "DEV2", "愛媛 蜜柑", "A3", "SE").build();
        Operation work = insertInto("work").columns("employeeNo", "workYearMonth")
                                           .values(1, 201504).build();

        // 事前データ投入
        dbSetupTracker.launchIfNecessary(new DbSetup(with("jdbc:h2:./data/salary_calculation_test", "sa", ""),
                                                     sequenceOf(truncate, role, capability, organization, employee,
                                                                work)));
    }

    @Test
    public void 該当社員の稼動情報を取得できること() {
        dbSetupTracker.skipNextLaunch();

        WorkRecord actual = testee.getByYearMonth(1, 201504);

        assertThat(actual.getEmployeeNo()).isEqualTo(1);
        assertThat(actual.getWorkYearMonth()).isEqualTo(201504);
    }

    @Test
    public void 存在しない稼動情報を指定した場合に例外が送出されること() {
// Path: src/test/java/salarycalculation/matchers/RecordNotFoundExceptionMatcher.java
// public static RecordNotFoundExceptionMatcher isClass(Class<?> expectEntityClass) {
//     return new RecordNotFoundExceptionMatcher(expectEntityClass, null, null);
// }
// 
// Path: src/test/java/salarycalculation/matchers/RecordNotFoundExceptionMatcher.java
// public static RecordNotFoundExceptionMatcher isKeys(Object... expectKeys) {
//     return new RecordNotFoundExceptionMatcher(null, null, expectKeys);
// }
// 
// Path: src/test/java/salarycalculation/dbsetup/CapabilitySetupSupport.java
// public interface CapabilitySetupSupport {
// 
//     default Operation capabilityInsert() {
//         Operation capability = insertInto("capability").columns("rank", "amount")
//                                                        .values("AS", 50000)
//                                                        .values("PG", 100000)
//                                                        .values("SE", 150000)
//                                                        .values("PL", 270000)
//                                                        .values("PM", 300000).build();
//         return capability;
//     }
// }
// 
// Path: src/test/java/salarycalculation/dbsetup/OrganizationSetupSupport.java
// public interface OrganizationSetupSupport {
// 
//     default Operation organizationInsert() {
//         Operation organization = insertInto("organization").columns("code", "name")
//                                                            .values("DEV1", "開発部1")
//                                                            .values("DEV2", "開発部2")
//                                                            .values("DEV3", "開発部3")
//                                                            .values("DEV", "開発部").build();
//         return organization;
//     }
// }
// 
// Path: src/test/java/salarycalculation/dbsetup/RoleSetupSupport.java
// public interface RoleSetupSupport {
// 
//     default Operation roleInsert() {
//         Operation role = insertInto("role").columns("rank", "amount")
//                                            .values("A1", 190000)
//                                            .values("A2", 192000)
//                                            .values("A3", 195000)
//                                            .values("C1", 200000)
//                                            .values("C2", 201000)
//                                            .values("C3", 202000)
//                                            .values("C4", 203000)
//                                            .values("C5", 204000)
//                                            .values("M1", 300000)
//                                            .values("M2", 320000)
//                                            .values("M3", 350000)
//                                            .values("CE", 500000).build();
//         return role;
//     }
// }


// Path: src/test/java/salarycalculation/database/WorkDaoTest.java
import static com.ninja_squad.dbsetup.Operations.deleteAllFrom;
import static com.ninja_squad.dbsetup.Operations.insertInto;
import static com.ninja_squad.dbsetup.Operations.sequenceOf;
import static com.ninja_squad.dbsetup.destination.DriverManagerDestination.with;
import static org.assertj.core.api.Assertions.assertThat;
import static salarycalculation.matchers.RecordNotFoundExceptionMatcher.isClass;
import static salarycalculation.matchers.RecordNotFoundExceptionMatcher.isKeys;
import java.sql.Connection;
import java.sql.DriverManager;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.internal.util.reflection.Whitebox;
import com.ninja_squad.dbsetup.DbSetup;
import com.ninja_squad.dbsetup.DbSetupTracker;
import com.ninja_squad.dbsetup.operation.Operation;
import salarycalculation.database.model.WorkRecord;
import salarycalculation.dbsetup.CapabilitySetupSupport;
import salarycalculation.dbsetup.OrganizationSetupSupport;
import salarycalculation.dbsetup.RoleSetupSupport;
import salarycalculation.exception.RecordNotFoundException;


        // 事前データの準備
        Operation truncate = deleteAllFrom("work", "employee", "role", "capability", "organization");
        Operation role = roleInsert();
        Operation capability = capabilityInsert();
        Operation organization = organizationInsert();
        Operation employee = insertInto("employee").columns("no", "organization", "name", "roleRank",
                                                            "capabilityRank")
                                                   .values(1, "DEV2", "愛媛 蜜柑", "A3", "SE").build();
        Operation work = insertInto("work").columns("employeeNo", "workYearMonth")
                                           .values(1, 201504).build();

        // 事前データ投入
        dbSetupTracker.launchIfNecessary(new DbSetup(with("jdbc:h2:./data/salary_calculation_test", "sa", ""),
                                                     sequenceOf(truncate, role, capability, organization, employee,
                                                                work)));
    }

    @Test
    public void 該当社員の稼動情報を取得できること() {
        dbSetupTracker.skipNextLaunch();

        WorkRecord actual = testee.getByYearMonth(1, 201504);

        assertThat(actual.getEmployeeNo()).isEqualTo(1);
        assertThat(actual.getWorkYearMonth()).isEqualTo(201504);
    }

    @Test
    public void 存在しない稼動情報を指定した場合に例外が送出されること() {
        dbSetupTracker.skipNextLaunch();