List of usage examples for junit.runner Version id
public static String id()
From source file:org.restcomm.connect.interpreter.mediagroup.StopMediaGroupTest.java
private TestActorRef<Actor> createVoiceInterpreter(final ActorRef observer, final String... fsmStateBypass) { System.out.println("JUnit version is: " + Version.id()); DaoManager storage = Mockito.mock(DaoManager.class); UriUtils uriUtils = Mockito.mock(UriUtils.class); RestcommConnectServiceProvider.getInstance().setUriUtils(uriUtils); Mockito.when(uriUtils.resolve(Mockito.any(URI.class), Mockito.any(Sid.class))) .thenReturn(URI.create("http://127.0.0.1")); //dao/*from ww w .java2s .c o m*/ final CallDetailRecordsDao recordsDao = Mockito.mock(CallDetailRecordsDao.class); Mockito.when(recordsDao.getCallDetailRecord(Mockito.any(Sid.class))).thenReturn(null); IncomingPhoneNumbersDao incomingPhoneNumbersDao = Mockito.mock(IncomingPhoneNumbersDao.class); Mockito.when(storage.getCallDetailRecordsDao()).thenReturn(recordsDao); //actors final ActorRef downloader = new MockedActor("downloader") .add(DiskCacheRequest.class, new DiskCacheRequestProperty(playUri), new DiskCacheResponse(playUri)) .asRef(system); mockedCallManager = new MockedActor("callManager"); final ActorRef callManager = mockedCallManager.asRef(system); final VoiceInterpreterParams.Builder builder = new VoiceInterpreterParams.Builder(); builder.setConfiguration(configuration); builder.setStorage(storage); builder.setCallManager(callManager); builder.setAccount(new Sid("ACae6e420f425248d6a26948c17a9e2acf")); builder.setVersion("2012-04-24"); builder.setUrl(requestUri); builder.setMethod("GET"); builder.setAsImsUa(false); final Props props = new Props(new UntypedActorFactory() { private static final long serialVersionUID = 1L; @Override public Actor create() throws Exception { return new VoiceInterpreter(builder.build()) { @Override protected ActorRef downloader() { return observer; } @Override protected ActorRef cache(String path, String uri) { return downloader; } @Override public ActorRef getCache() { return downloader; } @Override protected boolean is(State state) { //bypass fsm state so the test logic can be reduced String id = state.getId(); for (int i = 0; i < fsmStateBypass.length; i++) { if (id.equals(fsmStateBypass[i])) { return true; } } //if there is no state to bypass, stick to formal verification return super.is(state); } }; } }); return TestActorRef.create(system, props, "VoiceInterpreter" + System.currentTimeMillis()); }