Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Jun 14, 2024
1 parent 0d6dfa1 commit 3249be3
Showing 1 changed file with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down

0 comments on commit 3249be3

Please sign in to comment.