|
|
|
@ -5,14 +5,18 @@ import me.bearns.fias.helper.XMLSourceHelper; |
|
|
|
|
import me.bearns.fias.helpers.Catalog; |
|
|
|
|
import me.bearns.fias.helpers.UnmarshallerParameters; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
import org.junit.runner.RunWith; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; |
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest; |
|
|
|
|
import org.springframework.test.context.ActiveProfiles; |
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner; |
|
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
|
|
@ActiveProfiles("test") |
|
|
|
|
@DataJpaTest |
|
|
|
|
@RunWith(SpringRunner.class) |
|
|
|
|
@SpringBootTest |
|
|
|
|
public class StreamSaverTest { |
|
|
|
|
|
|
|
|
|
private static final String AO_FILENAME = "AS_ADDROBJ_20200903_b02fb98f-354f-4ed4-af2f-467c5789989f.XML"; |
|
|
|
@ -22,7 +26,7 @@ public class StreamSaverTest { |
|
|
|
|
private StreamSaver service; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private static Catalog catalog; |
|
|
|
|
private Catalog catalog; |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void addrobjTest() throws CommonException { |
|
|
|
@ -37,9 +41,9 @@ public class StreamSaverTest { |
|
|
|
|
@Test |
|
|
|
|
public void houseTest() throws CommonException { |
|
|
|
|
|
|
|
|
|
final UnmarshallerParameters config = catalog.getByPrefix(AO_FILENAME); |
|
|
|
|
final UnmarshallerParameters config = catalog.getByPrefix(HOUSE_FILENAME); |
|
|
|
|
|
|
|
|
|
final InputStream stream = XMLSourceHelper.getAOStream(); |
|
|
|
|
final InputStream stream = XMLSourceHelper.getHouseStream(); |
|
|
|
|
|
|
|
|
|
service.process(stream, config, null); |
|
|
|
|
} |
|
|
|
|