stable

Clone or download

Read-only

Deduplicate retrieval of full Artifact

part of request #23433 Clean program management tests No functional change expected. Notes: There are still usages of \Tracker_ArtifactFactory in adapters: - calls to getArtifactByIdUserCanView(). This case is different, it also checks user permissions. - calls to getArtifactById() with an int. When given an int, it is legitimate to return null. We could call it with -1 which is never a valid artifact_id. It should not throw an exception in this case. Given an ArtifactIdentifier, we expect to always get a valid Artifact object, or else we throw an Exception. This behaviour was being repeated across several adapters. It's easier to reuse it with an interface (in the Adapters namespace). Adding a Stub lets us reduce the amout of mocking in our tests. Change-Id: Ia081d58a147f27382da79bb6e0b00d62ba534ba0

Modified Files

Name
M plugins/program_management/include/Adapter/Program/Backlog/AsynchronousCreation/ChangesetAdder.php +4 −18 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/AsynchronousCreation/IterationCreationProcessorBuilder.php +7 −5 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/AsynchronousCreation/LastChangesetRetriever.php +5 −12 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/AsynchronousCreation/ProgramIncrementCreationProcessorBuilder.php +6 −4 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/AsynchronousCreation/ProgramIncrementUpdateProcessorBuilder.php +7 −5 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/ProgramIncrement/Content/FeatureAdditionProcessor.php +12 −16 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/ProgramIncrement/ProgramIncrementsRetriever.php +3 −3 Go to diff View file
R plugins/program_management/include/Adapter/Program/Backlog/ProgramIncrement/Source/Changeset/ChangesetRetriever.php Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/ProgramIncrement/Source/Changeset/Values/FieldValuesGathererRetriever.php +5 −13 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/ProgramIncrement/UserCanPlanInProgramIncrementVerifier.php +3 −10 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/Timebox/CrossReferenceRetriever.php +3 −8 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/Timebox/StatusValueRetriever.php +3 −6 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/Timebox/TimeframeValueRetriever.php +4 −7 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/Timebox/TitleValueRetriever.php +3 −7 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/Timebox/UriRetriever.php +3 −9 Go to diff View file
R plugins/program_management/include/Adapter/Program/Backlog/Timebox/UserCanUpdateRetriever.php Go to diff View file
M plugins/program_management/include/Adapter/Program/Feature/BackgroundColorRetriever.php +8 −9 Go to diff View file
M plugins/program_management/include/Adapter/Program/Feature/FeatureRepresentationBuilder.php +5 −11 Go to diff View file
M plugins/program_management/include/Adapter/Program/Feature/UserStoriesInMirroredProgramIncrementsPlanner.php +4 −11 Go to diff View file
A plugins/program_management/include/Adapter/Workspace/Tracker/Artifact/ArtifactFactoryAdapter.php +43 −0 Go to diff View file
R plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/PendingArtifactUserNotFoundException.php Go to diff View file
M plugins/program_management/include/Adapter/Workspace/Tracker/TrackerOfArtifactRetriever.php +5 −8 Go to diff View file
M plugins/program_management/include/Domain/Program/Backlog/Feature/FeatureIdentifier.php +7 −1 Go to diff View file
M plugins/program_management/include/Domain/Program/Backlog/Iteration/Iteration.php +6 −6 Go to diff View file
M plugins/program_management/include/Domain/Program/Backlog/Iteration/IterationsRetriever.php +3 −3 Go to diff View file
D plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/PendingArtifactNotFoundException.php +0 −33 Go to diff View file
M plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/ProgramIncrement.php +6 −6 Go to diff View file
M plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/Source/Changeset/Values/RetrieveFieldValuesGatherer.php +0 −2 Go to diff View file
D plugins/program_management/include/Domain/Program/Backlog/Timebox/TimeboxNotFoundException.php +0 −34 Go to diff View file
R plugins/program_management/include/Domain/Program/Backlog/Timebox/RetrieveUserCanUpdate.php Go to diff View file
M plugins/program_management/include/REST/v1/ProgramBacklogItemsResource.php +19 −22 Go to diff View file
M plugins/program_management/include/REST/v1/ProgramIncrementResource.php +85 −71 Go to diff View file
M plugins/program_management/include/REST/v1/ProjectResource.php +13 −11 Go to diff View file
M plugins/program_management/include/program_managementPlugin.php +6 −5 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/AsynchronousCreation/ChangesetAdderTest.php +9 −38 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/AsynchronousCreation/LastChangesetRetrieverTest.php +11 −17 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/ProgramIncrement/Content/FeatureAdditionProcessorTest.php +32 −24 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/ProgramIncrement/ProgramIncrementsRetrieverTest.php +2 −2 Go to diff View file
R plugins/program_management/tests/unit/Adapter/Program/Backlog/ProgramIncrement/Source/Changeset/ChangesetRetrieverTest.php Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/ProgramIncrement/Source/Changeset/Values/FieldValuesGathererRetrieverTest.php +13 −22 Go to diff View file
A plugins/program_management/tests/unit/Adapter/Program/Backlog/ProgramIncrement/UserCanPlanInProgramIncrementVerifierTest.php +139 −0 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/Timebox/CrossReferenceRetrieverTest.php +12 −21 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/Timebox/StatusValueRetrieverTest.php +7 −23 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/Timebox/TimeframeValueRetrieverTest.php +10 −25 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/Timebox/TitleValueRetrieverTest.php +10 −17 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/Timebox/UriRetrieverTest.php +8 −21 Go to diff View file
D plugins/program_management/tests/unit/Adapter/Program/Backlog/Timebox/UserCanUpdateRetrieverTest.php +0 −68 Go to diff View file
A plugins/program_management/tests/unit/Adapter/Program/Backlog/Timebox/UserCanUpdateTimeboxVerifierTest.php +71 −0 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Feature/Content/FeatureContentRetrieverTest.php +15 −18 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Feature/FeatureElementsRetrieverTest.php +12 −17 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Feature/FeatureRepresentationBuilderTest.php +16 −16 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Feature/UserStoriesInMirroredProgramIncrementsPlannerTest.php +24 −43 Go to diff View file
A plugins/program_management/tests/unit/Adapter/Workspace/Tracker/Artifact/ArtifactFactoryAdapterTest.php +64 −0 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Workspace/Tracker/TrackerOfArtifactRetrieverTest.php +13 −27 Go to diff View file
M plugins/program_management/tests/unit/Domain/Program/Backlog/Feature/FeatureIdentifierTest.php +6 −3 Go to diff View file
M plugins/program_management/tests/unit/Domain/Program/Backlog/Iteration/IterationTest.php +2 −2 Go to diff View file
M plugins/program_management/tests/unit/Domain/Program/Backlog/Iteration/IterationsRetrieverTest.php +2 −2 Go to diff View file
M plugins/program_management/tests/unit/REST/v1/IterationRepresentationTest.php +2 −2 Go to diff View file
A plugins/program_management/tests/unit/Stub/RetrieveFullArtifactStub.php +67 −0 Go to diff View file
R plugins/program_management/tests/unit/Stub/RetrieveUserCanUpdateStub.php Go to diff View file
M plugins/tracker/tests/unit/Builders/ChangesetTestBuilder.php +9 −0 Go to diff View file