Skip to content

Commit

Permalink
Fix Sonar test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ak-git committed Sep 28, 2024
1 parent 1069bc3 commit 24697df
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mnt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ dependencies {
compileOnly("io.micronaut:micronaut-http-client")
runtimeOnly("io.micronaut.serde:micronaut-serde-jackson")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("org.yaml:snakeyaml")
implementation("org.yaml:snakeyaml")

testImplementation(platform(libs.junit))
testImplementation libs.bundles.test.implementation
testCompileOnly libs.bundles.test.compile
testRuntimeOnly libs.bundles.test.runtime
testRuntimeOnly("ch.qos.logback:logback-classic")
}

application {
Expand Down
12 changes: 11 additions & 1 deletion mnt/src/main/java/com/ak/micronaut/Application.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
package com.ak.micronaut;

import io.micronaut.context.ApplicationContext;
import io.micronaut.runtime.Micronaut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Application {
private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);

private Application() {
}

public static void main(String[] args) {
Micronaut.run(Application.class, args);
ApplicationContext context = Micronaut.run(Application.class, args);
String appName = context.getEnvironment().get("micronaut.application.name", String.class).orElse("");
LOGGER.info("{} running = {}", appName, context.isRunning());
}
}
2 changes: 2 additions & 0 deletions mnt/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
requires org.slf4j;
requires jakarta.inject;
requires jakarta.annotation;
requires org.yaml.snakeyaml;
requires io.micronaut.context;
requires io.micronaut.inject;
}

0 comments on commit 24697df

Please sign in to comment.