@@ -407,8 +407,6 @@
Loading
407 407
408 408
    public static MockitoAssertionError neverWantedButInvoked(
409 409
            DescribedInvocation wanted, List<Invocation> invocations) {
410 -
        Map<Location, Object[]> locationArgs = new HashMap<>();
411 -
        invocations.forEach(inv -> locationArgs.put(inv.getLocation(), inv.getArguments()));
412 410
413 411
        return new NeverWantedButInvoked(
414 412
                join(
@@ -416,7 +414,7 @@
Loading
416 414
                        "Never wanted here:",
417 415
                        new LocationImpl(),
418 416
                        "But invoked here:",
419 -
                        createAllLocationsArgsMessage(locationArgs)));
417 +
                        createAllLocationsArgsMessage(invocations)));
420 418
    }
421 419
422 420
    public static MockitoAssertionError tooManyActualInvocationsInOrder(
@@ -440,21 +438,18 @@
Loading
440 438
        return sb.toString();
441 439
    }
442 440
443 -
    private static String createAllLocationsArgsMessage(Map<Location, Object[]> locationArgs) {
444 -
        if (locationArgs == null || locationArgs.isEmpty()) {
445 -
            return "";
446 -
        }
441 +
    private static String createAllLocationsArgsMessage(List<Invocation> invocations) {
447 442
        StringBuilder sb = new StringBuilder();
448 -
        locationArgs.forEach(
449 -
                (location, args) -> {
450 -
                    if (location == null) {
451 -
                        return;
452 -
                    }
453 -
                    sb.append(location)
454 -
                            .append(" with next arguments: ")
455 -
                            .append(Arrays.toString(args))
456 -
                            .append("\n");
457 -
                });
443 +
        for (Invocation invocation : invocations) {
444 +
            Location location = invocation.getLocation();
445 +
            if (location == null) {
446 +
                continue;
447 +
            }
448 +
            sb.append(location)
449 +
                    .append(" with arguments: ")
450 +
                    .append(Arrays.toString(invocation.getArguments()))
451 +
                    .append("\n");
452 +
        }
458 453
        return sb.toString();
459 454
    }
460 455
Files Complexity Coverage
src/main/java/org/mockito 85.51% 84.84%
subprojects 79.06% 84.61%
Project Totals (326 files) 85.42% 84.83%
Notifications are pending CI completion. Waiting for GitHub's status webhook to queue notifications. Push notifications now.
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading