Search in sources :

Example 26 with MapBasedShadowStore

use of org.springframework.sync.diffsync.shadowstore.MapBasedShadowStore in project spring-sync by spring-projects.

the class DiffSyncControllerTest method mockMvc.

private MockMvc mockMvc(TodoRepository todoRepository) {
    ShadowStore shadowStore = new MapBasedShadowStore("x");
    PersistenceCallbackRegistry callbackRegistry = new PersistenceCallbackRegistry();
    callbackRegistry.addPersistenceCallback(new JpaPersistenceCallback<Todo>(todoRepository, Todo.class));
    DiffSyncController controller = new DiffSyncController(callbackRegistry, shadowStore);
    MockMvc mvc = standaloneSetup(controller).setMessageConverters(new JsonPatchHttpMessageConverter()).build();
    return mvc;
}
Also used : Todo(org.springframework.sync.Todo) MapBasedShadowStore(org.springframework.sync.diffsync.shadowstore.MapBasedShadowStore) PersistenceCallbackRegistry(org.springframework.sync.diffsync.PersistenceCallbackRegistry) MapBasedShadowStore(org.springframework.sync.diffsync.shadowstore.MapBasedShadowStore) ShadowStore(org.springframework.sync.diffsync.ShadowStore) MockMvc(org.springframework.test.web.servlet.MockMvc)

Aggregations

MapBasedShadowStore (org.springframework.sync.diffsync.shadowstore.MapBasedShadowStore)26 Test (org.junit.Test)25 Todo (org.springframework.sync.Todo)22 Patch (org.springframework.sync.Patch)21 ArrayList (java.util.ArrayList)5 PatchOperation (org.springframework.sync.PatchOperation)5 MoveOperation (org.springframework.sync.MoveOperation)4 Person (org.springframework.sync.Person)4 PatchException (org.springframework.sync.PatchException)2 AddOperation (org.springframework.sync.AddOperation)1 PersistenceCallbackRegistry (org.springframework.sync.diffsync.PersistenceCallbackRegistry)1 ShadowStore (org.springframework.sync.diffsync.ShadowStore)1 MockMvc (org.springframework.test.web.servlet.MockMvc)1