diff options
author | renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> | 2023-08-29 17:02:12 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-08-29 23:37:31 +0200 |
commit | 9ad528fdbc466133b67d55baadf1c01181cefea3 (patch) | |
tree | bf7b540188f9a64d99ac8b9f4cb6ff579c25dab1 | |
parent | 306dce28ed3cfa0d2f4679fd2519db3d1ac780c7 (diff) |
- Update dependency org.jvnet.mimepull:mimepull to v1.10.0
- Update dependency org.apache.opennlp:opennlp-tools to v1.9.4
- Use dependency-versions
- Bring jimfs up to date.
- Bring some more libraries up-2-date.
- Reduce usage of assertj
32 files changed, 304 insertions, 363 deletions
diff --git a/cloud-tenant-base-dependencies-enforcer/pom.xml b/cloud-tenant-base-dependencies-enforcer/pom.xml index 1b39095bc55..8b069933970 100644 --- a/cloud-tenant-base-dependencies-enforcer/pom.xml +++ b/cloud-tenant-base-dependencies-enforcer/pom.xml @@ -146,6 +146,9 @@ <include>io.airlift:airline:${airline.vespa.version}:test</include> <include>io.prometheus:simpleclient:${prometheus.client.vespa.version}:test</include> <include>io.prometheus:simpleclient_common:${prometheus.client.vespa.version}:test</include> + <include>io.prometheus:simpleclient_tracer_common:${prometheus.client.vespa.version}:test</include> + <include>io.prometheus:simpleclient_tracer_otel:${prometheus.client.vespa.version}:test</include> + <include>io.prometheus:simpleclient_tracer_otel_agent:${prometheus.client.vespa.version}:test</include> <include>junit:junit:${junit4.vespa.version}:test</include> <include>net.java.dev.jna:jna:${jna.vespa.version}:test</include> <include>net.openhft:zero-allocation-hashing:jar:${zero-allocation-hashing.vespa.version}:test</include> diff --git a/config-model-fat/pom.xml b/config-model-fat/pom.xml index 34034f5e53b..adf511faabe 100644 --- a/config-model-fat/pom.xml +++ b/config-model-fat/pom.xml @@ -204,6 +204,9 @@ <i>com.thaiopensource:jing:*:*</i> <i>io.prometheus:simpleclient:*:*</i> <i>io.prometheus:simpleclient_common:*:*</i> + <i>io.prometheus:simpleclient_tracer_common:*:*</i> + <i>io.prometheus:simpleclient_tracer_otel:*:*</i> + <i>io.prometheus:simpleclient_tracer_otel_agent:*:*</i> <i>javax.inject:javax.inject:*:*</i> <i>net.openhft:zero-allocation-hashing:*:*</i> <i>org.antlr:antlr-runtime:*:*</i> diff --git a/config-model/pom.xml b/config-model/pom.xml index 7c6fb610bae..58df48a5763 100644 --- a/config-model/pom.xml +++ b/config-model/pom.xml @@ -52,11 +52,6 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>${protobuf.vespa.version}</version> diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java index d5bcf1e5e49..0e98225aba5 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/BundleValidatorTest.java @@ -17,7 +17,6 @@ import java.util.jar.JarFile; import java.util.jar.JarOutputStream; import static com.yahoo.yolean.Exceptions.uncheck; -import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -65,12 +64,12 @@ public class BundleValidatorTest { JarFile jarFile = createTemporaryJarFile(tempDir, "import-warnings"); validator.validateJarFile(state, jarFile); String output = buffer.toString(); - assertThat(output) + assertTrue(output .contains("JAR file 'import-warnings.jar' imports the packages [org.json] from 'org.json:json'. \n" + - "This bundle is no longer provided on Vespa 8 - see https://docs.vespa.ai/en/vespa8-release-notes.html#container-runtime."); - assertThat(output) + "This bundle is no longer provided on Vespa 8 - see https://docs.vespa.ai/en/vespa8-release-notes.html#container-runtime.")); + assertTrue(output .contains("JAR file 'import-warnings.jar' imports the packages [org.eclipse.jetty.client.api] from 'jetty'. \n" + - "The Jetty bundles are no longer provided on Vespa 8 - see https://docs.vespa.ai/en/vespa8-release-notes.html#container-runtime."); + "The Jetty bundles are no longer provided on Vespa 8 - see https://docs.vespa.ai/en/vespa8-release-notes.html#container-runtime.")); } static DeployState createDeployState(StringBuffer buffer) { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/http/DefaultFilterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/http/DefaultFilterTest.java index 3e80b319e88..a52b6117482 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/http/DefaultFilterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/http/DefaultFilterTest.java @@ -11,10 +11,12 @@ import com.yahoo.vespa.model.container.xml.ContainerModelBuilder; import org.junit.jupiter.api.Test; import org.w3c.dom.Element; +import java.util.Map; import java.util.Set; +import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toSet; -import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author bjorncs @@ -53,17 +55,12 @@ public class DefaultFilterTest extends DomBuilderTest { ChainsConfig chainsConfig = root.getConfig(ChainsConfig.class, "container/filters/chain"); Set<String> chainsIds = chainsConfig.chains().stream().map(ChainsConfig.Chains::id).collect(toSet()); - assertThat(chainsIds) - .containsExactlyInAnyOrder( - "request-chain-with-binding", "response-chain-with-binding", "my-default-request-chain", "my-default-response-chain"); + assertEquals(chainsIds, Set.of("request-chain-with-binding", "response-chain-with-binding", "my-default-request-chain", "my-default-response-chain")); } private static void assertDefaultFiltersInConfig(ServerConfig config) { - assertThat(config.defaultFilters()) - .containsExactlyInAnyOrder( - new ServerConfig.DefaultFilters(new ServerConfig.DefaultFilters.Builder() - .filterId("my-default-request-chain").localPort(8000)), - new ServerConfig.DefaultFilters(new ServerConfig.DefaultFilters.Builder() - .filterId("my-default-response-chain").localPort(8000))); + var asMap = config.defaultFilters().stream().collect(toMap(ServerConfig.DefaultFilters::filterId, ServerConfig.DefaultFilters::localPort)); + assertEquals(asMap, Map.of("my-default-request-chain", 8000, "my-default-response-chain", 8000)); + } } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/FederationTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/FederationTest.java index ff884d6072f..3c96edc482a 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/FederationTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/search/searchchain/FederationTest.java @@ -7,7 +7,6 @@ import org.w3c.dom.Element; import java.util.List; -import static org.assertj.core.api.Fail.fail; import static org.junit.jupiter.api.Assertions.*; /** diff --git a/configserver-flags/pom.xml b/configserver-flags/pom.xml index 63525805669..02824f2e6e3 100644 --- a/configserver-flags/pom.xml +++ b/configserver-flags/pom.xml @@ -110,11 +110,6 @@ <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> </dependencies> <build> <plugins> diff --git a/configserver-flags/src/test/java/com/yahoo/vespa/configserver/flags/http/FlagsHandlerTest.java b/configserver-flags/src/test/java/com/yahoo/vespa/configserver/flags/http/FlagsHandlerTest.java index 2700ab114e9..3c4c99e0337 100644 --- a/configserver-flags/src/test/java/com/yahoo/vespa/configserver/flags/http/FlagsHandlerTest.java +++ b/configserver-flags/src/test/java/com/yahoo/vespa/configserver/flags/http/FlagsHandlerTest.java @@ -23,8 +23,8 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author hakonhall @@ -36,8 +36,6 @@ public class FlagsHandlerTest { "id2", true, List.of("joe"), "2010-01-01", "2030-01-01", "desc2", "mod2", FetchVector.Dimension.HOSTNAME, FetchVector.Dimension.APPLICATION_ID); - private static final String FLAGS_V1_URL = "https://foo.com:4443/flags/v1"; - private final FlagsDb flagsDb = new FlagsDbImpl(new MockCurator()); private final FlagsHandler handler = new FlagsHandler(FlagsHandler.testContext(), flagsDb); @@ -71,14 +69,15 @@ public class FlagsHandlerTest { void testData() { // PUT flag with ID id1 verifySuccessfulRequest(Method.PUT, "/data/" + FLAG1.id(), - "{\n" + - " \"id\": \"id1\",\n" + - " \"rules\": [\n" + - " {\n" + - " \"value\": true\n" + - " }\n" + - " ]\n" + - "}", + """ + { + "id": "id1", + "rules": [ + { + "value": true + } + ] + }""", ""); // GET on ID id1 should return the same as the put. @@ -99,29 +98,31 @@ public class FlagsHandlerTest { // PUT id2 verifySuccessfulRequest(Method.PUT, "/data/" + FLAG2.id(), - "{\n" + - " \"id\": \"id2\",\n" + - " \"rules\": [\n" + - " {\n" + - " \"conditions\": [\n" + - " {\n" + - " \"type\": \"whitelist\",\n" + - " \"dimension\": \"hostname\",\n" + - " \"values\": [ \"host1\", \"host2\" ]\n" + - " },\n" + - " {\n" + - " \"type\": \"blacklist\",\n" + - " \"dimension\": \"application\",\n" + - " \"values\": [ \"app1\", \"app2\" ]\n" + - " }\n" + - " ],\n" + - " \"value\": true\n" + - " }\n" + - " ],\n" + - " \"attributes\": {\n" + - " \"zone\": \"zone1\"\n" + - " }\n" + - "}\n", + """ + { + "id": "id2", + "rules": [ + { + "conditions": [ + { + "type": "whitelist", + "dimension": "hostname", + "values": [ "host1", "host2" ] + }, + { + "type": "blacklist", + "dimension": "application", + "values": [ "app1", "app2" ] + } + ], + "value": true + } + ], + "attributes": { + "zone": "zone1" + } + } + """, ""); // GET on id2 should now return what was put @@ -135,14 +136,16 @@ public class FlagsHandlerTest { // Putting (overriding) id1 should work silently verifySuccessfulRequest(Method.PUT, "/data/" + FLAG1.id(), - "{\n" + - " \"id\": \"id1\",\n" + - " \"rules\": [\n" + - " {\n" + - " \"value\": false\n" + - " }\n" + - " ]\n" + - "}\n", + """ + { + "id": "id1", + "rules": [ + { + "value": false + } + ] + } + """, ""); // Verify PUT @@ -162,16 +165,16 @@ public class FlagsHandlerTest { @Test void testForcing() { - assertThat(handle(Method.PUT, "/data/" + new FlagId("undef"), "", 400)).contains("There is no flag 'undef'"); + assertTrue(handle(Method.PUT, "/data/" + new FlagId("undef"), "", 400).contains("There is no flag 'undef'")); - assertThat(handle(Method.PUT, "/data/" + new FlagId("undef") + "?force=true", "", 400)). - contains("No content to map due to end-of-input"); + assertTrue(handle(Method.PUT, "/data/" + new FlagId("undef") + "?force=true", "", 400). + contains("No content to map due to end-of-input")); - assertThat(handle(Method.PUT, "/data/" + FLAG1.id(), "{}", 400)). - contains("Flag ID missing"); + assertTrue(handle(Method.PUT, "/data/" + FLAG1.id(), "{}", 400). + contains("Flag ID missing")); - assertThat(handle(Method.PUT, "/data/" + FLAG1.id(), "{\"id\": \"id1\",\"rules\": [{\"value\":\"string\"}]}", 400)). - contains("Wrong type of JsonNode: STRING"); + assertTrue(handle(Method.PUT, "/data/" + FLAG1.id(), "{\"id\": \"id1\",\"rules\": [{\"value\":\"string\"}]}", 400). + contains("Wrong type of JsonNode: STRING")); assertEquals(handle(Method.PUT, "/data/" + FLAG1.id() + "?force=true", "{\"id\": \"id1\",\"rules\": [{\"value\":\"string\"}]}", 200), ""); diff --git a/configserver/pom.xml b/configserver/pom.xml index ece1e497d44..bfef0748989 100644 --- a/configserver/pom.xml +++ b/configserver/pom.xml @@ -106,11 +106,6 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>com.yahoo.vespa</groupId> <artifactId>airlift-zstd</artifactId> <version>${project.version}</version> diff --git a/container-core/pom.xml b/container-core/pom.xml index b3794142d0e..3df232406ca 100644 --- a/container-core/pom.xml +++ b/container-core/pom.xml @@ -390,11 +390,6 @@ </exclusions> </dependency> <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest</artifactId> <scope>test</scope> diff --git a/container-core/src/test/java/com/yahoo/container/jdisc/ThreadedHttpRequestHandlerTest.java b/container-core/src/test/java/com/yahoo/container/jdisc/ThreadedHttpRequestHandlerTest.java index 86b7f545762..8590983d0ad 100644 --- a/container-core/src/test/java/com/yahoo/container/jdisc/ThreadedHttpRequestHandlerTest.java +++ b/container-core/src/test/java/com/yahoo/container/jdisc/ThreadedHttpRequestHandlerTest.java @@ -7,7 +7,8 @@ import org.junit.jupiter.api.Test; import java.util.concurrent.Executors; -import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author bjorncs @@ -22,10 +23,10 @@ public class ThreadedHttpRequestHandlerTest { driver.sendRequest("http://localhost/myhandler").readAll(); String expectedMetricName = "jdisc.http.handler.unhandled_exceptions"; - assertThat(metricMock.innvocations()) - .containsKey(expectedMetricName); - assertThat(((MetricMock.SimpleMetricContext) metricMock.innvocations().get(expectedMetricName).ctx).dimensions) - .containsEntry("exception", "DummyException"); + assertTrue(metricMock.innvocations() + .containsKey(expectedMetricName)); + assertEquals("DummyException", + ((MetricMock.SimpleMetricContext) metricMock.innvocations().get(expectedMetricName).ctx).dimensions.get("exception")); } diff --git a/container-core/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java b/container-core/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java index b5c65733436..220c09481c2 100644 --- a/container-core/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java +++ b/container-core/src/test/java/com/yahoo/container/logging/LogFileHandlerTestCase.java @@ -25,8 +25,10 @@ import java.util.logging.LogRecord; import java.util.zip.GZIPInputStream; import static com.yahoo.yolean.Exceptions.uncheck; -import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author Bob Travis @@ -50,8 +52,8 @@ public class LogFileHandlerTestCase { long tomorrowDays = (now / millisPerDay) + 1; long tomorrowMillis = tomorrowDays * millisPerDay; - assertThat(tomorrowMillis + 1000).isEqualTo(h.logThread.getNextRotationTime(tomorrowMillis)); - assertThat(tomorrowMillis + 10000).isEqualTo(h.logThread.getNextRotationTime(tomorrowMillis + 3000)); + assertEquals(tomorrowMillis + 1000, h.logThread.getNextRotationTime(tomorrowMillis)); + assertEquals(tomorrowMillis + 10000, h.logThread.getNextRotationTime(tomorrowMillis + 3000)); String message = "test"; h.publish(message); h.publish("another test"); @@ -118,11 +120,11 @@ public class LogFileHandlerTestCase { String longMessage = formatter.format(new LogRecord(Level.INFO, "string which is way longer than the word test")); handler.publish(longMessage); handler.flush(); - assertThat(Files.size(Paths.get(firstFile))).isEqualTo(31); + assertEquals(31, Files.size(Paths.get(firstFile))); final long expectedSecondFileLength = 72; long symlinkFileLength = Files.size(root.toPath().resolve("symlink")); - assertThat(symlinkFileLength).isEqualTo(expectedSecondFileLength); + assertEquals(expectedSecondFileLength, symlinkFileLength); handler.shutdown(); } @@ -135,8 +137,8 @@ public class LogFileHandlerTestCase { firstHandler.publishAndWait("test"); firstHandler.shutdown(); - assertThat(Files.size(Paths.get(firstHandler.getFileName()))).isEqualTo(5); - assertThat(root.toPath().resolve("symlink").toRealPath().toString()).isEqualTo( + assertEquals(5, Files.size(Paths.get(firstHandler.getFileName()))); + assertEquals(root.toPath().resolve("symlink").toRealPath().toString(), Paths.get(firstHandler.getFileName()).toRealPath().toString()); LogFileHandler<String> secondHandler = new LogFileHandler<>( @@ -144,11 +146,11 @@ public class LogFileHandlerTestCase { secondHandler.publishAndWait("test"); secondHandler.rotateNow(); - assertThat(root.toPath().resolve("symlink").toRealPath().toString()).isEqualTo( + assertEquals(root.toPath().resolve("symlink").toRealPath().toString(), Paths.get(secondHandler.getFileName()).toRealPath().toString()); while (Files.exists(root.toPath().resolve(firstHandler.getFileName()))) Thread.sleep(1); - assertThat(Files.exists(Paths.get(firstHandler.getFileName() + ".zst"))).isTrue(); + assertTrue(Files.exists(Paths.get(firstHandler.getFileName() + ".zst"))); secondHandler.shutdown(); } @@ -187,20 +189,20 @@ public class LogFileHandlerTestCase { } h.flush(); String f1 = h.getFileName(); - assertThat(f1).startsWith(root.getAbsolutePath() + "/logfilehandlertest."); + assertTrue(f1.startsWith(root.getAbsolutePath() + "/logfilehandlertest.")); File uncompressed = new File(f1); File compressed = new File(f1 + "." + fileExtension); - assertThat(uncompressed).exists(); - assertThat(compressed).doesNotExist(); + assertTrue(uncompressed.exists()); + assertFalse(compressed.exists()); String content = IOUtils.readFile(uncompressed); - assertThat(content).hasLineCount(logEntries); + assertEquals(logEntries, content.lines().count()); h.rotateNow(); while (uncompressed.exists()) { Thread.sleep(1); } - assertThat(compressed).exists(); + assertTrue(compressed.exists()); String uncompressedContent = decompressor.apply(compressed.toPath(), content.getBytes().length); - assertThat(uncompressedContent).isEqualTo(content); + assertEquals(uncompressedContent, content); h.shutdown(); } @@ -211,14 +213,6 @@ public class LogFileHandlerTestCase { outputStream.write(record.getBytes(StandardCharsets.UTF_8)); } - private static File newFolder(File root, String... subDirs) throws IOException { - String subFolder = String.join("/", subDirs); - File result = new File(root, subFolder); - if (!result.mkdirs()) { - throw new IOException("Couldn't create folders " + root); - } - return result; - } } private static File newFolder(File root, String... subDirs) throws IOException { diff --git a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/FilterTestCase.java b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/FilterTestCase.java index ce49926c58b..cc839768ad5 100644 --- a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/FilterTestCase.java +++ b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/FilterTestCase.java @@ -28,7 +28,6 @@ import com.yahoo.jdisc.http.filter.ResponseHeaderFilter; import com.yahoo.jdisc.http.filter.chain.RequestFilterChain; import com.yahoo.jdisc.http.filter.chain.ResponseFilterChain; import com.yahoo.jdisc.http.server.jetty.testutils.ConnectorFactoryRegistryModule; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -44,6 +43,7 @@ import java.util.concurrent.atomic.AtomicReference; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.mock; @@ -557,7 +557,7 @@ public class FilterTestCase { .expectStatusCode(is(Response.Status.OK)); ArgumentCaptor<HttpRequest> requestArgumentCaptor = ArgumentCaptor.forClass(HttpRequest.class); verify(filter).filter(requestArgumentCaptor.capture(), any(ResponseHandler.class)); - Assertions.assertThat(requestArgumentCaptor.getValue().context()).containsKey(RequestHandlerSpec.ATTRIBUTE_NAME); + assertTrue(requestArgumentCaptor.getValue().context().containsKey(RequestHandlerSpec.ATTRIBUTE_NAME)); } private static JettyTestDriver newDriver(MyRequestHandler requestHandler, FilterBindings filterBindings) { diff --git a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java index 97237e1c016..c4c9161ccfb 100644 --- a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java +++ b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java @@ -38,7 +38,6 @@ import org.apache.hc.client5.http.entity.mime.StringBody; import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; import org.apache.hc.core5.http.ConnectionClosedException; import org.apache.hc.core5.http.ContentType; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -85,12 +84,11 @@ import static com.yahoo.jdisc.http.server.jetty.Utils.createHttp2Client; import static com.yahoo.jdisc.http.server.jetty.Utils.createSslTestDriver; import static com.yahoo.jdisc.http.server.jetty.Utils.generatePrivateKeyAndCertificate; import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.matchesPattern; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; @@ -127,7 +125,7 @@ public class HttpServerTest { .listenPort(driver.server().getListenPort()) ); } catch (final Throwable t) { - assertThat(t.getCause(), instanceOf(BindException.class)); + assertTrue(t.getCause() instanceof BindException); } assertTrue(driver.close()); } @@ -191,7 +189,7 @@ public class HttpServerTest { .expectStatusCode(is(REQUEST_URI_TOO_LONG)); RequestLogEntry entry = requestLogMock.poll(Duration.ofSeconds(5)); assertEquals(414, entry.statusCode().getAsInt()); - assertThat(driver.close(), is(true)); + assertTrue(driver.close()); } @Test @@ -473,7 +471,7 @@ public class HttpServerTest { final JettyTestDriver driver = JettyTestDriver.newInstance(new EchoWithHeaderRequestHandler(CONNECTION, CLOSE)); driver.client().get("/status.html") .expectHeader(CONNECTION, is(CLOSE)); - assertThat(driver.close(), is(true)); + assertTrue(driver.close()); } @Test @@ -583,7 +581,7 @@ public class HttpServerTest { driver.client().get("/status.html") .expectStatusCode(is(OK)) .expectContent(matchesPattern("\\d{13,}")); - assertThat(driver.close(), is(true)); + assertTrue(driver.close()); } @Test @@ -689,25 +687,25 @@ public class HttpServerTest { } assertTrue(driver.close()); List<ConnectionLogEntry> logEntries = connectionLog.logEntries(); - Assertions.assertThat(logEntries).hasSize(1); + assertEquals(1, logEntries.size()); ConnectionLogEntry logEntry = logEntries.get(0); assertEquals(4, UUID.fromString(logEntry.id()).version()); - Assertions.assertThat(logEntry.timestamp()).isAfter(Instant.EPOCH); - Assertions.assertThat(logEntry.requests()).hasValue(100L); - Assertions.assertThat(logEntry.responses()).hasValue(100L); - Assertions.assertThat(logEntry.peerAddress()).hasValue("127.0.0.1"); - Assertions.assertThat(logEntry.localAddress()).hasValue("127.0.0.1"); - Assertions.assertThat(logEntry.localPort()).hasValue(listenPort); - Assertions.assertThat(logEntry.httpBytesReceived()).hasValueSatisfying(value -> Assertions.assertThat(value).isGreaterThan(100000L)); - Assertions.assertThat(logEntry.httpBytesSent()).hasValueSatisfying(value -> Assertions.assertThat(value).isGreaterThan(10000L)); - Assertions.assertThat(logEntry.sslProtocol()).hasValueSatisfying(TlsContext.ALLOWED_PROTOCOLS::contains); - Assertions.assertThat(logEntry.sslPeerSubject()).hasValue("CN=localhost"); - Assertions.assertThat(logEntry.sslCipherSuite()).hasValueSatisfying(cipher -> Assertions.assertThat(cipher).isNotBlank()); - Assertions.assertThat(logEntry.sslSessionId()).hasValueSatisfying(sessionId -> Assertions.assertThat(sessionId).hasSize(64)); - Assertions.assertThat(logEntry.sslPeerNotBefore()).hasValue(Instant.EPOCH); - Assertions.assertThat(logEntry.sslPeerNotAfter()).hasValue(Instant.EPOCH.plus(100_000, ChronoUnit.DAYS)); - Assertions.assertThat(logEntry.sslBytesReceived()).hasValueSatisfying(value -> Assertions.assertThat(value).isGreaterThan(100000L)); - Assertions.assertThat(logEntry.sslBytesSent()).hasValueSatisfying(value -> Assertions.assertThat(value).isGreaterThan(10000L)); + assertTrue(logEntry.timestamp().isAfter(Instant.EPOCH)); + assertEquals(100L, logEntry.requests().get()); + assertEquals(100L, logEntry.responses().get()); + assertEquals("127.0.0.1", logEntry.peerAddress().get()); + assertEquals("127.0.0.1", logEntry.localAddress().get()); + assertEquals(listenPort, logEntry.localPort().get()); + assertTrue(logEntry.httpBytesReceived().get() > 100000L); + assertTrue(logEntry.httpBytesSent().get() > 10000L); + assertTrue(TlsContext.ALLOWED_PROTOCOLS.contains(logEntry.sslProtocol().get())); + assertEquals("CN=localhost", logEntry.sslPeerSubject().get()); + assertFalse(logEntry.sslCipherSuite().get().isBlank()); + assertEquals(64, logEntry.sslSessionId().get().length()); + assertEquals(Instant.EPOCH, logEntry.sslPeerNotBefore().get()); + assertEquals(Instant.EPOCH.plus(100_000, ChronoUnit.DAYS), logEntry.sslPeerNotAfter().get()); + assertTrue(logEntry.sslBytesReceived().get() > 100000L); + assertTrue(logEntry.sslBytesSent().get() > 10000L); } @Test @@ -720,9 +718,9 @@ public class HttpServerTest { binder -> binder.bind(RequestLog.class).toInstance(requestLogMock)); driver.client().newPost("/status.html").setContent("abcdef").execute().expectStatusCode(is(OK)); RequestLogEntry entry = requestLogMock.poll(Duration.ofSeconds(5)); - Assertions.assertThat(entry.statusCode()).hasValue(200); - Assertions.assertThat(entry.requestSize()).hasValue(6); - assertThat(driver.close(), is(true)); + assertEquals(200, entry.statusCode().getAsInt()); + assertEquals(6, entry.requestSize().getAsLong()); + assertTrue(driver.close()); } @Test @@ -734,7 +732,7 @@ public class HttpServerTest { InMemoryConnectionLog connectionLog = new InMemoryConnectionLog(); JettyTestDriver driver = createSslTestDriver(certificateFile, privateKeyFile, metricConsumer, connectionLog); driver.client().get("/").expectStatusCode(is(OK)); - assertThat(driver.close(), is(true)); + assertTrue(driver.close()); verify(metricConsumer.mockitoMock(), atLeast(1)) .set(MetricDefinitions.REQUESTS_PER_CONNECTION, 1L, MetricConsumerMock.STATIC_CONTEXT); } diff --git a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/ProxyProtocolTest.java b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/ProxyProtocolTest.java index 246b7875692..811a8006720 100644 --- a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/ProxyProtocolTest.java +++ b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/ProxyProtocolTest.java @@ -29,7 +29,6 @@ import java.util.logging.Logger; import static com.yahoo.jdisc.http.server.jetty.Utils.generatePrivateKeyAndCertificate; import static com.yahoo.yolean.Exceptions.uncheckInterrupted; -import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.jetty.client.ProxyProtocolClientConnectionFactory.V1; import static org.eclipse.jetty.client.ProxyProtocolClientConnectionFactory.V2; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -206,14 +205,14 @@ class ProxyProtocolTest { private static void assertLogEntryHasRemote(ConnectionLogEntry entry, String expectedAddress, int expectedPort) { if (expectedAddress != null) { - assertThat(entry.remoteAddress()).hasValue(expectedAddress); + assertEquals(expectedAddress, entry.remoteAddress().get()); } else { - assertThat(entry.remoteAddress()).isEmpty(); + assertTrue(entry.remoteAddress().isEmpty()); } if (expectedPort > 0) { - assertThat(entry.remotePort()).hasValue(expectedPort); + assertEquals(expectedPort, entry.remotePort().get()); } else { - assertThat(entry.remotePort()).isEmpty(); + assertTrue(entry.remotePort().isEmpty()); } } @@ -227,8 +226,8 @@ class ProxyProtocolTest { await(waitCondition); assertTrue(driver.close()); if (waitCondition.test(null)) await(waitCondition); - assertThat(reqLog.entries()).hasSize(expectedReqLogSize); - assertThat(connLog.logEntries()).hasSize(expectedConnLogSize); + assertEquals(expectedReqLogSize, reqLog.entries().size()); + assertEquals(expectedConnLogSize, connLog.logEntries().size()); } private static void await(Predicate<Void> waitCondition) { diff --git a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/SslHandshakeMetricsTest.java b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/SslHandshakeMetricsTest.java index 99fa9bb2052..22699efbd46 100644 --- a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/SslHandshakeMetricsTest.java +++ b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/SslHandshakeMetricsTest.java @@ -21,7 +21,6 @@ import java.util.logging.Logger; import static com.yahoo.jdisc.http.server.jetty.Utils.createSslTestDriver; import static com.yahoo.jdisc.http.server.jetty.Utils.generatePrivateKeyAndCertificate; -import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -59,7 +58,7 @@ class SslHandshakeMetricsTest { verify(metricConsumer.mockitoMock(), atLeast(1)) .add(MetricDefinitions.SSL_HANDSHAKE_FAILURE_MISSING_CLIENT_CERT, 1L, MetricConsumerMock.STATIC_CONTEXT); assertTrue(driver.close()); - assertThat(connectionLog.logEntries()).hasSize(1); + assertEquals(1, connectionLog.logEntries().size()); assertSslHandshakeFailurePresent( connectionLog.logEntries().get(0), SSLHandshakeException.class, SslHandshakeFailure.MISSING_CLIENT_CERT.failureType()); } @@ -82,7 +81,7 @@ class SslHandshakeMetricsTest { verify(metricConsumer.mockitoMock(), atLeast(1)) .add(MetricDefinitions.SSL_HANDSHAKE_FAILURE_INCOMPATIBLE_PROTOCOLS, 1L, MetricConsumerMock.STATIC_CONTEXT); assertTrue(driver.close()); - assertThat(connectionLog.logEntries()).hasSize(1); + assertEquals(1, connectionLog.logEntries().size()); assertSslHandshakeFailurePresent( connectionLog.logEntries().get(0), SSLHandshakeException.class, SslHandshakeFailure.INCOMPATIBLE_PROTOCOLS.failureType()); } @@ -103,7 +102,7 @@ class SslHandshakeMetricsTest { verify(metricConsumer.mockitoMock(), atLeast(1)) .add(MetricDefinitions.SSL_HANDSHAKE_FAILURE_INCOMPATIBLE_CIPHERS, 1L, MetricConsumerMock.STATIC_CONTEXT); assertTrue(driver.close()); - assertThat(connectionLog.logEntries()).hasSize(1); + assertEquals(1, connectionLog.logEntries().size()); assertSslHandshakeFailurePresent( connectionLog.logEntries().get(0), SSLHandshakeException.class, SslHandshakeFailure.INCOMPATIBLE_CIPHERS.failureType()); } @@ -128,7 +127,7 @@ class SslHandshakeMetricsTest { verify(metricConsumer.mockitoMock(), atLeast(1)) .add(MetricDefinitions.SSL_HANDSHAKE_FAILURE_INVALID_CLIENT_CERT, 1L, MetricConsumerMock.STATIC_CONTEXT); assertTrue(driver.close()); - assertThat(connectionLog.logEntries()).hasSize(1); + assertEquals(1, connectionLog.logEntries().size()); assertSslHandshakeFailurePresent( connectionLog.logEntries().get(0), SSLHandshakeException.class, SslHandshakeFailure.INVALID_CLIENT_CERT.failureType()); } @@ -153,7 +152,7 @@ class SslHandshakeMetricsTest { verify(metricConsumer.mockitoMock(), atLeast(1)) .add(MetricDefinitions.SSL_HANDSHAKE_FAILURE_EXPIRED_CLIENT_CERT, 1L, MetricConsumerMock.STATIC_CONTEXT); assertTrue(driver.close()); - assertThat(connectionLog.logEntries()).hasSize(1); + assertEquals(1, connectionLog.logEntries().size()); } @@ -169,7 +168,7 @@ class SslHandshakeMetricsTest { client.get("/status.html"); fail("SSLHandshakeException expected"); } catch (SSLHandshakeException e) { - assertThat(e.getMessage()).contains(expectedExceptionSubstring); + assertTrue(e.getMessage().contains(expectedExceptionSubstring)); } catch (SocketException | SSLException e) { // This exception is thrown if Apache httpclient's write thread detects the handshake failure before the read thread. var msg = e.getMessage(); @@ -182,7 +181,7 @@ class SslHandshakeMetricsTest { private static void assertSslHandshakeFailurePresent( ConnectionLogEntry entry, Class<? extends SSLHandshakeException> expectedException, String expectedType) { - assertThat(entry.sslHandshakeFailure()).isPresent(); + assertTrue(entry.sslHandshakeFailure().isPresent()); ConnectionLogEntry.SslHandshakeFailure failure = entry.sslHandshakeFailure().get(); assertEquals(expectedType, failure.type()); ConnectionLogEntry.SslHandshakeFailure.ExceptionEntry exceptionEntry = failure.exceptionChain().get(0); diff --git a/container-dependencies-enforcer/pom.xml b/container-dependencies-enforcer/pom.xml index 2706b95cfb1..3c991823d5d 100644 --- a/container-dependencies-enforcer/pom.xml +++ b/container-dependencies-enforcer/pom.xml @@ -160,6 +160,9 @@ <include>io.airlift:airline:${airline.vespa.version}:test</include> <include>io.prometheus:simpleclient:${prometheus.client.vespa.version}:test</include> <include>io.prometheus:simpleclient_common:${prometheus.client.vespa.version}:test</include> + <include>io.prometheus:simpleclient_tracer_common:${prometheus.client.vespa.version}:test</include> + <include>io.prometheus:simpleclient_tracer_otel:${prometheus.client.vespa.version}:test</include> + <include>io.prometheus:simpleclient_tracer_otel_agent:${prometheus.client.vespa.version}:test</include> <include>junit:junit:${junit4.vespa.version}:test</include> <include>net.java.dev.jna:jna:${jna.vespa.version}:test</include> <include>net.openhft:zero-allocation-hashing:jar:${zero-allocation-hashing.vespa.version}:test</include> diff --git a/container-disc/pom.xml b/container-disc/pom.xml index 65a03b48c59..164e74c5073 100644 --- a/container-disc/pom.xml +++ b/container-disc/pom.xml @@ -42,17 +42,12 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> + <groupId>com.yahoo.vespa</groupId> + <artifactId>annotations</artifactId> + <version>${project.version}</version> + <scope>provided</scope> </dependency> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>annotations</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> + <dependency> <groupId>com.yahoo.vespa</groupId> <artifactId>config-lib</artifactId> <version>${project.version}</version> diff --git a/container-search/pom.xml b/container-search/pom.xml index 31ce9a00e44..4c1d337d8ad 100644 --- a/container-search/pom.xml +++ b/container-search/pom.xml @@ -162,11 +162,6 @@ </exclusions> </dependency> <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <scope>test</scope> diff --git a/container-search/src/test/java/com/yahoo/search/grouping/vespa/RequestBuilderTestCase.java b/container-search/src/test/java/com/yahoo/search/grouping/vespa/RequestBuilderTestCase.java index f8e67a10076..f474088fa0e 100644 --- a/container-search/src/test/java/com/yahoo/search/grouping/vespa/RequestBuilderTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/grouping/vespa/RequestBuilderTestCase.java @@ -25,10 +25,8 @@ import com.yahoo.searchlib.expression.StrCatFunctionNode; import com.yahoo.searchlib.expression.StringResultNode; import com.yahoo.searchlib.expression.TimeStampFunctionNode; import com.yahoo.searchlib.expression.ToStringFunctionNode; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; -import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import java.util.List; @@ -468,29 +466,29 @@ public class RequestBuilderTestCase { String expectedA = "[{ Attribute, result = [Count] }]"; assertLayout("all(group(a) each(output(count())))", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); assertLayout("all(group(a) each(output(count()) all()))", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); assertLayout("all(group(a) each(output(count()) all(group(b))))", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); assertLayout("all(group(a) each(output(count()) all(group(b) each())))", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); assertLayout("all(group(a) each(output(count()) all(group(b) each())))", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); assertLayout("all(group(a) each(output(count()) all(group(b) each())) as(foo)" + " each())", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); assertLayout("all(group(a) each(output(count()) all(group(b) each())) as(foo)" + " each(group(b)))", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); assertLayout("all(group(a) each(output(count()) all(group(b) each())) as(foo)" + " each(group(b) each()))", - Arrays.asList(expectedA).toString()); + List.of(expectedA).toString()); String expectedB = "[{ Attribute }, { Attribute, result = [Count] }]"; assertLayout("all(group(a) each(output(count()) all(group(b) each())) as(foo)" + " each(group(b) each(output(count()))))", - Arrays.asList(expectedB, expectedA).toString()); + List.of(expectedB, expectedA).toString()); } @Test @@ -650,8 +648,8 @@ public class RequestBuilderTestCase { @Test void requireThatTimeZoneIsAppliedToTimeFunctions() { - for (String timePart : Arrays.asList("dayofmonth", "dayofweek", "dayofyear", "hourofday", - "minuteofhour", "monthofyear", "secondofminute", "year")) + for (String timePart : List.of("dayofmonth", "dayofweek", "dayofyear", "hourofday", + "minuteofhour", "monthofyear", "secondofminute", "year")) { String request = "all(output(avg(time." + timePart + "(foo))))"; assertTimeZone(request, "GMT-2", -7200L); @@ -686,7 +684,7 @@ public class RequestBuilderTestCase { test.expectedOutput = Boolean.toString(true); test.request = "all(output(avg(now() - foo)))"; test.outputWriter = new OutputWriter() { - long before = System.currentTimeMillis(); + final long before = System.currentTimeMillis(); @Override public String write(List<Grouping> groupingList, GroupingTransform transform) { @@ -836,7 +834,7 @@ public class RequestBuilderTestCase { builder.build(); fail(); } catch (IllegalInputException e) { - Assertions.assertThat(e.getMessage()).contains(errorSubstring); + assertTrue(e.getMessage().contains(errorSubstring)); } } @@ -924,7 +922,7 @@ public class RequestBuilderTestCase { RequestBuilder builder = new RequestBuilder(0); builder.setRootOperation(GroupingOperation.fromString(test.request)); builder.setTimeZone(TimeZone.getTimeZone(test.timeZone)); - builder.addContinuations(Arrays.asList(test.continuation)); + builder.addContinuations(List.of(test.continuation)); try { builder.build(); if (test.expectedException != null) { diff --git a/container-search/src/test/java/com/yahoo/search/handler/JSONSearchHandlerTestCase.java b/container-search/src/test/java/com/yahoo/search/handler/JSONSearchHandlerTestCase.java index 7536a8c4914..7b8015044c6 100644 --- a/container-search/src/test/java/com/yahoo/search/handler/JSONSearchHandlerTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/handler/JSONSearchHandlerTestCase.java @@ -16,7 +16,6 @@ import com.yahoo.search.searchchain.config.test.SearchChainConfigurerTestCase; import com.yahoo.slime.Inspector; import com.yahoo.slime.SlimeUtils; import com.yahoo.test.json.JsonTestHelper; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; @@ -149,7 +148,7 @@ public class JSONSearchHandlerTestCase { configurer.reloadConfig(); SearchHandler newSearchHandler = fetchSearchHandler(configurer); - assertTrue(searchHandler != newSearchHandler, "Do I have a new instance of the search handler?"); + assertNotSame(searchHandler, newSearchHandler, "Do I have a new instance of the search handler?"); try (RequestHandlerTestDriver newDriver = new RequestHandlerTestDriver(newSearchHandler)) { ObjectNode json = jsonMapper.createObjectNode(); json.put("yql", "selectz * from foo where bar > 1453501295"); @@ -193,13 +192,15 @@ public class JSONSearchHandlerTestCase { ObjectNode json = jsonMapper.createObjectNode(); json.put("format", "xml"); - assertEquals("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + - "<result total-hit-count=\"0\">\n" + - " <hit relevancy=\"1.0\">\n" + - " <field name=\"relevancy\">1.0</field>\n" + - " <field name=\"uri\">testHit</field>\n" + - " </hit>\n" + - "</result>\n", driver.sendRequest(uri, com.yahoo.jdisc.http.HttpRequest.Method.POST, json.toString(), JSON_CONTENT_TYPE).readAll()); + assertEquals(""" + <?xml version="1.0" encoding="utf-8" ?> + <result total-hit-count="0"> + <hit relevancy="1.0"> + <field name="relevancy">1.0</field> + <field name="uri">testHit</field> + </hit> + </result> + """, driver.sendRequest(uri, com.yahoo.jdisc.http.HttpRequest.Method.POST, json.toString(), JSON_CONTENT_TYPE).readAll()); } @Test @@ -253,13 +254,15 @@ public class JSONSearchHandlerTestCase { } private static final String xmlResult = - "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + - "<result total-hit-count=\"0\">\n" + - " <hit relevancy=\"1.0\">\n" + - " <field name=\"relevancy\">1.0</field>\n" + - " <field name=\"uri\">testHit</field>\n" + - " </hit>\n" + - "</result>\n"; + """ + <?xml version="1.0" encoding="utf-8" ?> + <result total-hit-count="0"> + <hit relevancy="1.0"> + <field name="relevancy">1.0</field> + <field name="uri">testHit</field> + </hit> + </result> + """; private void assertXmlResult(JsonNode json, RequestHandlerTestDriver driver) { assertOkResult(driver.sendRequest(uri, com.yahoo.jdisc.http.HttpRequest.Method.POST, json.toString(), JSON_CONTENT_TYPE), xmlResult); @@ -276,19 +279,6 @@ public class JSONSearchHandlerTestCase { } - private static final String pageResult = - "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + - "<page version=\"1.0\">\n" + - "\n" + - " <content>\n" + - " <hit relevance=\"1.0\">\n" + - " <id>testHit</id>\n" + - " <uri>testHit</uri>\n" + - " </hit>\n" + - " </content>\n" + - "\n" + - "</page>\n"; - private void assertOkResult(RequestHandlerTestDriver.MockResponseHandler response, String expected) { assertEquals(expected, response.readAll()); assertEquals(200, response.getStatus()); @@ -302,7 +292,7 @@ public class JSONSearchHandlerTestCase { configurer.reloadConfig(); SearchHandler newSearchHandler = fetchSearchHandler(configurer); - assertTrue(searchHandler != newSearchHandler, "Do I have a new instance of the search handler?"); + assertNotSame(searchHandler, newSearchHandler, "Do I have a new instance of the search handler?"); return new RequestHandlerTestDriver(newSearchHandler); } @@ -368,23 +358,25 @@ public class JSONSearchHandlerTestCase { @Test void testJsonWithWhereAndGroupingUnderSelect() { - String query = "{\n" + - " \"select\": {\n" + - " \"where\": {\n" + - " \"contains\": [\n" + - " \"field\",\n" + - " \"term\"\n" + - " ]\n" + - " },\n" + - " \"grouping\":[\n" + - " {\n" + - " \"all\": {\n" + - " \"output\": \"count()\"\n" + - " }\n" + - " }\n" + - " ]\n" + - " }\n" + - "}\n"; + String query = """ + { + "select": { + "where": { + "contains": [ + "field", + "term" + ] + }, + "grouping":[ + { + "all": { + "output": "count()" + } + } + ] + } + } + """; String result = driver.sendRequest(uri + "searchChain=echoingQuery", com.yahoo.jdisc.http.HttpRequest.Method.POST, query, JSON_CONTENT_TYPE).readAll(); String expected = "{\"root\":{\"id\":\"toplevel\",\"relevance\":1.0,\"fields\":{\"totalCount\":0},\"children\":[{\"id\":\"Query\",\"relevance\":1.0,\"fields\":{\"query\":\"select * from sources * where field contains \\\"term\\\" | all(output(count()))\"}}]}}"; @@ -393,21 +385,23 @@ public class JSONSearchHandlerTestCase { @Test void testJsonWithWhereAndGroupingSeparate() { - String query = "{\n" + - " \"select.where\": {\n" + - " \"contains\": [\n" + - " \"field\",\n" + - " \"term\"\n" + - " ]\n" + - " },\n" + - " \"select.grouping\":[\n" + - " {\n" + - " \"all\": {\n" + - " \"output\": \"count()\"\n" + - " }\n" + - " }\n" + - " ]\n" + - "}\n"; + String query = """ + { + "select.where": { + "contains": [ + "field", + "term" + ] + }, + "select.grouping":[ + { + "all": { + "output": "count()" + } + } + ] + } + """; String result = driver.sendRequest(uri + "searchChain=echoingQuery", com.yahoo.jdisc.http.HttpRequest.Method.POST, query, JSON_CONTENT_TYPE).readAll(); String expected = "{\"root\":{\"id\":\"toplevel\",\"relevance\":1.0,\"fields\":{\"totalCount\":0},\"children\":[{\"id\":\"Query\",\"relevance\":1.0,\"fields\":{\"query\":\"select * from sources * where field contains \\\"term\\\" | all(output(count()))\"}}]}}"; @@ -539,7 +533,7 @@ public class JSONSearchHandlerTestCase { // Get mapping Map<String, String> propertyMap = request.propertyMap(); - Assertions.assertThat(propertyMap).isEqualTo(map); + assertEquals(propertyMap, map); } @Test diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java index 0bf2610ae14..4eb6e080737 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java @@ -27,7 +27,6 @@ import com.yahoo.vespa.hosted.controller.security.Auth0Credentials; import com.yahoo.vespa.hosted.controller.security.CloudTenantSpec; import com.yahoo.vespa.hosted.controller.security.Credentials; import com.yahoo.vespa.hosted.controller.tenant.CloudTenant; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -35,7 +34,6 @@ import java.io.File; import java.util.Collections; import java.util.Optional; import java.util.Set; -import java.util.regex.Pattern; import static com.yahoo.application.container.handler.Request.Method.DELETE; import static com.yahoo.application.container.handler.Request.Method.GET; @@ -471,13 +469,13 @@ public class ApplicationApiCloudTest extends ControllerContainerCloudTest { String regexGenerateToken = "\\{\"id\":\"myTokenId\",\"token\":\"vespa_cloud_.*\",\"fingerprint\":\".*\"}"; tester.assertResponse(request("/application/v4/tenant/scoober/token/myTokenId", POST).roles(Role.developer(tenantName)), - (response) -> Assertions.assertThat(new String(response.getBody(), UTF_8)).matches(Pattern.compile(regexGenerateToken)), + (response) -> assertTrue(new String(response.getBody(), UTF_8).matches(regexGenerateToken)), 200); String regexListTokens = "\\{\"tokens\":\\[\\{\"id\":\"myTokenId\",\"versions\":\\[\\{\"fingerprint\":\".*\",\"created\":\".*\",\"author\":\"user@test\",\"expiration\":\".*\"}]}]}"; tester.assertResponse(request("/application/v4/tenant/scoober/token", GET) .roles(Role.developer(tenantName)), - (response) -> Assertions.assertThat(new String(response.getBody(), UTF_8)).matches(Pattern.compile(regexListTokens)), + (response) -> assertTrue(new String(response.getBody(), UTF_8).matches(regexListTokens)), 200); // Rejects invalid tokenIds on create diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/dataplanetoken/DataplaneTokenServiceTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/dataplanetoken/DataplaneTokenServiceTest.java index e148eac7365..acfba03a700 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/dataplanetoken/DataplaneTokenServiceTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/dataplanetoken/DataplaneTokenServiceTest.java @@ -15,8 +15,9 @@ import java.security.Principal; import java.time.Duration; import java.util.Collection; import java.util.List; +import java.util.Set; -import static org.assertj.core.api.Assertions.assertThat; +import static java.util.stream.Collectors.toSet; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -43,13 +44,13 @@ public class DataplaneTokenServiceTest { assertNotEquals(dataplaneToken1.fingerPrint(), dataplaneToken2.fingerPrint()); List<DataplaneTokenVersions> dataplaneTokenVersions = dataplaneTokenService.listTokens(tenantName); - List<FingerPrint> tokenFingerprints = dataplaneTokenVersions.stream() + Set<FingerPrint> tokenFingerprints = dataplaneTokenVersions.stream() .filter(token -> token.tokenId().equals(tokenId)) .map(DataplaneTokenVersions::tokenVersions) .flatMap(Collection::stream) .map(DataplaneTokenVersions.Version::fingerPrint) - .toList(); - assertThat(tokenFingerprints).containsExactlyInAnyOrder(dataplaneToken1.fingerPrint(), dataplaneToken2.fingerPrint()); + .collect(toSet()); + assertEquals(tokenFingerprints, Set.of(dataplaneToken1.fingerPrint(), dataplaneToken2.fingerPrint())); } @Test diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java index d0d362abcfc..8d643534e0c 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java @@ -10,11 +10,12 @@ import com.yahoo.vespa.hosted.controller.integration.ZoneRegistryMock; import org.junit.jupiter.api.Test; import java.util.List; +import java.util.Set; import static com.yahoo.vespa.hosted.controller.restapi.systemflags.SystemFlagsDeployResult.FlagDataChange; import static com.yahoo.vespa.hosted.controller.restapi.systemflags.SystemFlagsDeployResult.OperationError; import static com.yahoo.vespa.hosted.controller.restapi.systemflags.SystemFlagsDeployResult.merge; -import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author bjorncs @@ -29,17 +30,15 @@ public class SystemFlagsDeployResultTest { FlagId flagOne = new FlagId("flagone"); FlagId flagTwo = new FlagId("flagtwo"); SystemFlagsDeployResult result = new SystemFlagsDeployResult( - List.of( - FlagDataChange.deleted(flagOne, controllerTarget)), - List.of( - OperationError.deleteFailed("delete failed", controllerTarget, flagTwo)), + List.of(FlagDataChange.deleted(flagOne, controllerTarget)), + List.of(OperationError.deleteFailed("delete failed", controllerTarget, flagTwo)), List.of()); WireSystemFlagsDeployResult wire = result.toWire(); - assertThat(wire.changes).hasSize(1); - assertThat(wire.changes.get(0).flagId).isEqualTo(flagOne.toString()); - assertThat(wire.errors).hasSize(1); - assertThat(wire.errors.get(0).flagId).isEqualTo(flagTwo.toString()); + assertEquals(1, wire.changes.size()); + assertEquals(wire.changes.get(0).flagId, flagOne.toString()); + assertEquals(1, wire.errors.size()); + assertEquals(wire.errors.get(0).flagId, flagTwo.toString()); } @Test @@ -65,13 +64,13 @@ public class SystemFlagsDeployResultTest { SystemFlagsDeployResult mergedResult = merge(results); List<FlagDataChange> changes = mergedResult.flagChanges(); - assertThat(changes).hasSize(1); + assertEquals(1, changes.size()); FlagDataChange change = changes.get(0); - assertThat(change.targets()).containsOnly(controllerTarget, prodUsWest1Target); + assertEquals(change.targets(), Set.of(controllerTarget, prodUsWest1Target)); List<OperationError> errors = mergedResult.errors(); - assertThat(errors).hasSize(1); + assertEquals(1, errors.size()); OperationError error = errors.get(0); - assertThat(error.targets()).containsOnly(controllerTarget, prodUsWest1Target); + assertEquals(error.targets(), Set.of(controllerTarget, prodUsWest1Target)); } }
\ No newline at end of file diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployerTest.java index 8ad64a08244..cb330d28d22 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployerTest.java @@ -25,6 +25,7 @@ import static com.yahoo.vespa.hosted.controller.restapi.systemflags.SystemFlagsD import static com.yahoo.yolean.Exceptions.uncheck; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -174,7 +175,7 @@ public class SystemFlagsDeployerTest { assertThat(result.flagChanges()).containsOnly( FlagDataChange.created(FLAG_ID, controllerTarget, defaultData)); - assertThat(result.errors()).isEmpty(); + assertTrue(result.errors().isEmpty()); } @Test @@ -209,8 +210,7 @@ public class SystemFlagsDeployerTest { .build(); SystemFlagsDeployer deployer = new SystemFlagsDeployer(flagsClient, SYSTEM, Set.of(controllerTarget)); SystemFlagsDeployResult result = deployer.deployFlags(archive, false); - assertThat(result.flagChanges()) - .isEmpty(); + assertTrue(result.flagChanges().isEmpty()); assertThat(result.errors()) .containsOnly(OperationError.archiveValidationFailed("Unknown flag file: flags/my-flag/main.prod.unknown-region.json")); } diff --git a/dependency-versions/pom.xml b/dependency-versions/pom.xml index 5ff4513cdc6..e3bb94b2f27 100644 --- a/dependency-versions/pom.xml +++ b/dependency-versions/pom.xml @@ -59,7 +59,8 @@ <apache.httpclient5.vespa.version>5.2.1</apache.httpclient5.vespa.version> <apache.httpcore5.vespa.version>5.2.2</apache.httpcore5.vespa.version> <apiguardian.vespa.version>1.1.2</apiguardian.vespa.version> - <asm.vespa.version>9.3</asm.vespa.version> + <asm.vespa.version>9.5</asm.vespa.version> + <assertj.vespa.version>3.24.2</assertj.vespa.version> <!-- Athenz dependencies. Make sure these dependencies match those in Vespa's internal repositories --> <athenz.vespa.version>1.11.34</athenz.vespa.version> @@ -73,7 +74,7 @@ xargs perl -pi -e 's/major = [0-9]+, minor = [0-9]+, micro = [0-9]+/major = 5, minor = 3, micro = 0/g' --> <bouncycastle.vespa.version>1.76</bouncycastle.vespa.version> - <curator.vespa.version>5.4.0</curator.vespa.version> + <checker-qual.vespa.version>3.37.0</checker-qual.vespa.version> <commons-codec.vespa.version>1.16.0</commons-codec.vespa.version> <commons-csv.vespa.version>1.10.0</commons-csv.vespa.version> <commons-exec.vespa.version>1.3</commons-exec.vespa.version> @@ -81,6 +82,8 @@ <commons-lang3.vespa.version>3.13.0</commons-lang3.vespa.version> <commons.math3.vespa.version>3.6.1</commons.math3.vespa.version> <commons-compress.vespa.version>1.23.0</commons-compress.vespa.version> + <curator.vespa.version>5.4.0</curator.vespa.version> + <dropwizard.metrics.vespa.version>3.2.6</dropwizard.metrics.vespa.version> <eclipse-collections.vespa.version>11.1.0</eclipse-collections.vespa.version> <felix.vespa.version>7.0.5</felix.vespa.version> <felix.log.vespa.version>1.0.1</felix.log.vespa.version> @@ -94,6 +97,7 @@ <jersey.vespa.version>2.25</jersey.vespa.version> <jetty.vespa.version>11.0.15</jetty.vespa.version> <jetty-servlet-api.vespa.version>5.0.2</jetty-servlet-api.vespa.version> + <jimfs.vespa.version>1.3.0</jimfs.vespa.version> <jna.vespa.version>5.13.0</jna.vespa.version> <joda-time.vespa.version>2.12.5</joda-time.vespa.version> <junit.vespa.version>5.8.1</junit.vespa.version> @@ -103,18 +107,19 @@ <lucene.vespa.version>9.7.0</lucene.vespa.version> <maven-archiver.vespa.version>3.6.1</maven-archiver.vespa.version> <maven-wagon.vespa.version>3.5.3</maven-wagon.vespa.version> - <mimepull.vespa.version>1.9.6</mimepull.vespa.version> + <mimepull.vespa.version>1.10.0</mimepull.vespa.version> <mockito.vespa.version>4.0.0</mockito.vespa.version> <mojo-executor.vespa.version>2.4.0</mojo-executor.vespa.version> <netty.vespa.version>4.1.94.Final</netty.vespa.version> <netty-tcnative.vespa.version>2.0.61.Final</netty-tcnative.vespa.version> <onnxruntime.vespa.version>1.15.1</onnxruntime.vespa.version> - <opennlp.vespa.version>1.9.3</opennlp.vespa.version> + <opennlp.vespa.version>1.9.4</opennlp.vespa.version> <opentest4j.vespa.version>1.3.0</opentest4j.vespa.version> <org.json.vespa.version>20230618</org.json.vespa.version> <org.lz4.vespa.version>1.8.0</org.lz4.vespa.version> - <prometheus.client.vespa.version>0.6.0</prometheus.client.vespa.version> + <prometheus.client.vespa.version>0.16.0</prometheus.client.vespa.version> <protobuf.vespa.version>3.24.2</protobuf.vespa.version> + <questdb.vespa.version>6.2</questdb.vespa.version> <spifly.vespa.version>1.3.6</spifly.vespa.version> <snappy.vespa.version>1.1.10.3</snappy.vespa.version> <surefire.vespa.version>3.1.2</surefire.vespa.version> diff --git a/maven-plugins/allowed-maven-dependencies.txt b/maven-plugins/allowed-maven-dependencies.txt index 3cb617aea87..78c4368a9fe 100644 --- a/maven-plugins/allowed-maven-dependencies.txt +++ b/maven-plugins/allowed-maven-dependencies.txt @@ -56,10 +56,9 @@ org.eclipse.sisu:org.eclipse.sisu.inject:0.3.5 org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.5 org.iq80.snappy:snappy:0.4 org.jdom:jdom2:2.0.6.1 -org.ow2.asm:asm:9.3 -org.ow2.asm:asm-analysis:9.3 -org.ow2.asm:asm-commons:9.3 -org.ow2.asm:asm-tree:9.3 +org.ow2.asm:asm:9.5 +org.ow2.asm:asm-commons:9.5 +org.ow2.asm:asm-tree:9.5 org.slf4j:slf4j-api:1.7.32 org.tukaani:xz:1.9 org.twdata.maven:mojo-executor:2.4.0 diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/prometheus/PrometheusUtil.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/prometheus/PrometheusUtil.java index c2d05a8636e..ecfdb978e29 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/prometheus/PrometheusUtil.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/prometheus/PrometheusUtil.java @@ -13,9 +13,6 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import static java.util.Collections.emptyList; -import static java.util.Collections.singletonList; - /** * @author yj-jtakagi * @author gjoranv @@ -52,7 +49,7 @@ public class PrometheusUtil { } else { sampleList = new ArrayList<>(); samples.put(metricName, sampleList); - metricFamilySamples.add(new MetricFamilySamples(metricName, Collector.Type.UNTYPED, "", sampleList)); + metricFamilySamples.add(new MetricFamilySamples(metricName, Collector.Type.UNKNOWN, "", sampleList)); } sampleList.add(new Sample(metricName, labels, labelValues, metric.getValue().doubleValue(), packet.timestamp * 1000)); } diff --git a/node-repository/pom.xml b/node-repository/pom.xml index 52be67024d0..ff2ad112628 100644 --- a/node-repository/pom.xml +++ b/node-repository/pom.xml @@ -81,7 +81,7 @@ <dependency> <groupId>org.questdb</groupId> <artifactId>questdb</artifactId> - <version>6.2</version> + <version>${questdb.vespa.version}</version> <scope>compile</scope> </dependency> <dependency> diff --git a/parent/pom.xml b/parent/pom.xml index a18cd4a6576..f6a2cba379c 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -548,7 +548,7 @@ <dependency> <groupId>com.google.jimfs</groupId> <artifactId>jimfs</artifactId> - <version>1.2</version> + <version>${jimfs.vespa.version}</version> <scope>test</scope> <!-- TODO: remove scope from parent pom --> </dependency> <dependency> @@ -899,7 +899,7 @@ <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> - <version>3.11.1</version> + <version>${assertj.vespa.version}</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> @@ -1114,7 +1114,7 @@ <dependency> <groupId>io.dropwizard.metrics</groupId> <artifactId>metrics-core</artifactId> - <version>3.2.5</version> + <version>${dropwizard.metrics.vespa.version}</version> </dependency> <dependency> <groupId>xerces</groupId> @@ -1134,7 +1134,7 @@ <dependency> <groupId>org.checkerframework</groupId> <artifactId>checker-qual</artifactId> - <version>3.30.0</version> + <version>${checker-qual.vespa.version}</version> </dependency> <dependency> <groupId>com.google.http-client</groupId> diff --git a/testutil/src/main/java/com/yahoo/vespa/test/file/UnixUidGidAttributeProvider.java b/testutil/src/main/java/com/yahoo/vespa/test/file/UnixUidGidAttributeProvider.java index 903706a503d..25f66bf5cb0 100644 --- a/testutil/src/main/java/com/yahoo/vespa/test/file/UnixUidGidAttributeProvider.java +++ b/testutil/src/main/java/com/yahoo/vespa/test/file/UnixUidGidAttributeProvider.java @@ -22,7 +22,6 @@ import com.google.common.jimfs.File; import com.google.common.jimfs.FileLookup; import java.nio.file.attribute.FileAttributeView; -import java.nio.file.attribute.FileTime; import java.nio.file.attribute.GroupPrincipal; import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.UserPrincipal; @@ -79,41 +78,39 @@ public class UnixUidGidAttributeProvider extends AttributeProvider { @SuppressWarnings("unchecked") @Override public Object get(File file, String attribute) { - switch (attribute) { - case "uid": - UserPrincipal user = (UserPrincipal) file.getAttribute("owner", "owner"); - return getUniqueId(user); - case "gid": - GroupPrincipal group = (GroupPrincipal) file.getAttribute("posix", "group"); - return getUniqueId(group); - case "mode": - Set<PosixFilePermission> permissions = - (Set<PosixFilePermission>) file.getAttribute("posix", "permissions"); - return toMode(permissions); - case "ctime": - return FileTime.fromMillis(file.getCreationTime()); - case "rdev": - return 0L; - case "dev": - return 1L; - case "ino": - return file.id(); - case "nlink": - return file.links(); - default: - return null; - } + return switch (attribute) { + case "uid" -> { + var user = (UserPrincipal) file.getAttribute("owner", "owner"); + yield getUniqueId(user); + } + case "gid" -> { + var group = (GroupPrincipal) file.getAttribute("posix", "group"); + yield getUniqueId(group); + } + case "mode" -> { + var permissions = (Set<PosixFilePermission>) file.getAttribute("posix", "permissions"); + yield toMode(permissions); + } + case "ctime" -> file.getCreationTime(); + case "rdev" -> 0L; + case "dev" -> 1L; + case "ino" -> file.id(); + case "nlink" -> file.links(); + default -> null; + }; } @Override public void set(File file, String view, String attribute, Object value, boolean create) { switch (attribute) { - case "uid": + case "uid" -> { file.setAttribute("owner", "owner", new BasicUserPrincipal(String.valueOf(value))); return; - case "gid": + } + case "gid" -> { file.setAttribute("posix", "group", new BasicGroupPrincipal(String.valueOf(value))); return; + } } throw unsettable(view, attribute, create); } @@ -124,35 +121,16 @@ public class UnixUidGidAttributeProvider extends AttributeProvider { for (PosixFilePermission permission : permissions) { checkNotNull(permission); switch (permission) { - case OWNER_READ: - result |= 0400; - break; - case OWNER_WRITE: - result |= 0200; - break; - case OWNER_EXECUTE: - result |= 0100; - break; - case GROUP_READ: - result |= 0040; - break; - case GROUP_WRITE: - result |= 0020; - break; - case GROUP_EXECUTE: - result |= 0010; - break; - case OTHERS_READ: - result |= 0004; - break; - case OTHERS_WRITE: - result |= 0002; - break; - case OTHERS_EXECUTE: - result |= 0001; - break; - default: - throw new AssertionError(); // no other possible values + case OWNER_READ -> result |= 0400; + case OWNER_WRITE -> result |= 0200; + case OWNER_EXECUTE -> result |= 0100; + case GROUP_READ -> result |= 0040; + case GROUP_WRITE -> result |= 0020; + case GROUP_EXECUTE -> result |= 0010; + case OTHERS_READ -> result |= 0004; + case OTHERS_WRITE -> result |= 0002; + case OTHERS_EXECUTE -> result |= 0001; + default -> throw new AssertionError(); // no other possible values } } return result; diff --git a/vespa-dependencies-enforcer/allowed-maven-dependencies.txt b/vespa-dependencies-enforcer/allowed-maven-dependencies.txt index 9dc1b0d2fda..f26ae6ab16d 100644 --- a/vespa-dependencies-enforcer/allowed-maven-dependencies.txt +++ b/vespa-dependencies-enforcer/allowed-maven-dependencies.txt @@ -59,7 +59,7 @@ commons-fileupload:commons-fileupload:1.5 commons-io:commons-io:2.13.0 commons-logging:commons-logging:1.2 io.airlift:airline:0.9 -io.dropwizard.metrics:metrics-core:3.2.5 +io.dropwizard.metrics:metrics-core:3.2.6 io.grpc:grpc-context:1.27.2 io.jsonwebtoken:jjwt-api:0.11.5 io.jsonwebtoken:jjwt-impl:0.11.5 @@ -77,8 +77,11 @@ io.netty:netty-transport-native-epoll:4.1.94.Final io.netty:netty-transport-native-unix-common:4.1.94.Final io.opencensus:opencensus-api:0.31.1 io.opencensus:opencensus-contrib-http-util:0.31.1 -io.prometheus:simpleclient:0.6.0 -io.prometheus:simpleclient_common:0.6.0 +io.prometheus:simpleclient:0.16.0 +io.prometheus:simpleclient_common:0.16.0 +io.prometheus:simpleclient_tracer_common:0.16.0 +io.prometheus:simpleclient_tracer_otel:0.16.0 +io.prometheus:simpleclient_tracer_otel_agent:0.16.0 javax.annotation:javax.annotation-api:1.2 javax.inject:javax.inject:1 javax.servlet:javax.servlet-api:3.1.0 @@ -124,7 +127,7 @@ org.apache.maven.plugin-tools:maven-plugin-annotations:3.9.0 org.apache.maven.plugins:maven-jar-plugin:3.3.0 org.apache.maven.shared:file-management:3.1.0 org.apache.maven.wagon:wagon-provider-api:3.5.3 -org.apache.opennlp:opennlp-tools:1.9.3 +org.apache.opennlp:opennlp-tools:1.9.4 org.apache.velocity:velocity-engine-core:2.3 org.apache.yetus:audience-annotations:0.12.0 org.apache.zookeeper:zookeeper:3.8.0 @@ -192,17 +195,17 @@ org.junit.jupiter:junit-jupiter-engine:5.8.1 org.junit.platform:junit-platform-commons:1.8.1 org.junit.platform:junit-platform-engine:1.8.1 org.junit.platform:junit-platform-launcher:1.8.1 -org.jvnet.mimepull:mimepull:1.9.6 +org.jvnet.mimepull:mimepull:1.10.0 org.kohsuke:libpam4j:1.11 org.lz4:lz4-java:1.8.0 org.opentest4j:opentest4j:1.3.0 org.osgi:org.osgi.compendium:4.1.0 org.osgi:org.osgi.core:4.1.0 -org.ow2.asm:asm:9.3 -org.ow2.asm:asm-analysis:9.3 -org.ow2.asm:asm-commons:9.3 -org.ow2.asm:asm-tree:9.3 -org.ow2.asm:asm-util:9.3 +org.ow2.asm:asm:9.5 +org.ow2.asm:asm-analysis:9.5 +org.ow2.asm:asm-commons:9.5 +org.ow2.asm:asm-tree:9.5 +org.ow2.asm:asm-util:9.5 org.questdb:questdb:6.2 org.slf4j:jcl-over-slf4j:1.7.32 org.slf4j:log4j-over-slf4j:1.7.32 @@ -220,12 +223,13 @@ xml-apis:xml-apis:1.4.01 com.github.tomakehurst:wiremock-jre8-standalone:2.35.0 com.google.guava:guava-testlib:32.1.1-jre com.google.inject:guice:4.2.3 -com.google.jimfs:jimfs:1.2 +com.google.jimfs:jimfs:1.3.0 net.bytebuddy:byte-buddy:1.11.19 +net.bytebuddy:byte-buddy:1.12.21 net.bytebuddy:byte-buddy-agent:1.11.19 org.apache.curator:curator-test:5.4.0 -org.assertj:assertj-core:3.11.1 -org.checkerframework:checker-qual:3.30.0 +org.assertj:assertj-core:3.24.2 +org.checkerframework:checker-qual:3.37.0 org.junit.jupiter:junit-jupiter:5.8.1 org.junit.jupiter:junit-jupiter-params:5.8.1 org.junit.vintage:junit-vintage-engine:5.8.1 |