Java プロジェクトで記述されたコードを使用する Java プロジェクトとテスト プロジェクトがあります。Java コードをスプリング対応のアノテーションに変換し、テスト プロジェクトで自動配線されたスプリング Bean としてロードする必要があります。これを案内してください。
私のJavaプロジェクトのJavaコードの例を以下に示します
package javaproject;
public class JavaCodeImpl {
    public boolean clearData() {
        //some code written to clear the data
    }
    public String getVariable() {
         //some code written to get the variable value
    }
    public String getExpandedVariable() {
         //some code written to get the expanded variable value
    }
}
以下は私のテストプロジェクトのコードです
package testProject;
import javaProject;
import org.junit;
public class testCodeTest {
@Before
public void setup() {
    JavaCodeImpl javaObj = new JavaCodeImpl();
}
@Test
public void testMethod() {
    Assert.assertEquals(true, javaObj.clearData());
    Assert.assertEquals("variable", javaObj.getVariable());
    Assert.assertEquals("expandedVariable", javaObj.getExpandedVariable());
}
}