aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-01-30 16:40:15 +0300
committerGravatar Vitaly Takmazov2019-01-30 16:40:15 +0300
commit6d83f5614a5273ff53f1ddc5f4c614460e228993 (patch)
tree4369f064fbb7c9753d8df4b4cad8a5e152d03b40 /src/test/java/com
parenta2a86393941e9520a8f8a126fbad0c4fad406720 (diff)
fix user deletion flow when invalid key is present
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index 5ee8b1f4..1e56668d 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -1896,12 +1896,17 @@ public class ServerTests {
Delete delete = jsonMapper.readValue(deleteJsonStr, Delete.class);
ClientHttpRequestFactory originalRequestFactory = apClient.getRequestFactory();
MockRestServiceServer restServiceServer = MockRestServiceServer.createServer(apClient);
- restServiceServer.expect(times(1), requestTo((String)delete.getObject()))
+ restServiceServer.expect(times(2), requestTo((String)delete.getObject()))
.andRespond(withStatus(HttpStatus.GONE));
mockMvc.perform(post("/api/inbox")
.contentType(ACTIVITY_MEDIA_TYPE)
.content(deleteJsonStr))
.andExpect(status().isAccepted());
+ mockMvc.perform(post("/api/inbox")
+ .contentType(ACTIVITY_MEDIA_TYPE)
+ .content(deleteJsonStr)
+ .header("Signature", "keyId=\"https://example.com/users/deleted#main-key\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date digest content-type\",signature=\"wHoU91JJBsIYcR1W1/57B0oG98t5Aa/TvGPw1B8KQlAp5KhpePnOzD1MZRgivBx7YKO6eYwDx+AX9dn6tjlAvzRLygv21H6UoDZFihWzeE1HM8pY2Pe4EhUgYBN0YuiKUi7W4TS9bDRAJ5vGNPUWATe+2o5Jcbux5cZYXFKKYbLBLD+/IlqPdHA2IXLZ52HFVVfBkPH5sSklV6XJtD/PHLK9R/I9w/mUpj9moUPQu44rR7KvxiGNuHla3vfDtJbkBqLMdScX91EG8373AulXPUiCCF7R2lJB0fFQedm2nSbcwBoJ32GEyOyOPFgPKG5zd9Fd5TfB1pmA8ZIE0sChfA==\""))
+ .andExpect(status().isAccepted());
apClient.setRequestFactory(originalRequestFactory);
}
}