Skip to content

Ec2NetworkTests don't assert much #35141

@nik9000

Description

@nik9000

The Ec2NetworkTests sneakily don't assert much of anything. They look like:

        NetworkService networkService = new NetworkService(Collections.singletonList(new Ec2NameResolver(nodeSettings)));
        // TODO we need to replace that with a mock. For now we check the URL we are supposed to reach.
        try {
            networkService.resolveBindHostAddresses(null);
            // ------- See how there isn't a fail here?!
        } catch (IOException e) {
            assertThat(e.getMessage(), containsString("local-ipv4"));
        }

It looks like they always just fall out of the catch statement, asserting nothing in particular. This seem bad.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions