Alba is a small library to facilitate easier integration testing of web services built on the ASP.Net Core platform. It’s more or less a wrapper around the ASP.Net TestServer, but does a lot to make testing much easier than writing low level code against TestServer. You would use Alba from within xUnit.Net or NUnit testing projects.
I outlined a proposal for Alba V5 a couple weeks back, and today I was able to publish the new Nuget. The big changes are:
- The Alba documentation website was rebuilt with Vitepress and refreshed to reflect V5 changes
- The old
SystemUnderTesttype was renamed
AlbaHostto make the terminology more inline with ASP.Net Core
- The Json serialization is done through the configured input and output formatters within your ASP.Net Core application — meaning that Alba works just fine regardless of whether your application uses Newtonsoft.Json or System.Text.Json for its Json serialization.
- There is a new extension model that was added specifically to support testing web services that are authenticated with JWT bearer tokens.
For security, you can opt into:
- Stub out all of the authentication and use hard-coded claims
- Add a valid JWT to every request with user-defined claims
- Let Alba deal with live OIDC integration by handling the JWT integration with your OIDC identity server