public class App {
public static void main(String[] args) {
List<Integer> list = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9));
int[] arr = new int[list.size()];
for (int i = 0; i < list.size(); i++) {
arr[i] = list.get(i);
}
System.out.println(Arrays.toString(arr)); // [1, 2, 3, 4, 5, 6, 7, 8, 9]
}
}
List<Integer> list = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9));
Integer[] arr = list.toArray(new Integer[0]);
const mapStore = createStore(
rootReducer,
compose(
applyMiddleware(thunk),
window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f,
)
);
@RunWith(SpringRunner.class)
@SpringBootTest(classes={SpringBootApp.class})
public class TelegramTest {
@Autowired
private TelegramBot telegramBot;
@Test
public void test1(){
telegramBot.sendMessage(null,null);
}
}
@RunWith(SpringRunner.class)
@SpringBootTest(classes={SpringBootApp.class})
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import static org.mockito.Mockito.*;
@Configuration
public class MockConfiguration {
@Primary
@Bean
public ActivitiGetTimerValueDelegateService activitiGetTimerValueDelegateService() {
ActivitiGetTimerValueDelegateService service = mock(ActivitiGetTimerValueDelegateService.class);
when(service.getTimerValue(any(), any(), any())).thenReturn(42);
return service;
}
}