|
26 | 26 | using Newtonsoft.Json;
|
27 | 27 | using Newtonsoft.Json.Linq;
|
28 | 28 | using Xunit;
|
| 29 | +using Microsoft.Azure.WebJobs.Script.Models; |
29 | 30 |
|
30 | 31 | namespace Microsoft.Azure.WebJobs.Script.Tests.EndToEnd
|
31 | 32 | {
|
@@ -97,6 +98,34 @@ public async Task HostPing_Succeeds(string method)
|
97 | 98 | Assert.Equal("no-store, no-cache", cacheHeader);
|
98 | 99 | }
|
99 | 100 |
|
| 101 | + [Fact] |
| 102 | + public async Task InstallExtensionsEnsureOldPathReturns404() |
| 103 | + { |
| 104 | + ExtensionPackageReferenceWithActions body = new ExtensionPackageReferenceWithActions(); |
| 105 | + var jsonBody = JsonConvert.SerializeObject(body); |
| 106 | + var content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); |
| 107 | + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Put, "123"); |
| 108 | + request.Headers.Add(AuthenticationLevelHandler.FunctionsKeyHeaderName, _fixture.MasterKey); |
| 109 | + request.Content = content; |
| 110 | + HttpResponseMessage response = await _fixture.Host.HttpClient.SendAsync(request); |
| 111 | + |
| 112 | + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); |
| 113 | + } |
| 114 | + |
| 115 | + [Fact] |
| 116 | + public async Task InstallExtensionTest() |
| 117 | + { |
| 118 | + ExtensionPackageReferenceWithActions body = new ExtensionPackageReferenceWithActions(); |
| 119 | + var jsonBody = JsonConvert.SerializeObject(body); |
| 120 | + var content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); |
| 121 | + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Put, "admin/host/extensions"); |
| 122 | + request.Headers.Add(AuthenticationLevelHandler.FunctionsKeyHeaderName, _fixture.MasterKey); |
| 123 | + request.Content = content; |
| 124 | + HttpResponseMessage response = await _fixture.Host.HttpClient.SendAsync(request); |
| 125 | + |
| 126 | + Assert.Equal(HttpStatusCode.Accepted, response.StatusCode); |
| 127 | + } |
| 128 | + |
100 | 129 | [Fact]
|
101 | 130 | public async Task ArmExtensionsResourceFilter_NonExtensionRoute_Succeeds()
|
102 | 131 | {
|
|
0 commit comments