我正在使用Maven with Java 11 和 Maven on IntelliJ IDEA。我正在尝试创建一个 JsonTset 类,如下所示:
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.JsonTest;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.io.IOException;
import java.nio.file.Paths;
@JsonTest
public class JacksonInjectExample {
private static final String filePath = "test.json";
private static final String JSON = String.format(String.valueOf(Paths.get(filePath)));
@Autowired
private JacksonTester<OHStepTrackingNotification> jacksonTester;
@Configuration
public static class TestConfiguration {...}
@BeforeClass
static public void setSystemProperties() throws IOException {...}
@Test
public void test() throws IOException {...}
}
Run Code Online (Sandbox Code Playgroud)
但构建在以下导入上失败:
import org.springframework.beans.factory.annotation.Autowired;
import …Run Code Online (Sandbox Code Playgroud) 我正在使用 reac-admin,并希望在编辑后将用户重定向到自定义路由。
<Edit {...props}>
<TabbedForm redirect={redirect(`/XXX/${props.id}/YYY`)} >
{/* fileds */}
</TabbedForm >
</Edit>
Run Code Online (Sandbox Code Playgroud)
在自定义路线中我有这条路线:
<Route exact path="/XXX/:id/YYY" render={(props) => <MyRoute {...props} />} />
Run Code Online (Sandbox Code Playgroud)
我的问题是如何像表演中那样传递道具?
为什么当重定向到 show : 时 redirect="show",传递的 props 与重定向到自定义路由时不同?
有一些丢失的道具,我需要它们,比如 id。
我应该做什么来解决我的问题?
谢谢你!