Skip to content

Increase code coverage #51

Description

@aesteve

See jacocoTestReport for more infos :

Errors

NotFound, Validation, ... And also RuntimeException marshalling in

  • json
  • xml
  • plainText
  • http status (context.fail(400) in XML)

DateUtils

  • unit tests (with TimeZone)

PaginationContext

Wrong configuration

  • the right error is thrown at startup (or use Objects.requireNonNull)

User-defined stuff :

  • register custom param adapter and test it's called / used
  • his own failure handler is called
  • his own auth method is called
  • register adapter
  • registerAnnotatedParamInjector
  • his own locale resolver is called
  • add paramHandler

Test NubesServer

Services

  • wrong method parameters => error should be thrown at bootstrap, not during runtime
  • periodic task method with parameters

Param injection

  • no cookie set => 400
  • get Cookie object, not cookie value
  • RequestBody : throw exceptions instead of returning null ? + test JsonObject + test JsonArray
  • Params : test 400 if wrong params / Param (same) / Header (same)
  • Headers : not a multimap => 500
  • LocalMap : by param name (no annotation value)
  • EventBus
  • HttpServerRequest
  • User locale
  • ResourceBundle

Http methods

  • CONNECT
  • TRACE
  • HEAD

Processors

  • NoopAfterAllProcessor is not used, use it in a custom-defined Processor (see above)
  • CheckAuthority with no user set => 401
  • CheckToken (auth) with wrong formated auth data => 400
  • RoutingContext failed before method is invoked (in filter, ...)

Integ. testing on AsyncUtils

  • nextOrFail(context)
  • onFailureOnly
  • onSuccessOnly
  • failOr(context)

Auth

  • JWT
  • redirect with no redirectURL => breaks at bootstrap not at runtime

EventBusBridgeFactory / SocketFactory

  • path with /path/* but also with /path and /path/
  • Vertx injected as method param
  • controller can't be instanciated => error at startup, not at runtime (same for standard controllers)

RouteFactory

  • filters from superclass are executed

VerticleFactory

  • @InheritsConfig => the config is inherited properly

Injection

  • Fields from superclass are injected (or filters from superclass)

TemplateEngineManager

  • no template handler found => should throw an exception and test it

Current coverage : 1918 / 7957 76 %
Current coverage : 1 427 of 7 959 82 %
Current coverage : 1 124 of 7 998 86 %

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions