Skip to content

Commit

Permalink
test: Adding missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maximedezette committed Oct 29, 2023
1 parent 6fa1d40 commit 1ecebac
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/java/com/globaldashboard/ServletInitializerTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.globaldashboard;

import org.junit.jupiter.api.Test;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.context.SpringBootTest;

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


@SpringBootTest
class ServletInitializerTest {

private static String getSourceName(SpringApplicationBuilder application) {
return application.build().getAllSources().stream().toList().get(0).toString();
}

@Test
void shouldInitializeApplication() {
SpringApplicationBuilder application = new SpringApplicationBuilder();
ServletInitializer servletInitializer = new ServletInitializer();

servletInitializer.configure(application);

assertThat(application.build().getAllSources()).hasSize(1);
assertThat(getSourceName(application)).isEqualTo("class com.globaldashboard.GlobalDependenciesDashboardApplication");
}
}

0 comments on commit 1ecebac

Please sign in to comment.