Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrizzio-dotCMS committed Jun 13, 2024
1 parent 72e22f0 commit 6b5c205
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
import com.dotcms.model.asset.BuildVersion;
import java.util.Optional;

/**
* Service to get the version of the build
*/
public interface BuiltVersionService {

boolean isBuildPropertiesFileFound();

/**
* Check if the build.properties file was found
* @return true if the build.properties file was found
*/
Optional<BuildVersion> version();

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,4 @@ private Properties loadProperties() throws IOException{
return props;
}

public boolean isBuildPropertiesFileFound(){
try (InputStream input = getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE)) {
return input != null;
} catch (IOException e) {
return false;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class BuiltVersionServiceIT {
*/
@Test
void testVersion() {

Assertions.assertTrue(builtVersionService.isBuildPropertiesFileFound(), "The build.properties file was not found");

Optional<BuildVersion> version = builtVersionService.version();
Assertions.assertTrue(version.isPresent());
Assertions.assertNotNull(version.get().name());
Expand Down

0 comments on commit 6b5c205

Please sign in to comment.