Tests ok
This commit is contained in:
@@ -9,6 +9,9 @@ import javax.persistence.Table;
|
|||||||
@Table(name = "version")
|
@Table(name = "version")
|
||||||
public class FiasVersion {
|
public class FiasVersion {
|
||||||
|
|
||||||
|
public FiasVersion() {
|
||||||
|
}
|
||||||
|
|
||||||
public FiasVersion(Long versionId, String textVersion, String fiasCompleteXmlUrl, String fiasDeltaXmlUrl) {
|
public FiasVersion(Long versionId, String textVersion, String fiasCompleteXmlUrl, String fiasDeltaXmlUrl) {
|
||||||
this.versionId = versionId;
|
this.versionId = versionId;
|
||||||
this.textVersion = textVersion;
|
this.textVersion = textVersion;
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ databaseChangeLog:
|
|||||||
nullable: false
|
nullable: false
|
||||||
- column:
|
- column:
|
||||||
name: version_txt
|
name: version_txt
|
||||||
type: number
|
type: varchar
|
||||||
- column:
|
- column:
|
||||||
name: xml_url
|
name: xml_url
|
||||||
type: varchar
|
type: varchar
|
||||||
|
- column:
|
||||||
|
name: delta_xml_url
|
||||||
|
type: varchar
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class VersionRepositoryTests {
|
|||||||
private FiasVersionRepository repository;
|
private FiasVersionRepository repository;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindByLastName() {
|
public void testFindById() {
|
||||||
FiasVersion fiasVersion = new FiasVersion(1L, "last", "c", "d");
|
FiasVersion fiasVersion = new FiasVersion(1L, "last", "c", "d");
|
||||||
entityManager.persist(fiasVersion);
|
entityManager.persist(fiasVersion);
|
||||||
|
|
||||||
@@ -46,4 +46,16 @@ public class VersionRepositoryTests {
|
|||||||
|
|
||||||
assertThat(version).extracting(FiasVersion::getVersionId).isEqualTo(fiasVersion.getVersionId());
|
assertThat(version).extracting(FiasVersion::getVersionId).isEqualTo(fiasVersion.getVersionId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSve() {
|
||||||
|
FiasVersion fiasVersion = new FiasVersion(1L, "last", "c", "d");
|
||||||
|
repository.save(fiasVersion);
|
||||||
|
|
||||||
|
Optional<FiasVersion> byId = repository.findById(fiasVersion.getVersionId());
|
||||||
|
|
||||||
|
FiasVersion version = byId.get();
|
||||||
|
|
||||||
|
assertThat(version).extracting(FiasVersion::getVersionId).isEqualTo(fiasVersion.getVersionId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user