forked from lucee/Lucee
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LDEV-3947 http resource exists() stricter status code checks v3
https://luceeserver.atlassian.net/browse/LDEV-3947 needs https://luceeserver.atlassian.net/browse/LDEV-4861 and lucee#2371 for test to pass
- Loading branch information
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
component extends = "org.lucee.cfml.test.LuceeTestCase" labels="http" { | ||
|
||
// requires LDEV-4861 to support rest httpmethod="get,head" and on update provider | ||
// as the exists check does a HEAD request | ||
variables.endpoint = "https://update.lucee.org/rest/update/provider/echoGet?"; | ||
|
||
function run( testresults , testbox ) { | ||
describe( "testcase for LDEV-3947, http resource provider should error with non 20x status codes", function () { | ||
it( title="Check reading an http resource",body = function ( currentSpec ) { | ||
expect( fileRead("#variables.endpoint#") ).notToBeEmpty(); | ||
}); | ||
|
||
it( title="Check reading an http resource with 200 status code",body = function ( currentSpec ) { | ||
expect( fileRead("#variables.endpoint#&statusCode=200") ).notToBeEmpty(); | ||
}); | ||
|
||
it( title="Check reading an http resource with 401 status code",body = function ( currentSpec ) { | ||
expect(function(){ | ||
fileRead("#variables.endpoint#&statusCode=401"); | ||
}).toThrow(); | ||
}); | ||
|
||
it( title="Check reading an http resource with 403 status code",body = function ( currentSpec ) { | ||
expect(function(){ | ||
fileRead("#variables.endpoint#&statusCode=403"); | ||
}).toThrow(); | ||
}); | ||
|
||
it( title="Check reading an http resource with 404 status code",body = function ( currentSpec ) { | ||
expect(function(){ | ||
fileRead("#variables.endpoint#&statusCode=404"); | ||
}).toThrow(); | ||
}); | ||
|
||
it( title="Check reading an http resource with 500 status code",body = function ( currentSpec ) { | ||
expect(function(){ | ||
fileRead("#variables.endpoint#&statusCode=500"); | ||
}).toThrow(); | ||
}); | ||
|
||
it( title="Check reading an http resource with 503 status code",body = function ( currentSpec ) { | ||
expect(function(){ | ||
fileRead("#variables.endpoint#&statusCode=503"); | ||
}).toThrow(); | ||
}); | ||
|
||
}); | ||
} | ||
|
||
} |