我是IntelliJ的新手
在Eclipse之前,使用spring引导插件或IDE STS,在解除项目时,我可以知道哪个端口正在使用每个项目.
此时我正在改用IntelliJ,我在开始时已经提出了2个项目,我知道1个用于端口8080,另一个用于8082.
但是我目前有4个项目.如果我不知道哪个项目使用哪个端口,有没有办法快速查看此信息?
我附上了两个项目的图像,但我看不出哪个端口正在使用哪个端口.
我正在处理的项目遇到很大的问题,我想知道您是否可以帮助我。
我必须使用Mockito执行一些单元测试,所有方法都很棒!直到您以相同的方法有2次对http的调用,而我不知道如何区分它们。
我在测试中有以下内容:
// -----------------------------------------------------------services
@InjectMocks
private SandboxAccountService accountService;
@InjectMocks
private SandboxBalancesService balancesService;
@InjectMocks
private SandboxMovementsService movementService;
@Mock
private RestTemplate restTemplate;
@Mock
private RestTemplate restTemplateMovimientos;
@Test
public void test_movementsServiceImpl() throws Exception {
//LLAMADA A LISTA DE Account
List<Account> accountList = new ArrayList<>();
accountList.add(account);
accountList.add(account2);
ResponseEntity<List<Account>> list = new ResponseEntity<List<Account>>(accountList, HttpStatus.OK);
// FIRST HTTP CALL
when(restTemplate.exchange(anyString() , any(HttpMethod.class),
any(HttpEntity.class), any(ParameterizedTypeReference.class))).thenReturn(list);
//LLAMADA A LISTA DE MOVIMIENTOS
listMovent.add(movement);
listMovent.add(movementDos);
ResponseEntity<List<Movement>> listaMovi = new ResponseEntity<List<Movement>>(listMovent, HttpStatus.OK);
// Second HTTP CALL
when(restTemplateMovimientos.exchange(anyString() , any(HttpMethod.class),
any(HttpEntity.class), …Run Code Online (Sandbox Code Playgroud) 我只有 24 小时使用 Go,所以我对此非常陌生。
我试图获得完整的测试转换,但是当我运行时
go test -cover new-project/anto/... .
Run Code Online (Sandbox Code Playgroud)
在new-project/anto/mon中,它显示我有 51.8% 的覆盖率,但实际上我有更多的覆盖率,因为在new-project/anto/integration中测试了一些测试,其中我有一个导入新的测试文件-project/anto/mon用于测试。
问题是,正如我所读,Golang 仅在它们位于同一文件夹中时才进行测试,但拥有单独的文件无法正确检测到它。
我想知道是否有办法获得全面覆盖。
go test -cover new-project/anto/... .
? new-project/anto/ [no test files]
ok new-project/anto/conf 6.060s coverage: 73.1% of statements
ok new-project/anto/integration 43.309s coverage: [no statements]
? new-project/anto/integration/conf [no test files]
? new-project/anto/integration/mocks [no test files]
? new-project/anto/integration/utils [no test files]
ok new-project/anto/logs 0.024s coverage: 70.5% of statements
ok new-project/anto/metric 0.012s coverage: 59.0% of statements
ok new-project/anto/mon 1.612s coverage: 51.8% of statements …Run Code Online (Sandbox Code Playgroud)