Skip to content

Commit

Permalink
Merge pull request #158 from th2-net/ts-1168
Browse files Browse the repository at this point in the history
[TS-1168] Migrate to sf 3.3. Update dependencies with vulnerabilities
  • Loading branch information
OptimumCode authored Oct 10, 2022
2 parents f00414e + b9613c6 commit 53830ac
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ spec:
### 3.11.0

+ Added `maxMessageFlushTime` option
+ Dependencies with vulnerabilities were updated:
+ Sailfish updated from `3.2.1741` to `3.3.13`

### 3.10.2

Expand Down
44 changes: 31 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id 'com.palantir.docker' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version '1.5.30'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id 'application'
}

ext {
sharedDir = file("${project.rootDir}/shared")
sailfishVersion = '3.2.1741'
sailfishVersion = '3.3.13'
}

group = 'com.exactpro.th2'
Expand All @@ -17,19 +17,35 @@ repositories {
name 'MavenLocal'
url sharedDir
}

mavenCentral()

// ignoreGradleMetadataRedirection is used for sonatype because
// Sailfish dependencies have constrains that interfere with our BOM
// so we exclude Gradle metadata for this repositories

maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}

maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}
mavenCentral {
metadataSources {
mavenPom()
artifact()
}
}

mavenLocal()

configurations.all {
Expand Down Expand Up @@ -64,12 +80,11 @@ compileTestKotlin {
}

dependencies {
api platform('com.exactpro.th2:bom:3.0.0')
api platform('com.exactpro.th2:bom:4.0.1')

implementation 'com.exactpro.th2:common:3.33.0'
implementation "com.exactpro.th2:sailfish-utils:3.8.0"
implementation 'com.exactpro.th2:common:3.42.0-dev-3174619150-SNAPSHOT'
implementation 'com.exactpro.th2:sailfish-utils:3.13.0-dev-3204703314-SNAPSHOT'

implementation "org.slf4j:slf4j-log4j12"
implementation "org.slf4j:slf4j-api"

implementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.0.4'
Expand All @@ -78,21 +93,24 @@ dependencies {

implementation("com.exactpro.sf:sailfish-core:${sailfishVersion}")

testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
testImplementation('org.apache.logging.log4j:log4j-slf4j-impl') {
because('logging in testing')
}
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
}

test {
useJUnitPlatform()
}

application {
mainClassName 'com.exactpro.th2.conn.MicroserviceMain'
mainClass.set('com.exactpro.th2.conn.MicroserviceMain')
}

applicationName = 'service'

distTar {
archiveName "${applicationName}.tar"
archiveFileName.set("${applicationName}.tar")
}

dockerPrepare {
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/com/exactpro/th2/conn/TestEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ public class TestEvent {
private static String parentId;

@BeforeAll
public static void initMessages() throws IOException {
static void initMessages() throws IOException {
serviceProxy = mock(IServiceProxy.class);
@SuppressWarnings("unchecked")
MessageRouter<RawMessageBatch> router = mock(MessageRouter.class);

doAnswer(invocation -> {
Expand All @@ -72,7 +73,7 @@ public static void initMessages() throws IOException {
EventType eventType = eventHolder.getType();

eventDispatcher.store(eventHolder.getEvent(),
parentIds.get(eventType) != null ? parentIds.get(eventType) : rootID);
parentIds.get(eventType) == null ? rootID : parentIds.get(eventType));
return null;
}).when(eventDispatcher).store(any());

Expand All @@ -88,7 +89,7 @@ public static void initMessages() throws IOException {
}

@AfterEach
public void clear() {
void clear() {
event = null;
parentId = null;
}
Expand Down Expand Up @@ -147,7 +148,7 @@ public void sentMessageWithoutParentEventIDTest() throws Exception {
}

@AfterAll
private static void close() throws IOException {
static void close() throws IOException {
messageSender.stop();
}
}

0 comments on commit 53830ac

Please sign in to comment.