Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump org.webjars:bootstrap from 5.3.2 to 5.3.3 #17

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion embedded/path-mapping-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.3.2</version>
<version>5.3.3</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
package examples;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.Properties;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.component.LifeCycle;
Expand All @@ -30,6 +33,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class PathMappingServerTest
{
Expand Down Expand Up @@ -90,14 +94,29 @@ public void testGetExtrasResource() throws IOException, InterruptedException
@Test
public void testGetMetaInfResource() throws IOException, InterruptedException
{
Properties props = loadClassPathProperties("/META-INF/maven/org.webjars/bootstrap/pom.properties");
String version = props.getProperty("version");

HttpClient client = HttpClient.newBuilder().build();
HttpRequest request = HttpRequest.newBuilder()
.uri(server.getURI().resolve("/jars/webjars/bootstrap/5.3.2/js/bootstrap.bundle.js"))
.uri(server.getURI().resolve("/jars/webjars/bootstrap/@VER@/js/bootstrap.bundle.js".replace("@VER@", version)))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
assertThat(response.statusCode(), is(200));
assertThat(response.body(), containsString("* Bootstrap v5.3.2 (https://getbootstrap.com/)"));
assertThat(response.body(), containsString("* Bootstrap v@VER@ (https://getbootstrap.com/)".replace("@VER@", version)));
}

private Properties loadClassPathProperties(String resourceName) throws IOException
{
URL url = PathMappingServerTest.class.getResource(resourceName);
assertNotNull(url, "Unable to find: " + resourceName);
try (InputStream input = url.openStream())
{
Properties props = new Properties();
props.load(input);
return props;
}
}

/**
Expand Down
Loading