Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend test utility methods #200

Draft
wants to merge 1 commit into
base: v10
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@
applying: [ :request | request setAccept: aMediaRange ]
]

{ #category : 'private - HTTP requests' }
SingleResourceRESTfulControllerTest >> requestToPATCH: content at: aUrl as: aMediaType withPathParams: aDictionary applying: aConfiguration conditionalTo: anETag [

| request |
request := ( ZnRequest patch: aUrl )
setAccept: aMediaType;
setIfMatchTo: anETag;
entity: ( ZnEntity with: content type: aMediaType );
yourself.

aConfiguration value: request.

^ TeaRequest fromZnRequest: request pathParams: aDictionary
]

Check warning on line 141 in source/Stargate-SUnit-Model/SingleResourceRESTfulControllerTest.class.st

View check run for this annotation

Codecov / codecov/patch

source/Stargate-SUnit-Model/SingleResourceRESTfulControllerTest.class.st#L129-L141

Added lines #L129 - L141 were not covered by tests

{ #category : 'private - HTTP requests' }
SingleResourceRESTfulControllerTest >> requestToPATCHResourceIdentifiedBy: anIdentifier with: aRequestBody accepting: aMediaRange conditionalTo: anETag [

Expand All @@ -148,6 +163,27 @@
yourself)
]

{ #category : 'private - HTTP requests' }
SingleResourceRESTfulControllerTest >> requestToPOST: content at: aUrl as: aMediaType withPathParams: aDictionary applying: aConfiguration [

| request |
request := ( ZnRequest post: aUrl )
entity: ( ZnEntity with: content type: aMediaType );
yourself.

aConfiguration value: request.

^ TeaRequest fromZnRequest: request pathParams: aDictionary
]

Check warning on line 177 in source/Stargate-SUnit-Model/SingleResourceRESTfulControllerTest.class.st

View check run for this annotation

Codecov / codecov/patch

source/Stargate-SUnit-Model/SingleResourceRESTfulControllerTest.class.st#L167-L177

Added lines #L167 - L177 were not covered by tests

{ #category : 'private - HTTP requests' }
SingleResourceRESTfulControllerTest >> requestToPOSTWithoutContentAt: aUrl identifiedBy: anIdentifier [

^ TeaRequest
fromZnRequest: ( ZnRequest post: aUrl )
pathParams: ( self parametersWith: anIdentifier )
]

Check warning on line 185 in source/Stargate-SUnit-Model/SingleResourceRESTfulControllerTest.class.st

View check run for this annotation

Codecov / codecov/patch

source/Stargate-SUnit-Model/SingleResourceRESTfulControllerTest.class.st#L180-L185

Added lines #L180 - L185 were not covered by tests

{ #category : 'private - support' }
SingleResourceRESTfulControllerTest >> resourceUrl [

Expand Down