Skip to content

Commit

Permalink
Merge pull request #48 from orchitech/upgrade-deps
Browse files Browse the repository at this point in the history
Upgrade TestNG, Jackson and Guava dependencies
  • Loading branch information
pavelhoral authored Sep 13, 2023
2 parents a7d1d54 + e83e897 commit a424548
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
* Portions copyright 2021 Wren Security.
* Portions copyright 2021-2023 Wren Security.
*/

package org.forgerock.audit.handlers.json;
Expand All @@ -24,7 +24,7 @@
import static org.forgerock.json.JsonValue.*;
import static org.forgerock.json.JsonValue.field;
import static org.forgerock.util.test.FileUtils.deleteRecursively;
import static org.junit.Assert.fail;
import static org.testng.Assert.fail;

import java.io.InputStream;
import java.nio.file.DirectoryStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
* Portions copyright 2023 Wren Security
*/

package org.forgerock.bloomfilter;

import junit.framework.Assert;
import static org.testng.Assert.assertTrue;

import org.wrensecurity.guava.common.hash.Funnels;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
Expand Down Expand Up @@ -104,7 +106,7 @@ public void run() {
System.out.printf("Write Time: %s -> %dms%n", impl, (end - start));

for (int i = 0; i < 50000; ++i) {
Assert.assertTrue(impl.mightContain("Test" + i));
assertTrue(impl.mightContain("Test" + i));
}
}

Expand Down
25 changes: 7 additions & 18 deletions commons-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
information: "Portions copyright [year] [name of copyright owner]".
Copyright 2016 ForgeRock AS.
Portions Copyright 2017-2021 Wren Security.
Portions Copyright 2017-2023 Wren Security.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -42,12 +42,12 @@
<wrensec-guava.version>18.0.5</wrensec-guava.version>
<jaxb-osgi.version>2.3.3</jaxb-osgi.version>
<activation.version>2.0.0</activation.version>
<jackson.version>2.12.1</jackson.version>
<jackson.version>2.15.2</jackson.version>
<mockito.version>4.4.0</mockito.version>
<servlet-api.version>3.1.0</servlet-api.version>
<slf4j.version>1.7.30</slf4j.version>
<testng.version>7.3.0</testng.version>
<swagger.version>1.6.2</swagger.version>
<testng.version>7.8.0</testng.version>
<swagger.version>1.6.11</swagger.version>
<jsr305.version>3.0.2</jsr305.version>
</properties>

Expand Down Expand Up @@ -96,11 +96,11 @@
<version>${slf4j.version}</version>
</dependency>

<!-- Override version managed by testng to version required by swagger -->
<!-- Upgrade version managed by swagger -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0.1-android</version>
<version>32.1.2-android</version>
<exclusions>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
Expand All @@ -120,22 +120,11 @@
</exclusion>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-compat-qual</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
<artifactId>checker-qual</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Override version managed by testng to version required by jackson-dataformat-yaml -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.27</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,8 @@ public void shouldResolveStrippingTheExistingPath() throws Exception {
@Test
public void shouldResolveWhenThereIsNoTrailingSlashInBase() throws Exception {
MutableUri uri = uri("http://www.example.com");
MutableUri resolved = uri.resolve(uri("c%3Dd"));
// Do not use uri() here because resolution knows %3d is a path element
// where http://...comc%3Dd is see as part of the hostname (no path element)
assertThat(resolved.toString()).isEqualTo("http://www.example.comc%3Dd");
MutableUri resolved = uri.resolve(uri("/c%3Dd"));
assertThat(resolved.toString()).isEqualTo("http://www.example.com/c%3Dd");
assertThat(resolved.getPathElements().toString()).isEqualTo("c=d");
}

Expand Down
4 changes: 1 addition & 3 deletions i18n/i18n-slf4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
information: "Portions copyright [year] [name of copyright owner]".
Copyright 2011 ForgeRock AS.
Portions Copyright 2017-2022 Wren Security.
Portions Copyright 2017-2023 Wren Security.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand All @@ -38,12 +38,10 @@
<dependency>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>i18n-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
<type>jar</type>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions Copyrighted [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS
* Portions copyright 2023 Wren Security
*/
package org.forgerock.i18n.slf4j;

Expand Down Expand Up @@ -84,8 +85,8 @@ public boolean hasReferences() {

/** {@inheritDoc} */
@Override
public Iterator<?> iterator() {
return Collections.emptySet().iterator();
public Iterator<Marker> iterator() {
return Collections.<Marker>emptySet().iterator();
}

/** {@inheritDoc} */
Expand Down
3 changes: 1 addition & 2 deletions i18n/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
</description>

<properties>
<pgpVerifyKeysVersion>1.6.2</pgpVerifyKeysVersion>
<testng.version>7.3.0</testng.version>
<testng.version>7.8.0</testng.version>
<mockito.version>4.4.0</mockito.version>
<assertj.version>3.23.1</assertj.version>
</properties>
Expand Down
4 changes: 2 additions & 2 deletions json-schema/json-schema-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
information: "Portions copyright [year] [name of copyright owner]".
Copyright 2012-2015 ForgeRock AS.
Portions Copyright 2017-2021 Wren Security.
Portions Copyright 2017-2023 Wren Security.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -80,7 +80,7 @@
<artifactId>maven-surefire-plugin</artifactId>

<configuration>
<parallel>true</parallel>
<parallel>methods</parallel>
<threadCount>10</threadCount>
</configuration>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</repositories>

<properties>
<pgpVerifyKeysVersion>1.7.1</pgpVerifyKeysVersion>
<pgpVerifyKeysVersion>1.7.6</pgpVerifyKeysVersion>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,24 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
* Portions Copyright 2018 Wren Security.
* Portions Copyright 2018-2023 Wren Security.
*/

package org.forgerock.api.jackson;

import static org.forgerock.json.JsonValue.json;

import java.io.IOException;
import java.util.Set;

import javax.validation.ValidationException;

import org.forgerock.http.util.Json;
import org.forgerock.util.i18n.LocalizableString;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;

import io.swagger.util.ReferenceSerializationConfigurer;
import java.io.IOException;
import java.util.Set;
import javax.validation.ValidationException;
import org.forgerock.http.util.Json;

/**
* Some utilities for working with Jackson, JSON object mapping, and JSON schema.
Expand All @@ -44,7 +39,8 @@ public final class JacksonUtils {
* A public static {@code ObjectMapper} instance, so that they do not have to be instantiated
* all over the place, as they are expensive to construct.
*/
public static final ObjectMapper OBJECT_MAPPER = io.swagger.util.Json.mapper();
public static final ObjectMapper OBJECT_MAPPER = io.swagger.util.Json.mapper()
.registerModules(new Json.LocalizableStringModule(), new Json.JsonValueModule());

/**
* Create a Jackson JSON object mapper that is best-suited for general-purpose use by
Expand All @@ -56,16 +52,12 @@ public final class JacksonUtils {
* representation of each object, without any of the tweaks that are normally needed for
* Swagger output.
*
* <p>Unlike a vanilla {@link ObjectMapper}, the mapper returned by this method is configured to
* be able to serialize {@link LocalizableString} instances.
*
* @return
* A Jackson {@code ObjectMapper} that can generically handle most POJOs and localize-able
* strings.
*/
public static ObjectMapper createGenericMapper() {
final ObjectMapper mapper =
new ObjectMapper()
final ObjectMapper mapper = new ObjectMapper()
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
.enable(SerializationFeature.INDENT_OUTPUT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
* Portions Copyright 2018 Wren Security.
* Portions Copyright 2018-2023 Wren Security.
*/

package org.forgerock.api;
Expand All @@ -28,8 +28,6 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
import org.forgerock.api.models.ApiDescription;
import org.forgerock.api.jackson.JacksonUtils;
Expand All @@ -40,12 +38,6 @@ public class ExamplesTest {

@BeforeClass
public void setup() throws Exception {
// Unfortunately this currently produces a trivial schema that just has {@code "type": "any"}
// for the {@code Errors}, {@code Definitions} and {@code Paths} classes.
//
// Raised with the jackson project:
// - https://github.com/FasterXML/jackson-module-jsonSchema/pull/100
// - https://github.com/FasterXML/jackson-databind/pull/1177
schema = schemaFor(ApiDescription.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
* Portions copyright 2023 Wren Security
*/

package org.forgerock.api.models;

import static org.assertj.core.api.Assertions.*;

import org.forgerock.json.JsonValue;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class DefinitionsTest {

private static final Schema OBJECT_SCHEMA = Schema.schema().type(Object.class).build();
private static final Schema OTHER_EQUAL_SCHEMA = Schema.schema().type(Object.class).build();
private static final Schema OTHER_NON_EQUAL_SCHEMA = Schema.schema().type(JsonValue.class).build();
private static final Schema OTHER_NON_EQUAL_SCHEMA = Schema.schema().type(String.class).build();


@DataProvider(name = "putValidationData")
Expand Down
2 changes: 1 addition & 1 deletion rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
information: "Portions Copyrighted [year] [name of copyright owner]".
Copyright 2012-2016 ForgeRock AS.
Portions Copyright 2017-2018 Wren Security.
Portions Copyright 2017-2023 Wren Security.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand Down
8 changes: 4 additions & 4 deletions security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@
</dependency>

<dependency>
<groupId>org.forgerock.opendj</groupId>
<groupId>org.wrensecurity.wrends</groupId>
<artifactId>opendj-ldap-toolkit</artifactId>
<version>4.0.0-M3</version>
<version>5.0.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-util</artifactId>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
* Portions copyright 2023 Wren Security
*/
package org.forgerock.selfservice.core.config;

Expand Down Expand Up @@ -59,9 +60,9 @@ public TypeDeserializer forProperty(final BeanProperty prop) {
*/
@Override
protected Object _deserializeTypedUsingDefaultImpl(JsonParser jsonParser, DeserializationContext context,
TokenBuffer tokenBuffer) throws IOException {
TokenBuffer tokenBuffer, String priorFailureMsg) throws IOException {
try {
return super._deserializeTypedUsingDefaultImpl(jsonParser, context, tokenBuffer);
return super._deserializeTypedUsingDefaultImpl(jsonParser, context, tokenBuffer, priorFailureMsg);
} catch (JsonMappingException e) {
// fallback
if (tokenBuffer != null) {
Expand Down
4 changes: 2 additions & 2 deletions self-service/forgerock-selfservice-example-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
information: "Portions copyright [year] [name of copyright owner]".
Copyright (c) 2015 ForgeRock AS. All Rights Reserved
Portions Copyright 2017-2021 Wren Security.
Portions Copyright 2017-2023 Wren Security.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand All @@ -31,7 +31,7 @@
<description>UI for Wren Security Self-Service Example</description>

<properties>
<forgerock-ui.version>22.0.0-M2</forgerock-ui.version>
<forgerock-ui.version>22.1.2</forgerock-ui.version>
</properties>

<build>
Expand Down

0 comments on commit a424548

Please sign in to comment.