SpaceConfigStorageImpl implements SpaceConfigStorage { @Override public void saveChangeRequest(final String repositoryAlias, final ChangeRequest changeRequest) { objectStorage.write(buildChangeRequestFilePath(repositoryAlias, changeRequest.getId()), changeRequest); } SpaceConfigStorageImpl(); @Inject  SpaceConfigStorageImpl(final ObjectStorage objectStorage,
                                  final @Named("configIO") IOService ioService); void setup(final String spaceName); @Override BranchPermissions loadBranchPermissions(final String branchName,
                                                   final String projectIdentifier); @Override void saveBranchPermissions(final String branchName,
                                      final String projectIdentifier,
                                      final BranchPermissions branchPermissions); @Override void deleteBranchPermissions(final String branchName,
                                        final String projectIdentifier); @Override void deleteRepository(final String repositoryAlias); @Override List<ChangeRequest> loadChangeRequests(final String repositoryAlias); @Override ChangeRequest loadChangeRequest(final String repositoryAlias,
                                           final Long changeRequestId); @Override void saveChangeRequest(final String repositoryAlias,
                                  final ChangeRequest changeRequest); @Override void deleteAllChangeRequests(final String repositoryAlias); @Override void deleteChangeRequest(final String repositoryAlias,
                                    final Long changeRequestId); @Override List<Long> getChangeRequestIds(String repositoryAlias); @Override List<ChangeRequestComment> loadChangeRequestComments(final String repositoryAlias,
                                                                final Long changeRequestId); @Override ChangeRequestComment loadChangeRequestComment(final String repositoryAlias,
                                                         final Long changeRequestId,
                                                         final Long changeRequestCommentId); @Override void saveChangeRequestComment(final String repositoryAlias,
                                         final Long changeRequestId,
                                         final ChangeRequestComment changeRequestComment); @Override void deleteAllChangeRequestComments(final String repositoryAlias,
                                               final Long changeRequestId); @Override void deleteChangeRequestComment(final String repositoryAlias,
                                           final Long changeRequestId,
                                           final Long changeRequestCommentId); @Override List<Long> getChangeRequestCommentIds(final String repositoryAlias,
                                                 final Long changeRequestId); SpaceInfo loadSpaceInfo(); @Override void saveSpaceInfo(final SpaceInfo spaceInfo); @Override void startBatch(); @Override void endBatch(); @Override void close(); @Override boolean isInitialized(); Path getPath(); static final String FILE_FORMAT; static final String BRANCH_PERMISSIONS; static final String SPACE_INFO; }
@Test public void saveChangeRequestTest() { final ChangeRequest changeRequest = mock(ChangeRequest.class); doReturn(1L).when(changeRequest).getId(); spaceConfigStorage.saveChangeRequest("MyProject", changeRequest); verify(objectStorage).write(eq("/MyProject/change_requests/1/information.cr"), same(changeRequest)); }