Skip to content

Commit

Permalink
Introduce new interface NamedExecutable
Browse files Browse the repository at this point in the history
Introduce new interface NamedExecutable that associates a name, a
payload and an Executable.

This was introduced to help colocate test's diplayName, payload, and
testExecutor in one place. Concrete usage of this interface is in the
next commit.

Issue: junit-team#3261
  • Loading branch information
mobounya committed Jan 19, 2024
1 parent 2a291a1 commit 07730c4
Showing 1 changed file with 32 additions and 0 deletions.
@@ -0,0 +1,32 @@
/*
* Copyright 2015-2024 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* https://www.eclipse.org/legal/epl-v20.html
*/

package org.junit.jupiter.api;

import static org.apiguardian.api.API.Status.EXPERIMENTAL;

import org.apiguardian.api.API;
import org.junit.jupiter.api.function.Executable;

/**
* {@code NamedExecutable} is a container that associates a name, a payload and an
* {@link Executable}
*
* @param <T> the type of the payload
*
* @since 5.11
*/
@API(status = EXPERIMENTAL, since = "5.11")
public interface NamedExecutable<T extends NamedExecutable<T>> extends Named<T>, Executable {
@Override
default String getName() {
return toString();
}
}

0 comments on commit 07730c4

Please sign in to comment.