Skip to content

Instantiate ExpectedLogging from package name #8

@bjansen

Description

@bjansen

Hi,

Before opening PRs I'd like to discuss a possible improvement in your library: instantiating an ExpectedLogging from a package name in addition to a class. The idea behind this is that (in my case) some of the generated logs are business requirements, that's why I'm asserting them in unit tests. It doesn't really matter which class outputs the log, as long as the log is present then my business requirement is met. Also, refactorings might move a logged message from one class to another, and in my opinion that shouldn't affect tests.

So what I'm proposing is something like this:

    public static ExpectedLogging forPackage(String packageName) {
        return new ExpectedLogging(packageName);
    }

Or maybe even a more general:

    public static ExpectedLogging forLogger(String loggerName) {
        return new ExpectedLogging(loggerName);
    }

Or perhaps just making the existing constructor public?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions