From 3249be3a6cb8fcf4d76db80fb45c44c94aec0f3e Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Fri, 14 Jun 2024 20:01:55 -0300 Subject: [PATCH] Improve coverage --- ...ericanCurrenciesRESTfulController.class.st | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st b/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st index 1fce0ac..017885e 100644 --- a/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st +++ b/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st @@ -137,15 +137,22 @@ SouthAmericanCurrenciesRESTfulController >> initializeBanknotesByCurrency [ { #category : 'initialization' } SouthAmericanCurrenciesRESTfulController >> initializeBanknotesRequestHandler [ - banknotesRequestHandler := RESTfulRequestHandlerBuilder new - handling: 'banknotes' - extractingIdentifierWith: [ :httpRequest | self identifierIn: httpRequest ] - locatingParentResourceWith: currenciesRequestHandler resourceLocator; - whenResponding: ZnMimeType applicationJson - encodeToJsonApplying: [ :resource :requestContext :writer | ]; - createEntityTagHashing: [ :hasher :banknote :requestContext | hasher include: banknote ]; - directCachingWith: [ :caching | caching doNotExpire ]; - build + banknotesRequestHandler := RESTfulRequestHandlerBuilder new + handling: 'banknotes' + extractingIdentifierWith: [ :httpRequest | + self identifierIn: httpRequest ] + locatingParentResourceWith: currenciesRequestHandler resourceLocator; + whenResponding: ZnMimeType applicationJson + encodeToJsonApplying: [ :resource :requestContext :writer | + writer + for: #Banknotes + customDo: [ :mapping | + mapping encoder: [ :banknotes | banknotes ] ] ] + as: #Banknotes; + createEntityTagHashing: [ :hasher :banknote :requestContext | + hasher include: banknote ]; + directCachingWith: [ :caching | caching doNotExpire ]; + build ] { #category : 'initialization' }