Skip to content

Commit 3c77e2b

Browse files
committed
chore(tests): Correct SecurityTest with new validator load order
1 parent 0d0b88e commit 3c77e2b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test-harness/tests/specs/unit/SecurityTest.cfc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ component extends="coldbox.system.testing.BaseInterceptorTest" interceptor="cbse
1818
.$( "getAppRootPath", expandPath( "/root" ) )
1919
.$( "getColdboxSettings", {
2020
"version": "6.0.0"
21-
}, false );
21+
}, false );
22+
23+
mockController
24+
.$( "getSetting" )
25+
.$args( "modules" )
26+
.$results( [] );
27+
2228
security = interceptor;
2329
security.setInvalidEventHandler( '' );
2430
settings = {
@@ -114,7 +120,8 @@ component extends="coldbox.system.testing.BaseInterceptorTest" interceptor="cbse
114120
.$args( settings.validator )
115121
.$results( wirebox.getInstance( settings.validator ) );
116122

117-
security.configure();
123+
security.afterAspectsLoad();
124+
118125
expect(
119126
security.getValidator(
120127
createMock( "coldbox.system.web.context.RequestContext" ).$( "getCurrentModule", "" )
@@ -135,7 +142,7 @@ component extends="coldbox.system.testing.BaseInterceptorTest" interceptor="cbse
135142
.$results( createStub() );
136143

137144
expect( function(){
138-
security.configure();
145+
security.afterAspectsLoad();
139146
} ).toThrow( "Security.ValidatorMethodException" );
140147
} );
141148

0 commit comments

Comments
 (0)