stable

Clone or download

Read-only

refactor: rename FreestyleMappingFactory

part of request #39022 Moving a card in Taskboard can have side effects No functional change. Unit, REST and DB integration tests should pass. Why? This series of refactorings has the goal to make it easy to write a "domain" API to find the current column of a given card. This requires us to know which field in the card's tracker is "mapped" (either freestyle or status semantic). We start by simplifying the freestyle mapping part. FreestyleMappingFactory did not have clear responsibilities. It is now renamed into FreestyleMappedFieldValuesRetriever (that focuses on the values). Added interfaces before DB queries. Interfaces allow us to make the DAO final and write stubs to replace it in unit tests. Also removed static build methods. The final, top-most endpoints should have the responsibility of instantiating everything, so that they can substitute interfaces with caches if needed. Instantiation should not be a responsibility of individual objects. Change-Id: Id7c9c03f4e9e82ae3be8e2bff3e4ca29baa8b2f2

Modified Files

Name
M plugins/cardwall/tests/unit/Test/Builders/ColumnTestBuilder.php +9 −2 Go to diff View file
R plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingFactory.php Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingDao.php +9 −5 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/SearchMappedFieldValuesForColumn.php +37 −0 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/VerifyMappingExists.php +30 −0 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedValuesRetriever.php +7 −15 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/TrackerMappingPresenterBuilder.php +2 −2 Go to diff View file
M plugins/taskboard/include/REST/v1/Cell/CardMappedFieldUpdater.php +2 −2 Go to diff View file
M plugins/taskboard/tests/integration/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingDaoTest.php +5 −5 Go to diff View file
A plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappedFieldValuesRetrieverTest.php +87 −0 Go to diff View file
D plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingFactoryTest.php +0 −81 Go to diff View file
A plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/Freestyle/SearchMappedFieldValuesForColumnStub.php +56 −0 Go to diff View file
A plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/Freestyle/VerifyMappingExistsStub.php +47 −0 Go to diff View file
M plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/MappedValuesRetrieverTest.php +40 −49 Go to diff View file