Search in sources :

Example 1 with PersistenceCallbackRegistry

use of org.springframework.sync.diffsync.PersistenceCallbackRegistry 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

Todo (org.springframework.sync.Todo)1 PersistenceCallbackRegistry (org.springframework.sync.diffsync.PersistenceCallbackRegistry)1 ShadowStore (org.springframework.sync.diffsync.ShadowStore)1 MapBasedShadowStore (org.springframework.sync.diffsync.shadowstore.MapBasedShadowStore)1 MockMvc (org.springframework.test.web.servlet.MockMvc)1