diff --git a/lib/controllers/route_utils.dart b/lib/controllers/route_utils.dart index 4342140..661b6dd 100644 --- a/lib/controllers/route_utils.dart +++ b/lib/controllers/route_utils.dart @@ -76,45 +76,45 @@ class Path { } /// Annotation for creating GET route bindings -final GetAnnotation = reflectClass(Get); +final getAnnotation = reflectClass(Get); /// Annotation for creating PUT route bindings -final PutAnnotation = reflectClass(Put); +final putAnnotation = reflectClass(Put); /// Annotation for creating POST route bindings -final PostAnnotation = reflectClass(Post); +final postAnnotation = reflectClass(Post); /// Annotation for creating PATCH route bindings -final PatchAnnotation = reflectClass(Patch); +final patchAnnotation = reflectClass(Patch); /// Annotation for creating DELETE route bindings -final DeleteAnnotation = reflectClass(Delete); +final deleteAnnotation = reflectClass(Delete); /// Annotation for creating TRACE route bindings -final TraceAnnotation = reflectClass(Trace); +final traceAnnotation = reflectClass(Trace); /// Annotation for creating HEAD route bindings -final HeadAnnotation = reflectClass(Head); +final headAnnotation = reflectClass(Head); /// Annotation for creating OPTIONS route bindings -final OptionsAnnotation = reflectClass(Options); +final optionsAnnotation = reflectClass(Options); /// Annotation for creating CONNECT route bindings -final ConnectAnnotation = reflectClass(Connect); +final connectAnnotation = reflectClass(Connect); /// Annotation for creating a root path for a controller -final PathAnnotation = reflectClass(Path); +final pathAnnotation = reflectClass(Path); final _allHttpVerbs = [ - GetAnnotation, - PutAnnotation, - PostAnnotation, - PatchAnnotation, - DeleteAnnotation, - TraceAnnotation, - HeadAnnotation, - OptionsAnnotation, - ConnectAnnotation + getAnnotation, + putAnnotation, + postAnnotation, + patchAnnotation, + deleteAnnotation, + traceAnnotation, + headAnnotation, + optionsAnnotation, + connectAnnotation ]; class PathControllerReflectiveBinding extends RouteBindingDecorator { @@ -131,7 +131,7 @@ List getPaths(ClassMirror mirror) { // If the class has a @Path specified, we'll set it as the base mirror.metadata.forEach((metadata) { - if (metadata.type == PathAnnotation) { + if (metadata.type == pathAnnotation) { basePath = metadata.reflectee as Path; } }); diff --git a/test/router/middleware_routing_test.dart b/test/router/middleware_routing_test.dart index c2d5838..289b78e 100644 --- a/test/router/middleware_routing_test.dart +++ b/test/router/middleware_routing_test.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'dart:io'; import 'package:steward/controllers/route_utils.dart'; diff --git a/test/router/router_test.dart b/test/router/router_test.dart index da8815e..e391349 100644 --- a/test/router/router_test.dart +++ b/test/router/router_test.dart @@ -12,7 +12,7 @@ class UserService { class ComplexResponseBody { String content = 'Hello'; - toJson() => {'content': content}; + Map toJson() => {'content': content}; } @Path('/cont') @@ -226,15 +226,15 @@ void main() { final client = HttpClient(); final request = await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice'); - final response = await request.close(); + await request.close(); expect(counter, equals(1)); final request2 = await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice/'); - final response2 = await request2.close(); + await request2.close(); expect(counter, equals(2)); final request3 = await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice/hat'); - final response3 = await request3.close(); + await request3.close(); expect(counter, equals(2)); }); @@ -248,11 +248,11 @@ void main() { final client = HttpClient(); final request = await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice'); - final response = await request.close(); + await request.close(); expect(counter, equals(1)); final request2 = await client.get(InternetAddress.loopbackIPv4.host, 4040, '/NICE'); - final response2 = await request2.close(); + await request2.close(); expect(counter, equals(2)); }); }