org.lieuofs.district.biz.GestionDistrictTest.java Source code

Java tutorial

Introduction

Here is the source code for org.lieuofs.district.biz.GestionDistrictTest.java

Source

/**
 * This file is part of LieuOFS.
 *
 * LieuOFS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 *
 * LieuOFS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LieuOFS.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.lieuofs.district.biz;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.lieuofs.district.IDistrict;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/beans_lieuofs.xml")
public class GestionDistrictTest {

    @Resource(name = "gestionDistrict")
    private IGestionDistrict gestionnaire;

    @Test
    public void lecture() {
        IDistrict district = gestionnaire.lire(Long.valueOf(10104l));
        assertEquals("N OFS de la Sarine", 1004, district.getNumeroOFS());
        assertEquals("Canton de Fribourg", "FR", district.getCanton().getCodeIso2());
    }

}