1
1
package com .devonfw .tools .ide .integrationtest ;
2
2
3
- import com .devonfw .tools .ide .json .mapping .JsonMapping ;
4
- import com .devonfw .tools .ide .url .model .file .json .StatusJson ;
5
- import com .devonfw .tools .ide .url .model .folder .UrlRepository ;
6
- import com .fasterxml .jackson .databind .ObjectMapper ;
7
- import com .github .tomakehurst .wiremock .junit5 .WireMockTest ;
8
- import org .assertj .core .api .Assertions ;
9
- import org .junit .jupiter .api .Test ;
10
- import org .junit .jupiter .api .io .TempDir ;
3
+ import static com .github .tomakehurst .wiremock .client .WireMock .*;
11
4
12
5
import java .io .BufferedReader ;
13
6
import java .io .IOException ;
14
7
import java .nio .file .Files ;
15
8
import java .nio .file .Path ;
16
9
import java .nio .file .Paths ;
17
10
18
- import static com .github .tomakehurst .wiremock .client .WireMock .*;
19
- import static com .github .tomakehurst .wiremock .client .WireMock .aResponse ;
11
+ import org .assertj .core .api .Assertions ;
12
+ import org .junit .jupiter .api .Test ;
13
+ import org .junit .jupiter .api .io .TempDir ;
14
+
15
+ import com .devonfw .tools .ide .json .mapping .JsonMapping ;
16
+ import com .devonfw .tools .ide .url .model .file .json .StatusJson ;
17
+ import com .devonfw .tools .ide .url .model .folder .UrlRepository ;
18
+ import com .fasterxml .jackson .databind .ObjectMapper ;
19
+ import com .github .tomakehurst .wiremock .junit5 .WireMockTest ;
20
20
21
21
@ WireMockTest (httpPort = 8080 )
22
22
public class UrlUpdaterTest extends Assertions {
@@ -68,10 +68,11 @@ public void testUrlUpdaterMissingOsGetsAddedAutomatically(@TempDir Path tempDir)
68
68
assertThat (versionsPath .resolve ("linux_x64.urls.sha256" )).exists ();
69
69
70
70
}
71
+
71
72
@ Test
72
73
public void testUrlUpdaterIsNotUpdatingWhenStatusManualIsTrue (@ TempDir Path tempDir ) throws IOException {
73
74
74
- // arrange
75
+ // arrange
75
76
stubFor (any (urlMatching ("/os/.*" )).willReturn (aResponse ().withStatus (200 ).withBody ("aBody" )));
76
77
77
78
UrlRepository urlRepository = UrlRepository .load (tempDir );
@@ -81,11 +82,12 @@ public void testUrlUpdaterIsNotUpdatingWhenStatusManualIsTrue(@TempDir Path temp
81
82
updater .update (urlRepository );
82
83
Path versionsPath = Paths .get (testdataRoot ).resolve ("mocked" ).resolve ("mocked" ).resolve ("1.0" );
83
84
84
- //assert
85
+ // assert
85
86
assertThat (versionsPath .resolve ("windows_x64.urls" )).doesNotExist ();
86
87
assertThat (versionsPath .resolve ("windows_x64.urls.sha256" )).doesNotExist ();
87
88
88
89
}
90
+
89
91
private static StatusJson getStatusJson (Path versionsPath ) {
90
92
91
93
ObjectMapper MAPPER = JsonMapping .create ();
0 commit comments