Skip to content

Commit

Permalink
"invokeMethod" to "sequence.actions.invokeMethod"
Browse files Browse the repository at this point in the history
  • Loading branch information
bajtos committed Jul 19, 2017
1 parent 9df646b commit 1ed51ca
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/authentication/test/acceptance/basic-auth.ts
Expand Up @@ -127,7 +127,7 @@ describe('Basic Authentication', () => {
constructor(
@inject('sequence.actions.findRoute') protected findRoute: FindRoute,
@inject('getFromContext') protected getFromContext: GetFromContext,
@inject('invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.send') protected send: Send,
@inject('sequence.actions.reject') protected reject: Reject,
@inject('bindElement') protected bindElement: BindElement,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/application.ts
Expand Up @@ -350,7 +350,7 @@ export class Application extends Context {
// in order for our DI/IoC framework to inject constructor arguments
constructor(
@inject('sequence.actions.findRoute') protected findRoute: FindRoute,
@inject('invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.send') public send: Send,
@inject('sequence.actions.reject') public reject: Reject,
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/http-handler.ts
Expand Up @@ -99,6 +99,6 @@ export class HttpHandler {
const invoke: InvokeMethod = async (route, args) => {
return await route.invokeHandler(context, args);
};
context.bind('invokeMethod').to(invoke);
context.bind('sequence.actions.invokeMethod').to(invoke);
}
}
2 changes: 1 addition & 1 deletion packages/core/src/sequence.ts
Expand Up @@ -71,7 +71,7 @@ export class DefaultSequence implements SequenceHandler {
*/
constructor(
@inject('sequence.actions.findRoute') protected findRoute: FindRoute,
@inject('invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.send') public send: Send,
@inject('sequence.actions.reject') public reject: Reject,
) {}
Expand Down
Expand Up @@ -62,7 +62,7 @@ describe('Sequence', () => {
class MySequence {
constructor(
@inject('sequence.actions.findRoute') protected findRoute: FindRoute,
@inject('invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.invokeMethod') protected invoke: InvokeMethod,
@inject('sequence.actions.send') protected send: Send,
) {}

Expand Down
8 changes: 6 additions & 2 deletions packages/core/test/unit/http-handler.ts
Expand Up @@ -51,7 +51,9 @@ describe('HttpHandler', () => {

requestContext.bind('controllers.test-controller')
.toClass(HelloController);
const fn: InvokeMethod = await requestContext.get('invokeMethod');
const fn: InvokeMethod = await requestContext.get(
'sequence.actions.invokeMethod',
);
const spec = anOperationSpec()
.withStringResponse(200)
.withOperationName('hello')
Expand All @@ -62,7 +64,9 @@ describe('HttpHandler', () => {
});

it('invokes a route handler', async () => {
const fn: InvokeMethod = await requestContext.get('invokeMethod');
const fn: InvokeMethod = await requestContext.get(
'sequence.actions.invokeMethod',
);
const spec = anOperationSpec().withStringResponse(200).build();
function hello() { return 'hello'; }
const route = new Route('get', '/', spec, hello);
Expand Down

0 comments on commit 1ed51ca

Please sign in to comment.