@@ -69,7 +69,7 @@ public async Task Can_create_resources_for_matching_resource_type()
69
69
}
70
70
71
71
[ Fact ]
72
- public async Task Cannot_create_resource_for_mismatching_resource_type ( )
72
+ public async Task Cannot_create_resource_for_inaccessible_operation ( )
73
73
{
74
74
// Arrange
75
75
var requestBody = new
@@ -96,20 +96,20 @@ public async Task Cannot_create_resource_for_mismatching_resource_type()
96
96
( HttpResponseMessage httpResponse , Document responseDocument ) = await _testContext . ExecutePostAtomicAsync < Document > ( route , requestBody ) ;
97
97
98
98
// Assert
99
- httpResponse . ShouldHaveStatusCode ( HttpStatusCode . UnprocessableEntity ) ;
99
+ httpResponse . ShouldHaveStatusCode ( HttpStatusCode . Forbidden ) ;
100
100
101
101
responseDocument . Errors . ShouldHaveCount ( 1 ) ;
102
102
103
103
ErrorObject error = responseDocument . Errors [ 0 ] ;
104
- error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
104
+ error . StatusCode . Should ( ) . Be ( HttpStatusCode . Forbidden ) ;
105
105
error . Title . Should ( ) . Be ( "The requested operation is not accessible." ) ;
106
106
error . Detail . Should ( ) . Be ( "The 'add' resource operation is not accessible for resource type 'performers'." ) ;
107
107
error . Source . ShouldNotBeNull ( ) ;
108
108
error . Source . Pointer . Should ( ) . Be ( "/atomic:operations[0]" ) ;
109
109
}
110
110
111
111
[ Fact ]
112
- public async Task Cannot_update_resource_for_matching_resource_type ( )
112
+ public async Task Cannot_update_resource_for_inaccessible_operation ( )
113
113
{
114
114
// Arrange
115
115
MusicTrack existingTrack = _fakers . MusicTrack . Generate ( ) ;
@@ -145,20 +145,20 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
145
145
( HttpResponseMessage httpResponse , Document responseDocument ) = await _testContext . ExecutePostAtomicAsync < Document > ( route , requestBody ) ;
146
146
147
147
// Assert
148
- httpResponse . ShouldHaveStatusCode ( HttpStatusCode . UnprocessableEntity ) ;
148
+ httpResponse . ShouldHaveStatusCode ( HttpStatusCode . Forbidden ) ;
149
149
150
150
responseDocument . Errors . ShouldHaveCount ( 1 ) ;
151
151
152
152
ErrorObject error = responseDocument . Errors [ 0 ] ;
153
- error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
153
+ error . StatusCode . Should ( ) . Be ( HttpStatusCode . Forbidden ) ;
154
154
error . Title . Should ( ) . Be ( "The requested operation is not accessible." ) ;
155
155
error . Detail . Should ( ) . Be ( "The 'update' resource operation is not accessible for resource type 'musicTracks'." ) ;
156
156
error . Source . ShouldNotBeNull ( ) ;
157
157
error . Source . Pointer . Should ( ) . Be ( "/atomic:operations[0]" ) ;
158
158
}
159
159
160
160
[ Fact ]
161
- public async Task Cannot_add_to_ToMany_relationship_for_matching_resource_type ( )
161
+ public async Task Cannot_add_to_ToMany_relationship_for_inaccessible_operation ( )
162
162
{
163
163
// Arrange
164
164
MusicTrack existingTrack = _fakers . MusicTrack . Generate ( ) ;
@@ -201,12 +201,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
201
201
( HttpResponseMessage httpResponse , Document responseDocument ) = await _testContext . ExecutePostAtomicAsync < Document > ( route , requestBody ) ;
202
202
203
203
// Assert
204
- httpResponse . ShouldHaveStatusCode ( HttpStatusCode . UnprocessableEntity ) ;
204
+ httpResponse . ShouldHaveStatusCode ( HttpStatusCode . Forbidden ) ;
205
205
206
206
responseDocument . Errors . ShouldHaveCount ( 1 ) ;
207
207
208
208
ErrorObject error = responseDocument . Errors [ 0 ] ;
209
- error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
209
+ error . StatusCode . Should ( ) . Be ( HttpStatusCode . Forbidden ) ;
210
210
error . Title . Should ( ) . Be ( "The requested operation is not accessible." ) ;
211
211
error . Detail . Should ( ) . Be ( "The 'add' relationship operation is not accessible for relationship 'performers' on resource type 'musicTracks'." ) ;
212
212
error . Source . ShouldNotBeNull ( ) ;
0 commit comments