@Test public void handleUpdate_passes_when_models_equal() throws Exception { observer.handleUpdate("key", JSON_STRING_1, JSON_STRING_1); then(agent).shouldHaveZeroInteractions(); then(emitter).shouldHaveZeroInteractions(); }
@Override public void handleUpdate(String key, M oldValue, M newValue) { if (!oldValue.equals(newValue)) { List<PatchOperation> operations = agent.updatedModel(key, oldValue, newValue); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } }
AgentStoreObserver implements StoreUpdateObserver<String, M> { @Override public void handleUpdate(String key, M oldValue, M newValue) { if (!oldValue.equals(newValue)) { List<PatchOperation> operations = agent.updatedModel(key, oldValue, newValue); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } } }
AgentStoreObserver implements StoreUpdateObserver<String, M> { @Override public void handleUpdate(String key, M oldValue, M newValue) { if (!oldValue.equals(newValue)) { List<PatchOperation> operations = agent.updatedModel(key, oldValue, newValue); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } }  }
AgentStoreObserver implements StoreUpdateObserver<String, M> { @Override public void handleUpdate(String key, M oldValue, M newValue) { if (!oldValue.equals(newValue)) { List<PatchOperation> operations = agent.updatedModel(key, oldValue, newValue); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } }  @Override void handleNew(String key, M value); @Override void handleUpdate(String key, M oldValue, M newValue); @Override void handleRemove(String key, M oldValue); }
AgentStoreObserver implements StoreUpdateObserver<String, M> { @Override public void handleUpdate(String key, M oldValue, M newValue) { if (!oldValue.equals(newValue)) { List<PatchOperation> operations = agent.updatedModel(key, oldValue, newValue); if (!operations.isEmpty()) { emitter.emit(new PatchSet(key, operations)); } } }  @Override void handleNew(String key, M value); @Override void handleUpdate(String key, M oldValue, M newValue); @Override void handleRemove(String key, M oldValue);  }