forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 3
/
WebJarResourceTest.java
33 lines (27 loc) · 1.09 KB
/
WebJarResourceTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package io.quarkus.it.webjar.locator;
import org.junit.jupiter.api.Test;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
@QuarkusTest
public class WebJarResourceTest {
@Test
void testWebJar() {
// Test Existing Web Jars
RestAssured.get("/webjars/jquery/jquery.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/min/moment.min.js").then()
.statusCode(200);
// Test using version in url of existing Web Jar
RestAssured.get("/webjars/jquery/3.4.1/jquery.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/2.24.0/min/moment.min.js").then()
.statusCode(200);
// Test non-existing Web Jar
RestAssured.get("/webjars/bootstrap/js/bootstrap.min.js").then()
.statusCode(404);
RestAssured.get("/webjars/bootstrap/4.3.1/js/bootstrap.min.js").then()
.statusCode(404);
RestAssured.get("/webjars/momentjs/2.25.0/min/moment.min.js").then()
.statusCode(404);
}
}