mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:05:50 +00:00
Merge conflicts
This commit is contained in:
commit
fc12751b2c
1 changed files with 18 additions and 0 deletions
|
@ -13,6 +13,7 @@ import org.junit.Before;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.Mock;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||||
import org.springframework.samples.petclinic.owner.Owner;
|
import org.springframework.samples.petclinic.owner.Owner;
|
||||||
|
@ -37,6 +38,9 @@ public class NewOwnerStoreTest {
|
||||||
HashMap<Integer, StaticOwner> ownerStore;
|
HashMap<Integer, StaticOwner> ownerStore;
|
||||||
|
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
Owner mockOwner;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
testOwnerStore = NewOwnerStore.getInstance(owners);
|
testOwnerStore = NewOwnerStore.getInstance(owners);
|
||||||
|
@ -110,4 +114,18 @@ public class NewOwnerStoreTest {
|
||||||
public void consistencyCheck () {
|
public void consistencyCheck () {
|
||||||
System.out.println(testOwnerStore.checkConsistency());
|
System.out.println(testOwnerStore.checkConsistency());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void checkShadowWrite() {
|
||||||
|
testOwnerStore = NewOwnerStore.getInstance(owners);
|
||||||
|
|
||||||
|
//make sure that inconsisties are recorded and fixed
|
||||||
|
testOwnerStore.testPutInOldDatastoreOnly(mockOwner);
|
||||||
|
assertEquals(1, testOwnerStore.checkConsistency());
|
||||||
|
assertEquals(0, testOwnerStore.checkConsistency());
|
||||||
|
|
||||||
|
//make sure that any changes written to old database are also written to new database
|
||||||
|
testOwnerStore.save(mockOwner);
|
||||||
|
assertEquals(0, testOwnerStore.checkConsistency());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue