小编Ant*_*ode的帖子

GitKraken 存储库用户和密码被错误记住

错误地,当我想克隆存储库时,我输入了错误的用户名和密码,然后单击了“记住我”按钮,所以现在我无法更改密钥,因为每当我重做时,克隆都会保存错误的数据。

我在哪里可以删除这些数据?

在此处输入图片说明

git gitkraken

6
推荐指数
1
解决办法
1422
查看次数

在intellij上查看所有spring boot项目的端口

我是IntelliJ的新手

在Eclipse之前,使用spring引导插件或IDE STS,在解除项目时,我可以知道哪个端口正在使用每个项目.

此时我正在改用IntelliJ,我在开始时已经提出了2个项目,我知道1个用于端口8080,另一个用于8082.

但是我目前有4个项目.如果我不知道哪个项目使用哪个端口,有没有办法快速查看此信息?

我附上了两个项目的图像,但我看不出哪个端口正在使用哪个端口.

https://imgur.com/a/RBC3KZH

java intellij-idea

5
推荐指数
1
解决办法
362
查看次数

Spring Boot测试中的Mockito和多个HTTP

我正在处理的项目遇到很大的问题,我想知道您是否可以帮助我。

我必须使用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)

java testing junit mockito resttemplate

1
推荐指数
1
解决办法
556
查看次数

如何在golang的所有包中获得完整的覆盖

我只有 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)

testing integration-testing go

1
推荐指数
1
解决办法
6624
查看次数