Skip to content
Snippets Groups Projects
Commit 41bc2a96 authored by Yurii Ruban [EPAM / GCP]'s avatar Yurii Ruban [EPAM / GCP]
Browse files

Updated surefire plugin version

parent c634506a
No related branches found
No related tags found
1 merge request!589JDK 17 migration (GONRG-7477)
Pipeline #201030 failed
......@@ -20,7 +20,6 @@
<netty.version>4.1.70.Final</netty.version>
<spring-webmvc.version>5.3.22</spring-webmvc.version>
<os-core-common.version>0.22.0-rc4</os-core-common.version>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
</properties>
<dependencyManagement>
......@@ -263,10 +262,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>2.21.0</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<threadCount>1</threadCount>
<argLine>--add-opens java.base/java.lang=ALL_UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
......
......@@ -159,7 +159,6 @@ public class IndexerMappingServiceTest {
doReturn(mappingResponse).when(this.indicesClient).putMapping(any(PutMappingRequest.class), any(RequestOptions.class));
IndexerMappingServiceImpl indexerMappingServiceLocal = spy(new IndexerMappingServiceImpl());
doReturn(false).when(indexerMappingServiceLocal).isTypeExist(any(), any(), any());
String mapping = this.sut.createMapping(this.restHighLevelClient, this.indexSchema, this.index, true);
assertEquals(this.validMapping, mapping);
} catch (Exception e) {
......
......@@ -59,6 +59,7 @@ import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mockStatic;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
......@@ -82,8 +83,7 @@ public class IndexerServiceImplTest {
@Mock
private StorageIndexerPayloadMapper storageIndexerPayloadMapper;
@InjectMocks
@Spy
private JobStatus jobStatus = new JobStatus();
private JobStatus jobStatus;
@Mock
private AuditLogger auditLogger;
@Mock
......@@ -127,6 +127,9 @@ public class IndexerServiceImplTest {
@Before
public void setup() throws IOException {
jobStatus = spy(new JobStatus());
mockedAcls = mockStatic(Acl.class);
initMocks(this);
when(augmenterSetting.isEnabled()).thenReturn(true);
}
......@@ -247,13 +250,10 @@ public class IndexerServiceImplTest {
}
private void prepareTestDataAndEnv(String pubsubMsg) throws IOException, URISyntaxException {
mockedAcls = mockStatic(Acl.class);
// setup headers
this.dpsHeaders = new DpsHeaders();
this.dpsHeaders.put(DpsHeaders.AUTHORIZATION, "testAuth");
when(this.requestInfo.getHeaders()).thenReturn(dpsHeaders);
when(this.requestInfo.getHeadersMapWithDwdAuthZ()).thenReturn(dpsHeaders.getHeaders());
// setup message
Type listType = new TypeToken<List<RecordInfo>>() {}.getType();
......
......@@ -77,10 +77,8 @@ public class ElasticClientHandlerTest {
@Test
public void createRestClient_when_deployment_env_is_saas() {
ClusterSettings clusterSettings = new ClusterSettings("H", 1, "U:P");
when(configurationProperties.getDeploymentEnvironment()).thenReturn(DeploymentEnvironment.CLOUD);
when(elasticSettingService.getElasticClusterInformation()).thenReturn(clusterSettings);
when(RestClient.builder(new HttpHost("H", 1, "https"))).thenAnswer(invocation -> builder);
when(builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(5000).setSocketTimeout(60000))).thenReturn(builder);
when(builder.build()).thenReturn(restClient);
RestHighLevelClient returned = this.elasticClientHandler.createRestClient();
......@@ -91,7 +89,6 @@ public class ElasticClientHandlerTest {
@Test(expected = AppException.class)
public void failed_createRestClientForSaaS_when_restclient_is_null() {
ClusterSettings clusterSettings = new ClusterSettings("H", 1, "U:P");
when(configurationProperties.getDeploymentEnvironment()).thenReturn(DeploymentEnvironment.CLOUD);
when(elasticSettingService.getElasticClusterInformation()).thenReturn(clusterSettings);
when(RestClient.builder(new HttpHost("H", 1, "https"))).thenAnswer(invocation -> builder);
when(builder.build()).thenReturn(null);
......@@ -101,7 +98,6 @@ public class ElasticClientHandlerTest {
@Test(expected = AppException.class)
public void failed_createRestClientForSaaS_when_getcluster_info_throws_exception() {
when(configurationProperties.getDeploymentEnvironment()).thenReturn(DeploymentEnvironment.CLOUD);
when(elasticSettingService.getElasticClusterInformation()).thenThrow(new AppException(1, "", ""));
when(RestClient.builder(new HttpHost("H", 1, "https"))).thenAnswer(invocation -> builder);
......
......@@ -35,7 +35,6 @@
<jackson-databind.version>2.13.2.2</jackson-databind.version>
<jackson.version>2.13.2</jackson.version>
<spring-webmvc.version>5.3.22</spring-webmvc.version>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
</properties>
<dependencyManagement>
......@@ -201,6 +200,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<argLine>
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
......
......@@ -443,10 +443,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>2.21.0</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<threadCount>1</threadCount>
<argLine>--add-opens java.base/java.lang=ALL_UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
......
......@@ -194,10 +194,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>2.21.0</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<threadCount>1</threadCount>
<argLine>
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
......
......@@ -80,8 +80,6 @@ public class ReindexServiceTest {
httpHeaders.put(DpsHeaders.AUTHORIZATION, "testAuth");
httpHeaders.put(DpsHeaders.CORRELATION_ID, correlationId);
DpsHeaders standardHeaders = DpsHeaders.createFromMap(httpHeaders);
when(requestInfo.getHeaders()).thenReturn(standardHeaders);
when(requestInfo.getHeadersMapWithDwdAuthZ()).thenReturn(httpHeaders);
when(requestInfo.getHeadersWithDwdAuthZ()).thenReturn(standardHeaders);
}
......
......@@ -224,9 +224,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<threadCount>1</threadCount>
<argLine>--add-opens java.base/java.lang=ALL_UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment