@Test public void applyUpdate() throws Exception { PositionChangeUpdate update = new PositionChangeUpdate(date, creator1, lat, lon, date.getTime()); update.applyUpdate(mockRepos); verify(mockUserRepository).getUser(creator1); verify(mockUser).setLocation(any(Location.class)); verify(mockUserRepository).updateUser(mockUser); }
@Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); }
PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } }
PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } PositionChangeUpdate(@JsonProperty("time-created") Date timeCreated,
                                @JsonProperty("creator") int creator,
                                @JsonProperty("latitude") double latitude,
                                @JsonProperty("longitude") double longitude,
                                @JsonProperty("time-measured")
                                        long timeMeasured); }
PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } PositionChangeUpdate(@JsonProperty("time-created") Date timeCreated,
                                @JsonProperty("creator") int creator,
                                @JsonProperty("latitude") double latitude,
                                @JsonProperty("longitude") double longitude,
                                @JsonProperty("time-measured")
                                        long timeMeasured); @Override void applyUpdate(RepositorySet repositorySet); }
PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } PositionChangeUpdate(@JsonProperty("time-created") Date timeCreated,
                                @JsonProperty("creator") int creator,
                                @JsonProperty("latitude") double latitude,
                                @JsonProperty("longitude") double longitude,
                                @JsonProperty("time-measured")
                                        long timeMeasured); @Override void applyUpdate(RepositorySet repositorySet);  }