Skip to content

Commit

Permalink
Fix tests and update to release dependency
Browse files Browse the repository at this point in the history
* Align -mock module with kubernetes-client. Since it pulls junit5, the
  vintage module is required to keep running junit 4 tests
* Fluent api doesn't initialize empty structure anymore
  • Loading branch information
Vlatombe committed Jun 23, 2021
1 parent bd9b93e commit e0074cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
18 changes: 17 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.222.4</jenkins.version>
<java.level>8</java.level>
<junit5.version>5.7.2</junit5.version>
</properties>

<scm>
Expand Down Expand Up @@ -242,7 +243,7 @@
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-server-mock</artifactId>
<version>4.6.0</version>
<version>5.4.1</version>
<scope>test</scope>
<exclusions>
<!-- fails maven enforcer because kubernetes-client has a different version
Expand Down Expand Up @@ -294,4 +295,19 @@
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit5.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,8 @@ public static <T> T requireNonNull(@Nullable T obj, String exceptionMessage, @Nu
@SuppressFBWarnings(value= {"ES_COMPARING_PARAMETER_STRING_WITH_EQ"}, justification="the string will be the same string if not mapped")
public static String getNonNullSecretData(Secret s, String key, String exceptionMessage) throws CredentialsConvertionException {
String mappedKey = getKeyName(s, key);
if (mappedKey == key) { // use String == as getKeyName(key) will return key if no custom mapping is defined)
return requireNonNull(s.getData().get(key), exceptionMessage, null);
}
return requireNonNull(s.getData().get(mappedKey), exceptionMessage, mappedKey);
Map<String, String> data = requireNonNull(s.getData(), exceptionMessage, mappedKey == key ? null : mappedKey);
return requireNonNull(data.get(mappedKey), exceptionMessage, mappedKey);
}

/**
Expand Down

0 comments on commit e0074cf

Please sign in to comment.