File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
spring-boot-testjars/src/test/java/org/springframework/experimental/boot/server/exec Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change 1616
1717package org .springframework .experimental .boot .server .exec ;
1818
19+ import java .io .File ;
20+ import java .util .List ;
21+ import java .util .Optional ;
22+
1923import org .junit .jupiter .api .Test ;
2024
2125import org .springframework .boot .SpringBootVersion ;
2226
27+ import static org .assertj .core .api .Assertions .assertThat ;
28+
2329class MavenClasspathEntryTests {
2430
2531 @ Test
26- void go () {
27- MavenClasspathEntry classpath = new MavenClasspathEntry (
28- "org.springframework.boot:spring-boot-starter-oauth2-authorization-server:"
29- + SpringBootVersion .getVersion ());
30- classpath .resolve ();
32+ void springBootStarter () {
33+ MavenClasspathEntry classpath = MavenClasspathEntry .springBootStarter ("web" );
34+ List <String > entries = classpath .resolve ();
35+ assertThat (entries ).hasSizeGreaterThan (5 );
36+ String mavenLocal = new File (System .getProperty ("user.home" ), ".m2/repository" ).getAbsolutePath ();
37+ entries .forEach ((entry ) -> assertThat (entry ).startsWith (mavenLocal ));
38+ String starterWebPathPartial = "/org/springframework/boot/spring-boot-starter-web/"
39+ + SpringBootVersion .getVersion () + "/spring-boot-starter-web-" + SpringBootVersion .getVersion ()
40+ + ".jar" ;
41+ Optional <String > starterWebEntry = entries .stream ().filter ((entry ) -> entry .contains (starterWebPathPartial ))
42+ .findFirst ();
43+ assertThat (starterWebEntry .isPresent ())
44+ .withFailMessage ("Unable to find spring-boot-starter with path that contains " + starterWebPathPartial )
45+ .isTrue ();
3146 }
3247
3348}
You can’t perform that action at this time.
0 commit comments