junit

    1熱度

    2回答

    我有以下類 在StackOverflow中有對此的回答,但它涉及列表throw checked Exceptions from mocks with Mockito。我喜歡研究這種情況。沒有得到我失蹤的地方。 public SimpleClass{ private SimpleClass(){} public void runMethod(request,String,Ma

    1熱度

    1回答

    我在Spring Boot中創建應用程序。我創建的服務,看起來是這樣: @Service public class MyService { @Value("${myprops.hostname}") private String host; public void callEndpoint() { String endpointUrl = this.

    1熱度

    1回答

    測試Eclipse RCP插件時,最好讓所有測試類和資源都存在於專用(測試)片段中。 這種方式可以訪問主機插件中的所有類,而不管這些包是否實際導出。 但是如果我有一個通用的測試基礎架構,那麼很多插件都會使用它? 我不能把它放到一個片段中,因爲我不能在其他地方的片段中重用類。

    0熱度

    2回答

    我使用Espresso進行Android儀器測試。由於使用了LinkedIn的TestButler(https://github.com/linkedin/test-butler)庫,我的一些測試必須在模擬器上運行。這個庫爲特定的測試運行切換wifi/gsm,這就是爲什麼這些測試必須在模擬器上運行。 我的問題是 - 我可以註釋任何特定的測試運行在模擬器上,而其他測試運行在真實的設備上嗎? 感謝

    1熱度

    1回答

    我想測試,我沒有被授權這樣做。 這裏我的代碼: /* imports */ @RunWith(SpringRunner.class) @SpringBootTest(classes = Application.class) @WebAppConfiguration public class AuthenticationTest { private UsernamePasswordAu

    0熱度

    1回答

    ScheduledExecutorService用於bean構造函數,它應該在spring啓動時運行。 @RestController public class TestController { ScheduledExecutorService service = Executors.newScheduledThreadPool(1); public TestControl

    1熱度

    1回答

    我正在做一個特殊的junit測試,參數是由用戶在應用程序的前端引入並在應用程序的後端接收的。我想生成使用該信息作爲參數的junit測試。 我看到一些指南(如mykong指南和教程點),但其中大多數使用靜態參數化,我想要一些動態的東西。我已經嘗試過使用junit註釋,做一組或將參數傳遞給junit類,使用mockito方法但沒有將其作爲動態過程工作 有人可以指向正確的方向嗎? 現在我有類似的東西 p

    0熱度

    1回答

    使用JUnit我已經使用JUnit class GroovyJunitTest { @Test void test() { println this.class.getClassLoader().toString() } } 一個簡單的Groovy測試類此打印出 [email protected] 這意味着Java類加載器使用。 我使用Intell

    0熱度

    1回答

    我有一個運行於@RunWith(Cucumber)的黃瓜測試。該測試使用來自其他課程的靜態字段。它看起來像: 黃瓜測試 @RunWith(Cucumber) @CucumberOptions( features = 'src/test/resources/features/cucumber-test.feature', glue = ['src/test/groovy'] )

    0熱度

    1回答

    我正在使用easymock和powermock編寫下面的Class B的isRegisteredUSer()的單元測試用例。如何模擬類A的getUserInformation()並返回一個模擬的UserAccessBean? class A{ private int userId; A(int userId){ this.userId = userId;