@Test @SuppressWarnings("unchecked") public void testLoadByPah() { ServiceCallback<Diagram> callback = mock(ServiceCallback.class); tested.loadByPath(path, callback); verify(callback, times(1)).onSuccess(eq(diagram)); verify(preferencesRegistryLoader, times(1)).load(eq(metadata), any(ParameterizedCommand.class), any(ParameterizedCommand.class)); verify(callback, never()).onError(any(ClientRuntimeError.class)); }
@SuppressWarnings("unchecked") public void loadByPath(final Path path, final ServiceCallback<Diagram> callback) { clientDiagramServices.getByPath(path, new ServiceCallback<Diagram<Graph, Metadata>>() { @Override public void onSuccess(final Diagram<Graph, Metadata> diagram) { loadPreferences(diagram, prefs -> callback.onSuccess(diagram), error -> callback.onError(new ClientRuntimeError(error))); } @Override public void onError(final ClientRuntimeError error) { callback.onError(error); } }); }
DiagramLoader { @SuppressWarnings("unchecked") public void loadByPath(final Path path, final ServiceCallback<Diagram> callback) { clientDiagramServices.getByPath(path, new ServiceCallback<Diagram<Graph, Metadata>>() { @Override public void onSuccess(final Diagram<Graph, Metadata> diagram) { loadPreferences(diagram, prefs -> callback.onSuccess(diagram), error -> callback.onError(new ClientRuntimeError(error))); } @Override public void onError(final ClientRuntimeError error) { callback.onError(error); } }); } }
DiagramLoader { @SuppressWarnings("unchecked") public void loadByPath(final Path path, final ServiceCallback<Diagram> callback) { clientDiagramServices.getByPath(path, new ServiceCallback<Diagram<Graph, Metadata>>() { @Override public void onSuccess(final Diagram<Graph, Metadata> diagram) { loadPreferences(diagram, prefs -> callback.onSuccess(diagram), error -> callback.onError(new ClientRuntimeError(error))); } @Override public void onError(final ClientRuntimeError error) { callback.onError(error); } }); } @Inject  DiagramLoader(final ClientDiagramService clientDiagramServices,
                         final StunnerPreferencesRegistryLoader preferencesRegistryLoader); }
DiagramLoader { @SuppressWarnings("unchecked") public void loadByPath(final Path path, final ServiceCallback<Diagram> callback) { clientDiagramServices.getByPath(path, new ServiceCallback<Diagram<Graph, Metadata>>() { @Override public void onSuccess(final Diagram<Graph, Metadata> diagram) { loadPreferences(diagram, prefs -> callback.onSuccess(diagram), error -> callback.onError(new ClientRuntimeError(error))); } @Override public void onError(final ClientRuntimeError error) { callback.onError(error); } }); } @Inject  DiagramLoader(final ClientDiagramService clientDiagramServices,
                         final StunnerPreferencesRegistryLoader preferencesRegistryLoader); @SuppressWarnings("unchecked") void loadByPath(final Path path,
                           final ServiceCallback<Diagram> callback); }
DiagramLoader { @SuppressWarnings("unchecked") public void loadByPath(final Path path, final ServiceCallback<Diagram> callback) { clientDiagramServices.getByPath(path, new ServiceCallback<Diagram<Graph, Metadata>>() { @Override public void onSuccess(final Diagram<Graph, Metadata> diagram) { loadPreferences(diagram, prefs -> callback.onSuccess(diagram), error -> callback.onError(new ClientRuntimeError(error))); } @Override public void onError(final ClientRuntimeError error) { callback.onError(error); } }); } @Inject  DiagramLoader(final ClientDiagramService clientDiagramServices,
                         final StunnerPreferencesRegistryLoader preferencesRegistryLoader); @SuppressWarnings("unchecked") void loadByPath(final Path path,
                           final ServiceCallback<Diagram> callback);  }