diff --git a/pom.xml b/pom.xml index 654d5277b1a..2dc6d167379 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,7 @@ spring-boot-admin-starter-server spring-boot-admin-starter-client spring-boot-admin-samples + spring-boot-admin-pitest-aggregation codecentric AG @@ -152,7 +153,7 @@ src/checkstyle/checkstyle-header.txt true true - true + false @@ -236,6 +237,42 @@ + + + + org.pitest + pitest-maven + 1.17.1 + + false + + **DiffblueTest* + + true + + XML + HTML + + false + + + + run-mutation-tests + + mutationCoverage + + + + + + org.pitest + pitest-junit5-plugin + 1.2.1 + + + + + diff --git a/spring-boot-admin-client/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-client/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..e8102d9f0fd --- /dev/null +++ b/spring-boot-admin-client/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-client/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-client/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..c3bdfcbd8c1 --- /dev/null +++ b/spring-boot-admin-client/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-client/.diffblue/reports/report.json b/spring-boot-admin-client/.diffblue/reports/report.json new file mode 100644 index 00000000000..f0c3df77c2d --- /dev/null +++ b/spring-boot-admin-client/.diffblue/reports/report.json @@ -0,0 +1,2661 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:17:15.110186887Z", + "command" : "dcover coverage-reports ", + "totalTime" : 138.802, + "environmentDetectionTime" : 76.872, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 138.803, + "timeToLastTest" : 138.803, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T002" : "Trivial setter", + "T003" : "Private method", + "T004" : "In anonymous inner class", + "T005" : "Trivial constructor", + "T007" : "Framework configuration callback", + "T010" : "Abstract or interface method", + "T012" : "Synthetic method", + "T023" : "Testability unknown" + }, + "summary" : { + "classesCount" : 36, + "methodsCount" : 203, + "cumulativeDiffblueTestCount" : 65, + "cumulativeManualTestCount" : 86, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 1120, + "perMethodTestability" : { + "T000" : 70, + "T002" : 3, + "T003" : 4, + "T004" : 3, + "T005" : 20, + "T007" : 2, + "T010" : 7, + "T012" : 87, + "T023" : 7 + }, + "perMethodOutcome" : { + "T000" : 70, + "T002" : 3, + "T003" : 4, + "T004" : 3, + "T005" : 20, + "T007" : 2, + "T010" : 7, + "T012" : 87, + "T023" : 7 + } + }, + "classes" : { + "de.codecentric.boot.admin.client.config.ClientProperties" : { + "methodsCount" : 29, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 27 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 27 + } + }, + "de.codecentric.boot.admin.client.config.ClientRuntimeHints" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties" : { + "methodsCount" : 11, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 11 + }, + "perMethodOutcome" : { + "T012" : 11 + } + }, + "de.codecentric.boot.admin.client.config.InstanceProperties" : { + "methodsCount" : 25, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 25 + }, + "perMethodOutcome" : { + "T012" : 25 + } + }, + "de.codecentric.boot.admin.client.config.ServiceHostType" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1, + "T012" : 3, + "T023" : 1 + }, + "perMethodOutcome" : { + "T003" : 1, + "T012" : 3, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$BlockingRegistrationClientConfig" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ReactiveConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ReactiveRegistrationClientConfig" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$RestClientRegistrationClientConfig" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ServletConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientCloudFoundryAutoConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 1 + } + }, + "de.codecentric.boot.admin.client.config.SpringNativeClientAutoConfiguration" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1 + }, + "perMethodOutcome" : { + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.Application" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1, + "T012" : 9 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1, + "T012" : 9 + } + }, + "de.codecentric.boot.admin.client.registration.Application$Builder" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 10 + }, + "perMethodOutcome" : { + "T012" : 10 + } + }, + "de.codecentric.boot.admin.client.registration.ApplicationFactory" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.ApplicationRegistrator" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 3 + }, + "perMethodOutcome" : { + "T010" : 3 + } + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.CloudFoundryApplicationFactory" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory" : { + "methodsCount" : 21, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 20, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 20, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T023" : 1 + }, + "perMethodOutcome" : { + "T023" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T005" : 1, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 1, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.ReactiveApplicationFactory" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener" : { + "methodsCount" : 13, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 6, + "T002" : 3, + "T003" : 1, + "T007" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 6, + "T002" : 3, + "T003" : 1, + "T007" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.RegistrationClient" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 2 + }, + "perMethodOutcome" : { + "T010" : 2 + } + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.ServletApplicationFactory" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.metadata.CloudFoundryMetadataContributor" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.metadata.CompositeMetadataContributor" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.metadata.MetadataContributor" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.client.registration.metadata.StartupDateMetadataContributor" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2 + }, + "perMethodOutcome" : { + "T000" : 2 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.client.config.ClientProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28, + 35, + 40, + 45, + 46, + 51, + 52, + 57, + 58, + 76, + 82, + 87, + 92 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getAdminUrl:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 95, + 96, + 97, + 96, + 99 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getApiPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 40 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getAutoDeregistration:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 77 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getConnectTimeout:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 52 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getPassword:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 70 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getPeriod:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getReadTimeout:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getUrl:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 35 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.getUsername:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 64 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.isAutoDeregistration:(Lorg/springframework/core/env/Environment;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 103, + 104, + 103 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.isAutoRegistration:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 82 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.isEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 92 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.isRegisterOnce:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 87 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setApiPath:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setAutoDeregistration:(Ljava/lang/Boolean;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setAutoRegistration:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setConnectTimeout:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setEnabled:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setPassword:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setPeriod:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setReadTimeout:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setRegisterOnce:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setUrl:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.setUsername:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.client.config.ClientRuntimeHints.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.client.config.ClientRuntimeHints.registerHints:(Lorg/springframework/aot/hint/RuntimeHints;Ljava/lang/ClassLoader;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 35, + 36 + ] + }, + "de.codecentric.boot.admin.client.config.ClientRuntimeHints.registerReflectionHints:(Lorg/springframework/aot/hint/RuntimeHints;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 40, + 41, + 43, + 45, + 46, + 47, + 48, + 38, + 50 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25, + 35 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.getApplicationId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.getInstanceIndex:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.getUris:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 35 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.setApplicationId:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.setInstanceIndex:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.setUris:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25 + ] + }, + "de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 25 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26, + 75, + 82, + 88, + 93 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getHealthUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 70 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getManagementBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getManagementUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 35 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 93 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getServiceBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 56 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getServiceHostType:()Lde/codecentric/boot/admin/client/config/ServiceHostType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 88 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getServicePath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 63 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.getServiceUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 49 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.isPreferIp:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setHealthUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setManagementBaseUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setManagementUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setMetadata:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setName:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setPreferIp:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setServiceBaseUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setServiceHostType:(Lde/codecentric/boot/admin/client/config/ServiceHostType;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setServicePath:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.setServiceUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.InstanceProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.client.config.ServiceHostType.$values:()[Lde/codecentric/boot/admin/client/config/ServiceHostType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.client.config.ServiceHostType.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.client.config.ServiceHostType.:(Ljava/lang/String;I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.client.config.ServiceHostType.valueOf:(Ljava/lang/String;)Lde/codecentric/boot/admin/client/config/ServiceHostType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.client.config.ServiceHostType.values:()[Lde/codecentric/boot/admin/client/config/ServiceHostType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$BlockingRegistrationClientConfig.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 143 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$BlockingRegistrationClientConfig.registrationClient:(Lde/codecentric/boot/admin/client/config/ClientProperties;)Lde/codecentric/boot/admin/client/registration/RegistrationClient;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 148, + 149, + 151, + 152, + 155, + 156 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ReactiveConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 126 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ReactiveConfiguration.applicationFactory:(Lde/codecentric/boot/admin/client/config/InstanceProperties;Lorg/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties;Lorg/springframework/boot/autoconfigure/web/ServerProperties;Lorg/springframework/boot/actuate/endpoint/web/PathMappedEndpoints;Lorg/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties;Lorg/springframework/beans/factory/ObjectProvider;Lorg/springframework/boot/autoconfigure/web/reactive/WebFluxProperties;)Lde/codecentric/boot/admin/client/registration/ApplicationFactory;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 134, + 135, + 134 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ReactiveRegistrationClientConfig.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 187 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ReactiveRegistrationClientConfig.registrationClient:(Lde/codecentric/boot/admin/client/config/ClientProperties;Lorg/springframework/web/reactive/function/client/WebClient$Builder;)Lde/codecentric/boot/admin/client/registration/RegistrationClient;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 192, + 193, + 195 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$RestClientRegistrationClientConfig.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 163 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$RestClientRegistrationClientConfig.registrationClient:(Lde/codecentric/boot/admin/client/config/ClientProperties;Lorg/springframework/web/client/RestClient$Builder;Lorg/springframework/boot/http/client/ClientHttpRequestFactoryBuilder;)Lde/codecentric/boot/admin/client/registration/RegistrationClient;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 169, + 170, + 171, + 172, + 173, + 174, + 175, + 176, + 178, + 179 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ServletConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 107 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration$ServletConfiguration.applicationFactory:(Lde/codecentric/boot/admin/client/config/InstanceProperties;Lorg/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties;Lorg/springframework/boot/autoconfigure/web/ServerProperties;Ljakarta/servlet/ServletContext;Lorg/springframework/boot/actuate/endpoint/web/PathMappedEndpoints;Lorg/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties;Lorg/springframework/beans/factory/ObjectProvider;Lorg/springframework/boot/autoconfigure/web/servlet/DispatcherServletPath;)Lde/codecentric/boot/admin/client/registration/ApplicationFactory;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 116, + 118, + 116 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 77 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration.registrationListener:(Lde/codecentric/boot/admin/client/config/ClientProperties;Lde/codecentric/boot/admin/client/registration/ApplicationRegistrator;Lorg/springframework/core/env/Environment;)Lde/codecentric/boot/admin/client/registration/RegistrationApplicationListener;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 91, + 92, + 93, + 94, + 95 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration.registrator:(Lde/codecentric/boot/admin/client/registration/RegistrationClient;Lde/codecentric/boot/admin/client/config/ClientProperties;Lde/codecentric/boot/admin/client/registration/ApplicationFactory;)Lde/codecentric/boot/admin/client/registration/ApplicationRegistrator;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 83, + 84, + 83 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration.startupDateMetadataContributor:()Lde/codecentric/boot/admin/client/registration/metadata/StartupDateMetadataContributor;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 101 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientCloudFoundryAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 49 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientCloudFoundryAutoConfiguration.applicationFactory:(Lde/codecentric/boot/admin/client/config/InstanceProperties;Lorg/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties;Lorg/springframework/boot/autoconfigure/web/ServerProperties;Lorg/springframework/boot/actuate/endpoint/web/PathMappedEndpoints;Lorg/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties;Lorg/springframework/beans/factory/ObjectProvider;Lde/codecentric/boot/admin/client/config/CloudFoundryApplicationProperties;)Lde/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactory;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 66, + 65 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientCloudFoundryAutoConfiguration.cloudFoundryMetadataContributor:(Lde/codecentric/boot/admin/client/config/CloudFoundryApplicationProperties;)Lde/codecentric/boot/admin/client/registration/metadata/CloudFoundryMetadataContributor;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition.getClientProperties:(Lorg/springframework/context/annotation/ConditionContext;)Lde/codecentric/boot/admin/client/config/ClientProperties;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 58, + 59, + 60 + ] + }, + "de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition.getMatchOutcome:(Lorg/springframework/context/annotation/ConditionContext;Lorg/springframework/core/type/AnnotatedTypeMetadata;)Lorg/springframework/boot/autoconfigure/condition/ConditionOutcome;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 42, + 44, + 45, + 46, + 45, + 49, + 50, + 51, + 50, + 54 + ] + }, + "de.codecentric.boot.admin.client.config.SpringNativeClientAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.build:()Lde/codecentric/boot/admin/client/registration/Application;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.clearMetadata:()Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.healthUrl:(Ljava/lang/String;)Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.managementUrl:(Ljava/lang/String;)Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.metadata:(Ljava/lang/String;Ljava/lang/String;)Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.metadata:(Ljava/util/Map;)Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.name:(Ljava/lang/String;)Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.serviceUrl:(Ljava/lang/String;)Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application$Builder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.builder:()Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.create:(Ljava/lang/String;)Lde/codecentric/boot/admin/client/registration/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 57 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.getHealthUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.getManagementUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 61 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.getName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.getServiceUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 40 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.client.registration.Application.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.client.registration.ApplicationFactory.createApplication:()Lde/codecentric/boot/admin/client/registration/Application;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.client.registration.ApplicationRegistrator.deregister:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.client.registration.ApplicationRegistrator.getRegisteredId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.client.registration.ApplicationRegistrator.register:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 32 + ] + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient.:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 37, + 38, + 39 + ] + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient.createRequestHeaders:()Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 54, + 55, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient.deregister:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 50, + 51 + ] + }, + "de.codecentric.boot.admin.client.registration.BlockingRegistrationClient.register:(Ljava/lang/String;Lde/codecentric/boot/admin/client/registration/Application;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 43, + 44, + 43, + 45 + ] + }, + "de.codecentric.boot.admin.client.registration.CloudFoundryApplicationFactory.:(Lde/codecentric/boot/admin/client/config/InstanceProperties;Lorg/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties;Lorg/springframework/boot/autoconfigure/web/ServerProperties;Lorg/springframework/boot/actuate/endpoint/web/PathMappedEndpoints;Lorg/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties;Lde/codecentric/boot/admin/client/registration/metadata/MetadataContributor;Lde/codecentric/boot/admin/client/config/CloudFoundryApplicationProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 38, + 39, + 40, + 41 + ] + }, + "de.codecentric.boot.admin.client.registration.CloudFoundryApplicationFactory.getServiceBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 46, + 47, + 50, + 51, + 54 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.:(Lde/codecentric/boot/admin/client/config/InstanceProperties;Lorg/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties;Lorg/springframework/boot/autoconfigure/web/ServerProperties;Lorg/springframework/boot/actuate/endpoint/web/PathMappedEndpoints;Lorg/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties;Lde/codecentric/boot/admin/client/registration/metadata/MetadataContributor;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.createApplication:()Lde/codecentric/boot/admin/client/registration/Application;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80, + 81, + 82, + 83, + 84, + 79 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getEndpointsWebPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getHealthEndpointPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 219, + 220, + 221, + 223, + 224, + 225, + 227 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getHealthUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 162, + 163, + 165, + 166, + 167, + 168, + 165 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getHost:(Ljava/net/InetAddress;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 235, + 236, + 239, + 241, + 243, + 246 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getLocalHost:()Ljava/net/InetAddress;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 196, + 198, + 199 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getLocalManagementPort:()Ljava/lang/Integer;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 212, + 213, + 215 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getLocalServerPort:()Ljava/lang/Integer;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 204, + 205, + 208 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getManagementBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 135, + 137, + 138, + 141, + 142, + 145, + 146, + 147, + 148, + 149, + 150, + 146 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getManagementHost:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 187, + 188, + 189, + 191 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getManagementUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 124, + 125, + 128, + 129, + 130, + 131, + 128 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 172, + 173, + 174, + 175 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 88 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getScheme:(Lorg/springframework/boot/web/server/Ssl;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 231 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getServiceBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 100, + 102, + 103, + 106, + 107, + 108, + 109, + 110, + 106 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getServiceHost:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 179, + 180, + 181, + 183 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getServicePath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 114, + 116, + 117, + 120 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getServiceUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 92, + 93, + 96 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.isManagementPortEqual:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 154 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.onWebServerInitialized:(Lorg/springframework/boot/web/context/WebServerInitializedEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 252, + 253, + 254, + 256, + 257, + 259 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.:(Lde/codecentric/boot/admin/client/registration/ApplicationFactory;Lde/codecentric/boot/admin/client/registration/RegistrationClient;[Ljava/lang/String;Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 43, + 30, + 32, + 44, + 45, + 46, + 47, + 48 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.deregister:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 105, + 106, + 107, + 110, + 112, + 113, + 114, + 115, + 121, + 118, + 119, + 120, + 119, + 110, + 123 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.getRegisteredId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.lambda$register$0:(Ljava/lang/String;)Ljava/util/concurrent/atomic/LongAdder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.register:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 56, + 57, + 59, + 60, + 61, + 63, + 64, + 67, + 68, + 69, + 70, + 59, + 75 + ] + }, + "de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.register:(Lde/codecentric/boot/admin/client/registration/Application;Ljava/lang/String;Z)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 80, + 81, + 82, + 85, + 87, + 89, + 90, + 91, + 93, + 91, + 96, + 97, + 96, + 99 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveApplicationFactory.:(Lde/codecentric/boot/admin/client/config/InstanceProperties;Lorg/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties;Lorg/springframework/boot/autoconfigure/web/ServerProperties;Lorg/springframework/boot/actuate/endpoint/web/PathMappedEndpoints;Lorg/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties;Lde/codecentric/boot/admin/client/registration/metadata/MetadataContributor;Lorg/springframework/boot/autoconfigure/web/reactive/WebFluxProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 44, + 45, + 46, + 47, + 48, + 49 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveApplicationFactory.getManagementBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 67, + 68, + 71, + 72, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 76 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveApplicationFactory.getManagementContextPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 85 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveApplicationFactory.getServiceUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 53, + 54, + 57, + 58, + 59, + 60, + 57 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveApplicationFactory.getWebfluxBasePath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient.:(Lorg/springframework/web/reactive/function/client/WebClient;Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 37, + 38, + 39, + 40 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient.deregister:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 57, + 58 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient.register:(Ljava/lang/String;Lde/codecentric/boot/admin/client/registration/Application;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ] + }, + "de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient.setRequestHeaders:(Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 61, + 62, + 63 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.:(Lde/codecentric/boot/admin/client/registration/ApplicationRegistrator;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 58, + 59 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.:(Lde/codecentric/boot/admin/client/registration/ApplicationRegistrator;Lorg/springframework/scheduling/concurrent/ThreadPoolTaskScheduler;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69, + 48, + 50, + 52, + 70, + 71, + 72 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.afterPropertiesSet:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T007", + "perMethodOutcome" : "T007", + "lineNumbers" : [ + 125, + 126 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.destroy:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T007", + "perMethodOutcome" : "T007", + "lineNumbers" : [ + 130, + 131 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.onApplicationReady:(Lorg/springframework/boot/context/event/ApplicationReadyEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 77, + 78, + 80 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.onClosedContext:(Lorg/springframework/context/event/ContextClosedEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 85, + 86, + 87, + 89, + 90, + 93 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.registrationTaskScheduler:()Lorg/springframework/scheduling/concurrent/ThreadPoolTaskScheduler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 62, + 63, + 64, + 65, + 66 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.setAutoDeregister:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 112, + 113 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.setAutoRegister:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 116, + 117 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.setRegisterPeriod:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 120, + 121 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.startRegisterTask:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 96, + 97, + 100, + 101, + 102 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationApplicationListener.stopRegisterTask:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 105, + 106, + 107, + 109 + ] + }, + "de.codecentric.boot.admin.client.registration.RegistrationClient.deregister:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.client.registration.RegistrationClient.register:(Ljava/lang/String;Lde/codecentric/boot/admin/client/registration/Application;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient.:(Lorg/springframework/web/client/RestClient;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 34, + 35, + 36 + ] + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient.deregister:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 51, + 52 + ] + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient.register:(Ljava/lang/String;Lde/codecentric/boot/admin/client/registration/Application;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 40, + 41, + 42, + 43, + 44, + 45, + 46 + ] + }, + "de.codecentric.boot.admin.client.registration.RestClientRegistrationClient.setRequestHeaders:(Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.client.registration.ServletApplicationFactory.:(Lde/codecentric/boot/admin/client/config/InstanceProperties;Lorg/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties;Lorg/springframework/boot/autoconfigure/web/ServerProperties;Ljakarta/servlet/ServletContext;Lorg/springframework/boot/actuate/endpoint/web/PathMappedEndpoints;Lorg/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties;Lde/codecentric/boot/admin/client/registration/metadata/MetadataContributor;Lorg/springframework/boot/autoconfigure/web/servlet/DispatcherServletPath;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 48, + 49, + 50, + 51, + 52, + 53, + 54 + ] + }, + "de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getDispatcherServletPrefix:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 102 + ] + }, + "de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getManagementBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 70, + 72, + 73, + 76, + 77, + 78, + 79, + 80, + 81, + 77, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 85 + ] + }, + "de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getManagementContextPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getServerContextPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 98 + ] + }, + "de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getServiceUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 58, + 59, + 62, + 63, + 64, + 65, + 62 + ] + }, + "de.codecentric.boot.admin.client.registration.metadata.CloudFoundryMetadataContributor.:(Lde/codecentric/boot/admin/client/config/CloudFoundryApplicationProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 31, + 32, + 33 + ] + }, + "de.codecentric.boot.admin.client.registration.metadata.CloudFoundryMetadataContributor.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37, + 38, + 39, + 40, + 41, + 42, + 44 + ] + }, + "de.codecentric.boot.admin.client.registration.metadata.CompositeMetadataContributor.:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 27, + 28, + 29 + ] + }, + "de.codecentric.boot.admin.client.registration.metadata.CompositeMetadataContributor.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 33, + 34, + 35 + ] + }, + "de.codecentric.boot.admin.client.registration.metadata.CompositeMetadataContributor.lambda$getMetadata$0:(Ljava/util/Map;Lde/codecentric/boot/admin/client/registration/metadata/MetadataContributor;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.client.registration.metadata.MetadataContributor.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.client.registration.metadata.StartupDateMetadataContributor.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 25, + 27 + ] + }, + "de.codecentric.boot.admin.client.registration.metadata.StartupDateMetadataContributor.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 31 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-client/pom.xml b/spring-boot-admin-client/pom.xml index f1d22012fa2..71c1530c078 100644 --- a/spring-boot-admin-client/pom.xml +++ b/spring-boot-admin-client/pom.xml @@ -81,6 +81,18 @@ ${wiremock.version} test + + io.projectreactor + reactor-test + 3.7.6 + test + + + org.junit.platform + junit-platform-launcher + 1.12.1 + test + diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/ClientPropertiesDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/ClientPropertiesDiffblueTest.java new file mode 100644 index 00000000000..8e3c13285dd --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/ClientPropertiesDiffblueTest.java @@ -0,0 +1,73 @@ +package de.codecentric.boot.admin.client.config; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.boot.web.reactive.context.StandardReactiveWebEnvironment; +import org.springframework.core.env.Environment; + +class ClientPropertiesDiffblueTest { + + /** + * Test {@link ClientProperties#getAdminUrl()}. + *
    + *
  • Given {@link ClientProperties} (default constructor).
  • + *
  • Then return array length is zero.
  • + *
+ *

+ * Method under test: {@link ClientProperties#getAdminUrl()} + */ + @Test + @DisplayName("Test getAdminUrl(); given ClientProperties (default constructor); then return array length is zero") + @Tag("MaintainedByDiffblue") + void testGetAdminUrl_givenClientProperties_thenReturnArrayLengthIsZero() { + // Arrange, Act and Assert + assertEquals(0, new ClientProperties().getAdminUrl().length); + } + + /** + * Test {@link ClientProperties#getAdminUrl()}. + *

    + *
  • Then return array of {@link String} with + * {@code https://example.org/example/Api Path}.
  • + *
+ *

+ * Method under test: {@link ClientProperties#getAdminUrl()} + */ + @Test + @DisplayName("Test getAdminUrl(); then return array of String with 'https://example.org/example/Api Path'") + @Tag("MaintainedByDiffblue") + void testGetAdminUrl_thenReturnArrayOfStringWithHttpsExampleOrgExampleApiPath() { + // Arrange + ClientProperties clientProperties = new ClientProperties(); + clientProperties.setApiPath("Api Path"); + clientProperties.setEnabled(true); + clientProperties.setPassword("iloveyou"); + clientProperties.setRegisterOnce(true); + clientProperties.setUrl(new String[] { "https://example.org/example" }); + clientProperties.setUsername("janedoe"); + + // Act and Assert + assertArrayEquals(new String[] { "https://example.org/example/Api Path" }, clientProperties.getAdminUrl()); + } + + /** + * Test {@link ClientProperties#isAutoDeregistration(Environment)}. + *

+ * Method under test: {@link ClientProperties#isAutoDeregistration(Environment)} + */ + @Test + @DisplayName("Test isAutoDeregistration(Environment)") + @Tag("MaintainedByDiffblue") + void testIsAutoDeregistration() { + // Arrange + ClientProperties clientProperties = new ClientProperties(); + + // Act and Assert + assertFalse(clientProperties.isAutoDeregistration(new StandardReactiveWebEnvironment())); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationDiffblueTest.java new file mode 100644 index 00000000000..f632387ab3e --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationDiffblueTest.java @@ -0,0 +1,310 @@ +package de.codecentric.boot.admin.client.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration.BlockingRegistrationClientConfig; +import de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration.ReactiveRegistrationClientConfig; +import de.codecentric.boot.admin.client.registration.ApplicationFactory; +import de.codecentric.boot.admin.client.registration.ApplicationRegistrator; +import de.codecentric.boot.admin.client.registration.BlockingRegistrationClient; +import de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator; +import de.codecentric.boot.admin.client.registration.ReactiveRegistrationClient; +import de.codecentric.boot.admin.client.registration.RegistrationClient; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.reactive.function.client.ExchangeFilterFunction; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; + +class SpringBootAdminClientAutoConfigurationDiffblueTest { + + /** + * Test BlockingRegistrationClientConfig + * {@link BlockingRegistrationClientConfig#registrationClient(ClientProperties)}. + *

+ * Method under test: + * {@link BlockingRegistrationClientConfig#registrationClient(ClientProperties)} + */ + @Test + @DisplayName("Test BlockingRegistrationClientConfig registrationClient(ClientProperties)") + @Tag("MaintainedByDiffblue") + void testBlockingRegistrationClientConfigRegistrationClient() { + // Arrange + BlockingRegistrationClientConfig blockingRegistrationClientConfig = new BlockingRegistrationClientConfig(); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setRegisterOnce(true); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername(null); + client.setPassword(null); + + // Act and Assert + assertTrue(blockingRegistrationClientConfig.registrationClient(client) instanceof BlockingRegistrationClient); + } + + /** + * Test BlockingRegistrationClientConfig + * {@link BlockingRegistrationClientConfig#registrationClient(ClientProperties)}. + *

    + *
  • Given {@code Client}.
  • + *
+ *

+ * Method under test: + * {@link BlockingRegistrationClientConfig#registrationClient(ClientProperties)} + */ + @Test + @DisplayName("Test BlockingRegistrationClientConfig registrationClient(ClientProperties); given 'Client'") + @Tag("MaintainedByDiffblue") + void testBlockingRegistrationClientConfigRegistrationClient_givenClient() { + // Arrange + BlockingRegistrationClientConfig blockingRegistrationClientConfig = new BlockingRegistrationClientConfig(); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setRegisterOnce(true); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername("Client"); + client.setPassword(null); + + // Act and Assert + assertTrue(blockingRegistrationClientConfig.registrationClient(client) instanceof BlockingRegistrationClient); + } + + /** + * Test BlockingRegistrationClientConfig + * {@link BlockingRegistrationClientConfig#registrationClient(ClientProperties)}. + *

    + *
  • Given {@code iloveyou}.
  • + *
+ *

+ * Method under test: + * {@link BlockingRegistrationClientConfig#registrationClient(ClientProperties)} + */ + @Test + @DisplayName("Test BlockingRegistrationClientConfig registrationClient(ClientProperties); given 'iloveyou'") + @Tag("MaintainedByDiffblue") + void testBlockingRegistrationClientConfigRegistrationClient_givenIloveyou() { + // Arrange + BlockingRegistrationClientConfig blockingRegistrationClientConfig = new BlockingRegistrationClientConfig(); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setPassword("iloveyou"); + client.setRegisterOnce(true); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername("janedoe"); + + // Act and Assert + assertTrue(blockingRegistrationClientConfig.registrationClient(client) instanceof BlockingRegistrationClient); + } + + /** + * Test ReactiveRegistrationClientConfig + * {@link ReactiveRegistrationClientConfig#registrationClient(ClientProperties, Builder)}. + *

+ * Method under test: + * {@link ReactiveRegistrationClientConfig#registrationClient(ClientProperties, Builder)} + */ + @Test + @DisplayName("Test ReactiveRegistrationClientConfig registrationClient(ClientProperties, Builder)") + @Tag("MaintainedByDiffblue") + void testReactiveRegistrationClientConfigRegistrationClient() { + // Arrange + ReactiveRegistrationClientConfig reactiveRegistrationClientConfig = new ReactiveRegistrationClientConfig(); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setPassword(null); + client.setRegisterOnce(true); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername(null); + Builder webClient = mock(Builder.class); + when(webClient.build()).thenReturn(mock(WebClient.class)); + + // Act + RegistrationClient actualRegistrationClientResult = reactiveRegistrationClientConfig.registrationClient(client, + webClient); + + // Assert + verify(webClient).build(); + assertTrue(actualRegistrationClientResult instanceof ReactiveRegistrationClient); + } + + /** + * Test ReactiveRegistrationClientConfig + * {@link ReactiveRegistrationClientConfig#registrationClient(ClientProperties, Builder)}. + *

    + *
  • Given {@code null}.
  • + *
+ *

+ * Method under test: + * {@link ReactiveRegistrationClientConfig#registrationClient(ClientProperties, Builder)} + */ + @Test + @DisplayName("Test ReactiveRegistrationClientConfig registrationClient(ClientProperties, Builder); given 'null'") + @Tag("MaintainedByDiffblue") + void testReactiveRegistrationClientConfigRegistrationClient_givenNull() { + // Arrange + ReactiveRegistrationClientConfig reactiveRegistrationClientConfig = new ReactiveRegistrationClientConfig(); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setPassword(null); + client.setRegisterOnce(true); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername("janedoe"); + Builder webClient = mock(Builder.class); + when(webClient.build()).thenReturn(mock(WebClient.class)); + + // Act + RegistrationClient actualRegistrationClientResult = reactiveRegistrationClientConfig.registrationClient(client, + webClient); + + // Assert + verify(webClient).build(); + assertTrue(actualRegistrationClientResult instanceof ReactiveRegistrationClient); + } + + /** + * Test ReactiveRegistrationClientConfig + * {@link ReactiveRegistrationClientConfig#registrationClient(ClientProperties, Builder)}. + *

    + *
  • Then calls {@link Builder#filter(ExchangeFilterFunction)}.
  • + *
+ *

+ * Method under test: + * {@link ReactiveRegistrationClientConfig#registrationClient(ClientProperties, Builder)} + */ + @Test + @DisplayName("Test ReactiveRegistrationClientConfig registrationClient(ClientProperties, Builder); then calls filter(ExchangeFilterFunction)") + @Tag("MaintainedByDiffblue") + void testReactiveRegistrationClientConfigRegistrationClient_thenCallsFilter() { + // Arrange + ReactiveRegistrationClientConfig reactiveRegistrationClientConfig = new ReactiveRegistrationClientConfig(); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setPassword("iloveyou"); + client.setRegisterOnce(true); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername("janedoe"); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + Builder webClient = mock(Builder.class); + when(webClient.filter(Mockito.any())).thenReturn(builder); + + // Act + RegistrationClient actualRegistrationClientResult = reactiveRegistrationClientConfig.registrationClient(client, + webClient); + + // Assert + verify(builder).build(); + verify(webClient).filter(isA(ExchangeFilterFunction.class)); + assertTrue(actualRegistrationClientResult instanceof ReactiveRegistrationClient); + } + + /** + * Test + * {@link SpringBootAdminClientAutoConfiguration#registrator(RegistrationClient, ClientProperties, ApplicationFactory)}. + *

    + *
  • Given {@code false}.
  • + *
  • When {@link ClientProperties} (default constructor) RegisterOnce is + * {@code false}.
  • + *
+ *

+ * Method under test: + * {@link SpringBootAdminClientAutoConfiguration#registrator(RegistrationClient, ClientProperties, ApplicationFactory)} + */ + @Test + @DisplayName("Test registrator(RegistrationClient, ClientProperties, ApplicationFactory); given 'false'; when ClientProperties (default constructor) RegisterOnce is 'false'") + @Tag("MaintainedByDiffblue") + void testRegistrator_givenFalse_whenClientPropertiesRegisterOnceIsFalse() { + // Arrange + SpringBootAdminClientAutoConfiguration springBootAdminClientAutoConfiguration = new SpringBootAdminClientAutoConfiguration(); + BlockingRegistrationClient registrationClient = new BlockingRegistrationClient(mock(RestTemplate.class)); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setPassword("iloveyou"); + client.setRegisterOnce(false); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername("janedoe"); + + // Act + ApplicationRegistrator actualRegistratorResult = springBootAdminClientAutoConfiguration + .registrator(registrationClient, client, mock(ApplicationFactory.class)); + + // Assert + assertTrue(actualRegistratorResult instanceof DefaultApplicationRegistrator); + assertNull(actualRegistratorResult.getRegisteredId()); + } + + /** + * Test + * {@link SpringBootAdminClientAutoConfiguration#registrator(RegistrationClient, ClientProperties, ApplicationFactory)}. + *

    + *
  • When {@link ClientProperties} (default constructor) RegisterOnce is + * {@code true}.
  • + *
+ *

+ * Method under test: + * {@link SpringBootAdminClientAutoConfiguration#registrator(RegistrationClient, ClientProperties, ApplicationFactory)} + */ + @Test + @DisplayName("Test registrator(RegistrationClient, ClientProperties, ApplicationFactory); when ClientProperties (default constructor) RegisterOnce is 'true'") + @Tag("MaintainedByDiffblue") + void testRegistrator_whenClientPropertiesRegisterOnceIsTrue() { + // Arrange + SpringBootAdminClientAutoConfiguration springBootAdminClientAutoConfiguration = new SpringBootAdminClientAutoConfiguration(); + BlockingRegistrationClient registrationClient = new BlockingRegistrationClient(mock(RestTemplate.class)); + + ClientProperties client = new ClientProperties(); + client.setApiPath("Api Path"); + client.setEnabled(true); + client.setPassword("iloveyou"); + client.setRegisterOnce(true); + client.setUrl(new String[] { "https://example.org/example" }); + client.setUsername("janedoe"); + + // Act + ApplicationRegistrator actualRegistratorResult = springBootAdminClientAutoConfiguration + .registrator(registrationClient, client, mock(ApplicationFactory.class)); + + // Assert + assertTrue(actualRegistratorResult instanceof DefaultApplicationRegistrator); + assertNull(actualRegistratorResult.getRegisteredId()); + } + + /** + * Test + * {@link SpringBootAdminClientAutoConfiguration#startupDateMetadataContributor()}. + *

+ * Method under test: + * {@link SpringBootAdminClientAutoConfiguration#startupDateMetadataContributor()} + */ + @Test + @DisplayName("Test startupDateMetadataContributor()") + @Tag("MaintainedByDiffblue") + void testStartupDateMetadataContributor() { + // Arrange, Act and Assert + assertEquals(1, + new SpringBootAdminClientAutoConfiguration().startupDateMetadataContributor().getMetadata().size()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationDiffblueTest.java new file mode 100644 index 00000000000..848c2f5cab8 --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationDiffblueTest.java @@ -0,0 +1,42 @@ +package de.codecentric.boot.admin.client.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.util.ArrayList; +import java.util.Map; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +class SpringBootAdminClientCloudFoundryAutoConfigurationDiffblueTest { + + /** + * Test + * {@link SpringBootAdminClientCloudFoundryAutoConfiguration#cloudFoundryMetadataContributor(CloudFoundryApplicationProperties)}. + *

+ * Method under test: + * {@link SpringBootAdminClientCloudFoundryAutoConfiguration#cloudFoundryMetadataContributor(CloudFoundryApplicationProperties)} + */ + @Test + @DisplayName("Test cloudFoundryMetadataContributor(CloudFoundryApplicationProperties)") + @Tag("MaintainedByDiffblue") + void testCloudFoundryMetadataContributor() { + // Arrange + SpringBootAdminClientCloudFoundryAutoConfiguration springBootAdminClientCloudFoundryAutoConfiguration = new SpringBootAdminClientCloudFoundryAutoConfiguration(); + + CloudFoundryApplicationProperties cloudFoundryApplicationProperties = new CloudFoundryApplicationProperties(); + cloudFoundryApplicationProperties.setApplicationId("42"); + cloudFoundryApplicationProperties.setInstanceIndex("Instance Index"); + cloudFoundryApplicationProperties.setUris(new ArrayList<>()); + + // Act + Map actualMetadata = springBootAdminClientCloudFoundryAutoConfiguration + .cloudFoundryMetadataContributor(cloudFoundryApplicationProperties) + .getMetadata(); + + // Assert + assertEquals(2, actualMetadata.size()); + assertEquals("42", actualMetadata.get("applicationId")); + assertEquals("Instance Index", actualMetadata.get("instanceId")); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientEnabledConditionDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientEnabledConditionDiffblueTest.java new file mode 100644 index 00000000000..b68f49ae875 --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientEnabledConditionDiffblueTest.java @@ -0,0 +1,46 @@ +package de.codecentric.boot.admin.client.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.boot.autoconfigure.condition.ConditionOutcome; +import org.springframework.boot.web.reactive.context.StandardReactiveWebEnvironment; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.type.AnnotatedTypeMetadata; + +class SpringBootAdminClientEnabledConditionDiffblueTest { + + /** + * Test + * {@link SpringBootAdminClientEnabledCondition#getMatchOutcome(ConditionContext, AnnotatedTypeMetadata)}. + *

+ * Method under test: + * {@link SpringBootAdminClientEnabledCondition#getMatchOutcome(ConditionContext, AnnotatedTypeMetadata)} + */ + @Test + @DisplayName("Test getMatchOutcome(ConditionContext, AnnotatedTypeMetadata)") + @Tag("MaintainedByDiffblue") + void testGetMatchOutcome() { + // Arrange + SpringBootAdminClientEnabledCondition springBootAdminClientEnabledCondition = new SpringBootAdminClientEnabledCondition(); + ConditionContext context = mock(ConditionContext.class); + when(context.getEnvironment()).thenReturn(new StandardReactiveWebEnvironment()); + + // Act + ConditionOutcome actualMatchOutcome = springBootAdminClientEnabledCondition.getMatchOutcome(context, + mock(AnnotatedTypeMetadata.class)); + + // Assert + verify(context).getEnvironment(); + assertEquals("Spring Boot Client is disabled, because 'spring.boot.admin.client.url' is empty.", + actualMatchOutcome.getMessage()); + assertFalse(actualMatchOutcome.getConditionMessage().isEmpty()); + assertFalse(actualMatchOutcome.isMatch()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ApplicationDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ApplicationDiffblueTest.java new file mode 100644 index 00000000000..6d0f55818ff --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ApplicationDiffblueTest.java @@ -0,0 +1,55 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +class ApplicationDiffblueTest { + + /** + * Test {@link Application#Application(String, String, String, String, Map)}. + *

    + *
  • When {@code Name}.
  • + *
  • Then return {@code Name}.
  • + *
+ *

+ * Method under test: + * {@link Application#Application(String, String, String, String, Map)} + */ + @Test + @DisplayName("Test new Application(String, String, String, String, Map); when 'Name'; then return 'Name'") + @Tag("MaintainedByDiffblue") + void testNewApplication_whenName_thenReturnName() { + // Arrange and Act + Application actualApplication = new Application("Name", "https://example.org/example", + "https://example.org/example", "https://example.org/example", new HashMap<>()); + + // Assert + assertEquals("Name", actualApplication.getName()); + assertEquals("https://example.org/example", actualApplication.getHealthUrl()); + assertEquals("https://example.org/example", actualApplication.getManagementUrl()); + assertEquals("https://example.org/example", actualApplication.getServiceUrl()); + assertTrue(actualApplication.getMetadata().isEmpty()); + } + + /** + * Test {@link Application#getMetadata()}. + *

+ * Method under test: {@link Application#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata()") + @Tag("MaintainedByDiffblue") + void testGetMetadata() { + // Arrange, Act and Assert + assertTrue(new Application("Name", "https://example.org/example", "https://example.org/example", + "https://example.org/example", new HashMap<>()) + .getMetadata() + .isEmpty()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/BlockingRegistrationClientDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/BlockingRegistrationClientDiffblueTest.java new file mode 100644 index 00000000000..680c8c56b4c --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/BlockingRegistrationClientDiffblueTest.java @@ -0,0 +1,73 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.verify; +import java.util.List; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; + +@ContextConfiguration(classes = { BlockingRegistrationClient.class }) +@DisabledInAotMode +@ExtendWith(SpringExtension.class) +class BlockingRegistrationClientDiffblueTest { + + @Autowired + private BlockingRegistrationClient blockingRegistrationClient; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test {@link BlockingRegistrationClient#deregister(String, String)}. + *

+ * Method under test: {@link BlockingRegistrationClient#deregister(String, String)} + */ + @Test + @DisplayName("Test deregister(String, String)") + @Tag("MaintainedByDiffblue") + void testDeregister() throws RestClientException { + // Arrange + doNothing().when(restTemplate).delete(Mockito.any(), isA(Object[].class)); + + // Act + blockingRegistrationClient.deregister("https://example.org/example", "42"); + + // Assert + verify(restTemplate).delete(eq("https://example.org/example/42"), isA(Object[].class)); + } + + /** + * Test {@link BlockingRegistrationClient#createRequestHeaders()}. + *

+ * Method under test: {@link BlockingRegistrationClient#createRequestHeaders()} + */ + @Test + @DisplayName("Test createRequestHeaders()") + @Tag("MaintainedByDiffblue") + void testCreateRequestHeaders() { + // Arrange and Act + HttpHeaders actualCreateRequestHeadersResult = blockingRegistrationClient.createRequestHeaders(); + + // Assert + assertEquals(2, actualCreateRequestHeadersResult.size()); + List getResult = actualCreateRequestHeadersResult.get(HttpHeaders.CONTENT_TYPE); + assertEquals(1, getResult.size()); + assertEquals("application/json", getResult.get(0)); + assertEquals(getResult, actualCreateRequestHeadersResult.get(HttpHeaders.ACCEPT)); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryDiffblueTest.java new file mode 100644 index 00000000000..121037dd2e3 --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryDiffblueTest.java @@ -0,0 +1,129 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties; +import de.codecentric.boot.admin.client.config.InstanceProperties; +import de.codecentric.boot.admin.client.config.ServiceHostType; +import de.codecentric.boot.admin.client.registration.metadata.MetadataContributor; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.HashMap; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; +import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; +import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; +import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.autoconfigure.web.ServerProperties.ForwardHeadersStrategy; +import org.springframework.boot.web.server.Shutdown; +import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.Ssl.ClientAuth; +import org.springframework.util.unit.DataSize; + +class CloudFoundryApplicationFactoryDiffblueTest { + + /** + * Test {@link CloudFoundryApplicationFactory#getServiceBaseUrl()}. + *

    + *
  • Then return {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: {@link CloudFoundryApplicationFactory#getServiceBaseUrl()} + */ + @Test + @DisplayName("Test getServiceBaseUrl(); then return 'https://example.org/example'") + @Tag("MaintainedByDiffblue") + void testGetServiceBaseUrl_thenReturnHttpsExampleOrgExample() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + CloudFoundryApplicationProperties cfApplicationProperties = new CloudFoundryApplicationProperties(); + cfApplicationProperties.setApplicationId("42"); + cfApplicationProperties.setInstanceIndex("Instance Index"); + cfApplicationProperties.setUris(new ArrayList<>()); + + // Act and Assert + assertEquals("https://example.org/example", + new CloudFoundryApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class), cfApplicationProperties) + .getServiceBaseUrl()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactoryDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactoryDiffblueTest.java new file mode 100644 index 00000000000..8e75e34d85f --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactoryDiffblueTest.java @@ -0,0 +1,2234 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.client.config.InstanceProperties; +import de.codecentric.boot.admin.client.config.ServiceHostType; +import de.codecentric.boot.admin.client.registration.metadata.MetadataContributor; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; +import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; +import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; +import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.autoconfigure.web.ServerProperties.ForwardHeadersStrategy; +import org.springframework.boot.web.server.Shutdown; +import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.Ssl.ClientAuth; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.util.unit.DataSize; + +@ContextConfiguration(classes = { DefaultApplicationFactory.class, InstanceProperties.class, + ManagementServerProperties.class, ServerProperties.class, WebEndpointProperties.class }) +@DisabledInAotMode +@ExtendWith(SpringExtension.class) +class DefaultApplicationFactoryDiffblueTest { + + @Autowired + private DefaultApplicationFactory defaultApplicationFactory; + + @Autowired + private InstanceProperties instanceProperties; + + @Autowired + private ManagementServerProperties managementServerProperties; + + @MockitoBean + private MetadataContributor metadataContributor; + + @MockitoBean + private PathMappedEndpoints pathMappedEndpoints; + + @Autowired + private ServerProperties serverProperties; + + @Autowired + private WebEndpointProperties webEndpointProperties; + + /** + * Test {@link DefaultApplicationFactory#createApplication()}. + *

    + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#createApplication()} + */ + @Test + @DisplayName("Test createApplication(); then throw IllegalStateException") + @Tag("MaintainedByDiffblue") + void testCreateApplication_thenThrowIllegalStateException() { + // Arrange, Act and Assert + assertThrows(IllegalStateException.class, () -> defaultApplicationFactory.createApplication()); + } + + /** + * Test {@link DefaultApplicationFactory#getName()}. + *

    + *
  • Given {@link WebEndpointProperties} (default constructor) BasePath is empty + * string.
  • + *
  • Then return {@code Name}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getName()} + */ + @Test + @DisplayName("Test getName(); given WebEndpointProperties (default constructor) BasePath is empty string; then return 'Name'") + @Tag("MaintainedByDiffblue") + void testGetName_givenWebEndpointPropertiesBasePathIsEmptyString_thenReturnName() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("Name", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getName()); + } + + /** + * Test {@link DefaultApplicationFactory#getServiceUrl()}. + *

    + *
  • Then return {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getServiceUrl()} + */ + @Test + @DisplayName("Test getServiceUrl(); then return 'https://example.org/example'") + @Tag("MaintainedByDiffblue") + void testGetServiceUrl_thenReturnHttpsExampleOrgExample() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getServiceUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getServiceUrl()}. + *

    + *
  • Then return {@code https://example.org/exampleService%20Path}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getServiceUrl()} + */ + @Test + @DisplayName("Test getServiceUrl(); then return 'https://example.org/exampleService%20Path'") + @Tag("MaintainedByDiffblue") + void testGetServiceUrl_thenReturnHttpsExampleOrgExampleService20Path() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl(null); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/exampleService%20Path", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getServiceUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getServiceBaseUrl()}. + *

    + *
  • Given {@link InstanceProperties} (default constructor) PreferIp is + * {@code false}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getServiceBaseUrl()} + */ + @Test + @DisplayName("Test getServiceBaseUrl(); given InstanceProperties (default constructor) PreferIp is 'false'") + @Tag("MaintainedByDiffblue") + void testGetServiceBaseUrl_givenInstancePropertiesPreferIpIsFalse() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(false); + instance.setServiceBaseUrl(""); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + InetAddress address = mock(InetAddress.class); + when(address.getHostAddress()).thenReturn("42 Main St"); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(address); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getServiceBaseUrl()); + verify(address).getHostAddress(); + } + + /** + * Test {@link DefaultApplicationFactory#getServiceBaseUrl()}. + *

    + *
  • Given {@link Ssl} (default constructor) Enabled is {@code false}.
  • + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getServiceBaseUrl()} + */ + @Test + @DisplayName("Test getServiceBaseUrl(); given Ssl (default constructor) Enabled is 'false'; then throw IllegalStateException") + @Tag("MaintainedByDiffblue") + void testGetServiceBaseUrl_givenSslEnabledIsFalse_thenThrowIllegalStateException() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl(""); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + InetAddress address = mock(InetAddress.class); + when(address.getHostAddress()).thenReturn("42 Main St"); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(false); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(address); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getServiceBaseUrl()); + verify(address).getHostAddress(); + } + + /** + * Test {@link DefaultApplicationFactory#getServiceBaseUrl()}. + *

    + *
  • Then return {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getServiceBaseUrl()} + */ + @Test + @DisplayName("Test getServiceBaseUrl(); then return 'https://example.org/example'") + @Tag("MaintainedByDiffblue") + void testGetServiceBaseUrl_thenReturnHttpsExampleOrgExample() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getServiceBaseUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getServiceBaseUrl()}. + *

    + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getServiceBaseUrl()} + */ + @Test + @DisplayName("Test getServiceBaseUrl(); then throw IllegalStateException") + @Tag("MaintainedByDiffblue") + void testGetServiceBaseUrl_thenThrowIllegalStateException() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl(""); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + InetAddress address = mock(InetAddress.class); + when(address.getHostAddress()).thenReturn("42 Main St"); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(address); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getServiceBaseUrl()); + verify(address).getHostAddress(); + } + + /** + * Test {@link DefaultApplicationFactory#getManagementUrl()}. + *

    + *
  • Given {@link InstanceProperties} (default constructor) ManagementBaseUrl is + * {@code null}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getManagementUrl()} + */ + @Test + @DisplayName("Test getManagementUrl(); given InstanceProperties (default constructor) ManagementBaseUrl is 'null'") + @Tag("MaintainedByDiffblue") + void testGetManagementUrl_givenInstancePropertiesManagementBaseUrlIsNull() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl(null); + instance.setManagementUrl(null); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example/", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getManagementUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getManagementUrl()}. + *

    + *
  • Then return {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getManagementUrl()} + */ + @Test + @DisplayName("Test getManagementUrl(); then return 'https://example.org/example'") + @Tag("MaintainedByDiffblue") + void testGetManagementUrl_thenReturnHttpsExampleOrgExample() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getManagementUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getManagementUrl()}. + *

    + *
  • Then return {@code https://example.org/example/}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getManagementUrl()} + */ + @Test + @DisplayName("Test getManagementUrl(); then return 'https://example.org/example/'") + @Tag("MaintainedByDiffblue") + void testGetManagementUrl_thenReturnHttpsExampleOrgExample2() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl(null); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example/", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getManagementUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getManagementBaseUrl()}. + *

    + *
  • Given {@link InstanceProperties} (default constructor) ManagementBaseUrl is + * empty string.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getManagementBaseUrl()} + */ + @Test + @DisplayName("Test getManagementBaseUrl(); given InstanceProperties (default constructor) ManagementBaseUrl is empty string") + @Tag("MaintainedByDiffblue") + void testGetManagementBaseUrl_givenInstancePropertiesManagementBaseUrlIsEmptyString() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl(""); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getManagementBaseUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getManagementBaseUrl()}. + *

    + *
  • Then return {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getManagementBaseUrl()} + */ + @Test + @DisplayName("Test getManagementBaseUrl(); then return 'https://example.org/example'") + @Tag("MaintainedByDiffblue") + void testGetManagementBaseUrl_thenReturnHttpsExampleOrgExample() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getManagementBaseUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#isManagementPortEqual()}. + *

    + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#isManagementPortEqual()} + */ + @Test + @DisplayName("Test isManagementPortEqual(); then return 'true'") + @Tag("MaintainedByDiffblue") + void testIsManagementPortEqual_thenReturnTrue() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertTrue(new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, mock(MetadataContributor.class)) + .isManagementPortEqual()); + } + + /** + * Test {@link DefaultApplicationFactory#getEndpointsWebPath()}. + *

    + *
  • Then return empty string.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getEndpointsWebPath()} + */ + @Test + @DisplayName("Test getEndpointsWebPath(); then return empty string") + @Tag("MaintainedByDiffblue") + void testGetEndpointsWebPath_thenReturnEmptyString() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getEndpointsWebPath()); + } + + /** + * Test {@link DefaultApplicationFactory#getHealthUrl()}. + *

    + *
  • Given {@link InstanceProperties} (default constructor) ManagementBaseUrl is + * {@code null}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getHealthUrl()} + */ + @Test + @DisplayName("Test getHealthUrl(); given InstanceProperties (default constructor) ManagementBaseUrl is 'null'") + @Tag("MaintainedByDiffblue") + void testGetHealthUrl_givenInstancePropertiesManagementBaseUrlIsNull() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl(null); + instance.setManagementBaseUrl(null); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getHealthUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getHealthUrl()}. + *

    + *
  • Then return {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getHealthUrl()} + */ + @Test + @DisplayName("Test getHealthUrl(); then return 'https://example.org/example'") + @Tag("MaintainedByDiffblue") + void testGetHealthUrl_thenReturnHttpsExampleOrgExample() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertEquals("https://example.org/example", + new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getHealthUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getHealthUrl()}. + *

    + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getHealthUrl()} + */ + @Test + @DisplayName("Test getHealthUrl(); then throw IllegalStateException") + @Tag("MaintainedByDiffblue") + void testGetHealthUrl_thenThrowIllegalStateException() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl(null); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getHealthUrl()); + } + + /** + * Test {@link DefaultApplicationFactory#getMetadata()}. + *

    + *
  • Given {@link MetadataContributor} {@link MetadataContributor#getMetadata()} + * return {@link HashMap#HashMap()}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata(); given MetadataContributor getMetadata() return HashMap(); then return Empty") + @Tag("MaintainedByDiffblue") + void testGetMetadata_givenMetadataContributorGetMetadataReturnHashMap_thenReturnEmpty() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + MetadataContributor metadataContributor = mock(MetadataContributor.class); + when(metadataContributor.getMetadata()).thenReturn(new HashMap<>()); + + // Act + Map actualMetadata = new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, metadataContributor) + .getMetadata(); + + // Assert + verify(metadataContributor).getMetadata(); + assertTrue(actualMetadata.isEmpty()); + } + + /** + * Test {@link DefaultApplicationFactory#getMetadata()}. + *

    + *
  • Then throw {@link IllegalArgumentException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata(); then throw IllegalArgumentException") + @Tag("MaintainedByDiffblue") + void testGetMetadata_thenThrowIllegalArgumentException() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + MetadataContributor metadataContributor = mock(MetadataContributor.class); + when(metadataContributor.getMetadata()).thenThrow(new IllegalArgumentException("foo")); + + // Act and Assert + assertThrows(IllegalArgumentException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, metadataContributor) + .getMetadata()); + verify(metadataContributor).getMetadata(); + } + + /** + * Test {@link DefaultApplicationFactory#getLocalServerPort()}. + *

    + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getLocalServerPort()} + */ + @Test + @DisplayName("Test getLocalServerPort(); then throw IllegalStateException") + @Tag("MaintainedByDiffblue") + void testGetLocalServerPort_thenThrowIllegalStateException() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getLocalServerPort()); + } + + /** + * Test {@link DefaultApplicationFactory#getLocalManagementPort()}. + *

    + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getLocalManagementPort()} + */ + @Test + @DisplayName("Test getLocalManagementPort(); then throw IllegalStateException") + @Tag("MaintainedByDiffblue") + void testGetLocalManagementPort_thenThrowIllegalStateException() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getLocalManagementPort()); + } + + /** + * Test {@link DefaultApplicationFactory#getHealthEndpointPath()}. + *

    + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link DefaultApplicationFactory#getHealthEndpointPath()} + */ + @Test + @DisplayName("Test getHealthEndpointPath(); then throw IllegalStateException") + @Tag("MaintainedByDiffblue") + void testGetHealthEndpointPath_thenThrowIllegalStateException() { + // Arrange + InstanceProperties instance = new InstanceProperties(); + instance.setHealthUrl("https://example.org/example"); + instance.setManagementBaseUrl("https://example.org/example"); + instance.setManagementUrl("https://example.org/example"); + instance.setMetadata(new HashMap<>()); + instance.setName("Name"); + instance.setPreferIp(true); + instance.setServiceBaseUrl("https://example.org/example"); + instance.setServiceHostType(ServiceHostType.IP); + instance.setServicePath("Service Path"); + instance.setServiceUrl("https://example.org/example"); + + Ssl ssl = new Ssl(); + ssl.setBundle("Bundle"); + ssl.setCertificate("Certificate"); + ssl.setCertificatePrivateKey("Certificate Private Key"); + ssl.setCiphers(new String[] { "Ciphers" }); + ssl.setClientAuth(ClientAuth.NONE); + ssl.setEnabled(true); + ssl.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl.setKeyAlias("Key Alias"); + ssl.setKeyPassword("iloveyou"); + ssl.setKeyStore("Key Store"); + ssl.setKeyStorePassword("iloveyou"); + ssl.setKeyStoreProvider("Key Store Provider"); + ssl.setKeyStoreType("Key Store Type"); + ssl.setProtocol("Protocol"); + ssl.setServerNameBundles(new ArrayList<>()); + ssl.setTrustCertificate("Trust Certificate"); + ssl.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl.setTrustStore("Trust Store"); + ssl.setTrustStorePassword("iloveyou"); + ssl.setTrustStoreProvider("Trust Store Provider"); + ssl.setTrustStoreType("Trust Store Type"); + + ManagementServerProperties management = new ManagementServerProperties(); + management.setAddress(mock(InetAddress.class)); + management.setBasePath("Base Path"); + management.setPort(8080); + management.setSsl(ssl); + + Ssl ssl2 = new Ssl(); + ssl2.setBundle("Bundle"); + ssl2.setCertificate("Certificate"); + ssl2.setCertificatePrivateKey("Certificate Private Key"); + ssl2.setCiphers(new String[] { "Ciphers" }); + ssl2.setClientAuth(ClientAuth.NONE); + ssl2.setEnabled(true); + ssl2.setEnabledProtocols(new String[] { "Enabled Protocols" }); + ssl2.setKeyAlias("Key Alias"); + ssl2.setKeyPassword("iloveyou"); + ssl2.setKeyStore("Key Store"); + ssl2.setKeyStorePassword("iloveyou"); + ssl2.setKeyStoreProvider("Key Store Provider"); + ssl2.setKeyStoreType("Key Store Type"); + ssl2.setProtocol("Protocol"); + ssl2.setServerNameBundles(new ArrayList<>()); + ssl2.setTrustCertificate("Trust Certificate"); + ssl2.setTrustCertificatePrivateKey("Trust Certificate Private Key"); + ssl2.setTrustStore("Trust Store"); + ssl2.setTrustStorePassword("iloveyou"); + ssl2.setTrustStoreProvider("Trust Store Provider"); + ssl2.setTrustStoreType("Trust Store Type"); + + ServerProperties server = new ServerProperties(); + server.setAddress(mock(InetAddress.class)); + server.setForwardHeadersStrategy(ForwardHeadersStrategy.NATIVE); + server.setMaxHttpRequestHeaderSize(DataSize.ofBytes(1L)); + server.setPort(8080); + server.setServerHeader("Server Header"); + server.setShutdown(Shutdown.GRACEFUL); + server.setSsl(ssl2); + + WebEndpointProperties webEndpoint = new WebEndpointProperties(); + webEndpoint.setBasePath(""); + + // Act and Assert + assertThrows(IllegalStateException.class, + () -> new DefaultApplicationFactory(instance, management, server, + new PathMappedEndpoints("Base Path", new ArrayList<>()), webEndpoint, + mock(MetadataContributor.class)) + .getHealthEndpointPath()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationRegistratorDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationRegistratorDiffblueTest.java new file mode 100644 index 00000000000..f8802d34239 --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationRegistratorDiffblueTest.java @@ -0,0 +1,336 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.HashMap; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; + +class DefaultApplicationRegistratorDiffblueTest { + + /** + * Test + * {@link DefaultApplicationRegistrator#DefaultApplicationRegistrator(ApplicationFactory, RegistrationClient, String[], boolean)}. + *

+ * Method under test: + * {@link DefaultApplicationRegistrator#DefaultApplicationRegistrator(ApplicationFactory, RegistrationClient, String[], boolean)} + */ + @Test + @DisplayName("Test new DefaultApplicationRegistrator(ApplicationFactory, RegistrationClient, String[], boolean)") + @Tag("MaintainedByDiffblue") + void testNewDefaultApplicationRegistrator() { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + + // Act and Assert + assertNull(new DefaultApplicationRegistrator(applicationFactory, + new BlockingRegistrationClient(mock(RestTemplate.class)), + new String[] { "https://example.org/example" }, true) + .getRegisteredId()); + } + + /** + * Test {@link DefaultApplicationRegistrator#register()}. + *

+ * Method under test: {@link DefaultApplicationRegistrator#register()} + */ + @Test + @DisplayName("Test register()") + @Tag("MaintainedByDiffblue") + void testRegister() throws RestClientException { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + Application buildResult = Application.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .build(); + when(applicationFactory.createApplication()).thenReturn(buildResult); + RestTemplate restTemplate = mock(RestTemplate.class); + when(restTemplate.exchange(Mockito.any(), Mockito.any(), Mockito.>any(), + Mockito.>any(), isA(Object[].class))) + .thenReturn(new ResponseEntity<>(HttpStatus.OK)); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + applicationFactory, new BlockingRegistrationClient(restTemplate), + new String[] { "https://example.org/example" }, true); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator.register(); + + // Assert + verify(applicationFactory).createApplication(); + verify(restTemplate).exchange(eq("https://example.org/example"), isA(HttpMethod.class), isA(HttpEntity.class), + isA(ParameterizedTypeReference.class), isA(Object[].class)); + assertNull(defaultApplicationRegistrator.getRegisteredId()); + assertFalse(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#register()}. + *

+ * Method under test: {@link DefaultApplicationRegistrator#register()} + */ + @Test + @DisplayName("Test register()") + @Tag("MaintainedByDiffblue") + void testRegister2() { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + Application buildResult = Application.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .build(); + when(applicationFactory.createApplication()).thenReturn(buildResult); + RegistrationClient registrationClient = mock(RegistrationClient.class); + when(registrationClient.register(Mockito.any(), Mockito.any())).thenReturn("Register"); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + applicationFactory, registrationClient, new String[] { "https://example.org/example" }, true); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator.register(); + + // Assert + verify(applicationFactory).createApplication(); + verify(registrationClient).register(eq("https://example.org/example"), isA(Application.class)); + assertEquals("Register", defaultApplicationRegistrator.getRegisteredId()); + assertTrue(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#register()}. + *

+ * Method under test: {@link DefaultApplicationRegistrator#register()} + */ + @Test + @DisplayName("Test register()") + @Tag("MaintainedByDiffblue") + void testRegister3() { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + Application buildResult = Application.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .build(); + when(applicationFactory.createApplication()).thenReturn(buildResult); + RegistrationClient registrationClient = mock(RegistrationClient.class); + when(registrationClient.register(Mockito.any(), Mockito.any())).thenReturn("Register"); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + applicationFactory, registrationClient, new String[] { "https://example.org/example" }, false); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator.register(); + + // Assert + verify(applicationFactory).createApplication(); + verify(registrationClient).register(eq("https://example.org/example"), isA(Application.class)); + assertEquals("Register", defaultApplicationRegistrator.getRegisteredId()); + assertTrue(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#register()}. + *

+ * Method under test: {@link DefaultApplicationRegistrator#register()} + */ + @Test + @DisplayName("Test register()") + @Tag("MaintainedByDiffblue") + void testRegister4() { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + Application buildResult = Application.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .build(); + when(applicationFactory.createApplication()).thenReturn(buildResult); + RegistrationClient registrationClient = mock(RegistrationClient.class); + when(registrationClient.register(Mockito.any(), Mockito.any())).thenReturn("Register"); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + applicationFactory, registrationClient, + new String[] { "https://example.org/example", "Application registered itself as {}" }, false); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator.register(); + + // Assert + verify(applicationFactory).createApplication(); + verify(registrationClient, atLeast(1)).register(Mockito.any(), isA(Application.class)); + assertEquals("Register", defaultApplicationRegistrator.getRegisteredId()); + assertTrue(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#register()}. + *

+ * Method under test: {@link DefaultApplicationRegistrator#register()} + */ + @Test + @DisplayName("Test register()") + @Tag("MaintainedByDiffblue") + void testRegister5() { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + Application buildResult = Application.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .build(); + when(applicationFactory.createApplication()).thenReturn(buildResult); + RegistrationClient registrationClient = mock(RegistrationClient.class); + when(registrationClient.register(Mockito.any(), Mockito.any())).thenReturn("Register"); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + applicationFactory, registrationClient, new String[] { "https://example.org/example", + "Application registered itself as {}", "https://example.org/example" }, + false); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator.register(); + + // Assert + verify(applicationFactory).createApplication(); + verify(registrationClient, atLeast(1)).register(Mockito.any(), isA(Application.class)); + assertEquals("Register", defaultApplicationRegistrator.getRegisteredId()); + assertTrue(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#register(Application, String, boolean)} + * with {@code Application}, {@code String}, {@code boolean}. + *

+ * Method under test: + * {@link DefaultApplicationRegistrator#register(Application, String, boolean)} + */ + @Test + @DisplayName("Test register(Application, String, boolean) with 'Application', 'String', 'boolean'") + @Tag("MaintainedByDiffblue") + void testRegisterWithApplicationStringBoolean() throws RestClientException { + // Arrange + RestTemplate restTemplate = mock(RestTemplate.class); + when(restTemplate.exchange(Mockito.any(), Mockito.any(), Mockito.>any(), + Mockito.>any(), isA(Object[].class))) + .thenReturn(new ResponseEntity<>(HttpStatus.OK)); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + mock(ApplicationFactory.class), new BlockingRegistrationClient(restTemplate), + new String[] { "https://example.org/example" }, true); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator + .register(new Application("Name", "https://example.org/example", "https://example.org/example", + "https://example.org/example", new HashMap<>()), "https://example.org/example", true); + + // Assert + verify(restTemplate).exchange(eq("https://example.org/example"), isA(HttpMethod.class), isA(HttpEntity.class), + isA(ParameterizedTypeReference.class), isA(Object[].class)); + assertNull(defaultApplicationRegistrator.getRegisteredId()); + assertFalse(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#register(Application, String, boolean)} + * with {@code Application}, {@code String}, {@code boolean}. + *

+ * Method under test: + * {@link DefaultApplicationRegistrator#register(Application, String, boolean)} + */ + @Test + @DisplayName("Test register(Application, String, boolean) with 'Application', 'String', 'boolean'") + @Tag("MaintainedByDiffblue") + void testRegisterWithApplicationStringBoolean2() { + // Arrange + RegistrationClient registrationClient = mock(RegistrationClient.class); + when(registrationClient.register(Mockito.any(), Mockito.any())).thenReturn("Register"); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + mock(ApplicationFactory.class), registrationClient, new String[] { "https://example.org/example" }, + true); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator + .register(new Application("Name", "https://example.org/example", "https://example.org/example", + "https://example.org/example", new HashMap<>()), "https://example.org/example", true); + + // Assert + verify(registrationClient).register(eq("https://example.org/example"), isA(Application.class)); + assertEquals("Register", defaultApplicationRegistrator.getRegisteredId()); + assertTrue(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#register(Application, String, boolean)} + * with {@code Application}, {@code String}, {@code boolean}. + *

    + *
  • When {@code false}.
  • + *
+ *

+ * Method under test: + * {@link DefaultApplicationRegistrator#register(Application, String, boolean)} + */ + @Test + @DisplayName("Test register(Application, String, boolean) with 'Application', 'String', 'boolean'; when 'false'") + @Tag("MaintainedByDiffblue") + void testRegisterWithApplicationStringBoolean_whenFalse() throws RestClientException { + // Arrange + RestTemplate restTemplate = mock(RestTemplate.class); + when(restTemplate.exchange(Mockito.any(), Mockito.any(), Mockito.>any(), + Mockito.>any(), isA(Object[].class))) + .thenReturn(new ResponseEntity<>(HttpStatus.OK)); + DefaultApplicationRegistrator defaultApplicationRegistrator = new DefaultApplicationRegistrator( + mock(ApplicationFactory.class), new BlockingRegistrationClient(restTemplate), + new String[] { "https://example.org/example" }, true); + + // Act + boolean actualRegisterResult = defaultApplicationRegistrator + .register(new Application("Name", "https://example.org/example", "https://example.org/example", + "https://example.org/example", new HashMap<>()), "https://example.org/example", false); + + // Assert + verify(restTemplate).exchange(eq("https://example.org/example"), isA(HttpMethod.class), isA(HttpEntity.class), + isA(ParameterizedTypeReference.class), isA(Object[].class)); + assertNull(defaultApplicationRegistrator.getRegisteredId()); + assertFalse(actualRegisterResult); + } + + /** + * Test {@link DefaultApplicationRegistrator#getRegisteredId()}. + *

+ * Method under test: {@link DefaultApplicationRegistrator#getRegisteredId()} + */ + @Test + @DisplayName("Test getRegisteredId()") + @Tag("MaintainedByDiffblue") + void testGetRegisteredId() { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + + // Act and Assert + assertNull(new DefaultApplicationRegistrator(applicationFactory, + new BlockingRegistrationClient(mock(RestTemplate.class)), + new String[] { "https://example.org/example" }, true) + .getRegisteredId()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/RegistrationApplicationListenerDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/RegistrationApplicationListenerDiffblueTest.java new file mode 100644 index 00000000000..b6b17f64895 --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/RegistrationApplicationListenerDiffblueTest.java @@ -0,0 +1,47 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.event.ContextClosedEvent; +import org.springframework.context.support.AbstractApplicationContext; +import org.springframework.web.client.RestTemplate; + +class RegistrationApplicationListenerDiffblueTest { + + /** + * Test {@link RegistrationApplicationListener#onClosedContext(ContextClosedEvent)}. + *

    + *
  • Then calls {@link AbstractApplicationContext#getParent()}.
  • + *
+ *

+ * Method under test: + * {@link RegistrationApplicationListener#onClosedContext(ContextClosedEvent)} + */ + @Test + @DisplayName("Test onClosedContext(ContextClosedEvent); then calls getParent()") + @Tag("MaintainedByDiffblue") + void testOnClosedContext_thenCallsGetParent() { + // Arrange + ApplicationFactory applicationFactory = mock(ApplicationFactory.class); + RegistrationApplicationListener registrationApplicationListener = new RegistrationApplicationListener( + new DefaultApplicationRegistrator(applicationFactory, + new BlockingRegistrationClient(mock(RestTemplate.class)), + new String[] { "https://example.org/example" }, true)); + AnnotationConfigApplicationContext source = mock(AnnotationConfigApplicationContext.class); + when(source.getParent()).thenReturn(new AnnotationConfigReactiveWebApplicationContext()); + + // Act + registrationApplicationListener.onClosedContext(new ContextClosedEvent(source)); + + // Assert + verify(source, atLeast(1)).getParent(); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/RestClientRegistrationClientDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/RestClientRegistrationClientDiffblueTest.java new file mode 100644 index 00000000000..8962c71bde0 --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/RestClientRegistrationClientDiffblueTest.java @@ -0,0 +1,110 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.RequestBodySpec; +import org.springframework.web.client.RestClient.RequestBodyUriSpec; +import org.springframework.web.client.RestClient.ResponseSpec; + +@ContextConfiguration(classes = { RestClientRegistrationClient.class }) +@DisabledInAotMode +@ExtendWith(SpringExtension.class) +class RestClientRegistrationClientDiffblueTest { + + @MockitoBean + private RestClient restClient; + + @Autowired + private RestClientRegistrationClient restClientRegistrationClient; + + /** + * Test {@link RestClientRegistrationClient#register(String, Application)}. + *

    + *
  • Given {@link HashMap#HashMap()} {@code id} is {@code 42}.
  • + *
  • Then return {@code 42}.
  • + *
+ *

+ * Method under test: + * {@link RestClientRegistrationClient#register(String, Application)} + */ + @Test + @DisplayName("Test register(String, Application); given HashMap() 'id' is '42'; then return '42'") + @Tag("MaintainedByDiffblue") + void testRegister_givenHashMapIdIs42_thenReturn42() { + // Arrange + HashMap stringObjectMap = new HashMap<>(); + stringObjectMap.put("id", "42"); + ResponseSpec responseSpec = mock(ResponseSpec.class); + when(responseSpec.body(Mockito.>>any())) + .thenReturn(stringObjectMap); + RequestBodySpec requestBodySpec = mock(RequestBodySpec.class); + when(requestBodySpec.retrieve()).thenReturn(responseSpec); + RequestBodySpec requestBodySpec2 = mock(RequestBodySpec.class); + when(requestBodySpec2.body(Mockito.any())).thenReturn(requestBodySpec); + RequestBodySpec requestBodySpec3 = mock(RequestBodySpec.class); + when(requestBodySpec3.headers(Mockito.>any())).thenReturn(requestBodySpec2); + RequestBodyUriSpec requestBodyUriSpec = mock(RequestBodyUriSpec.class); + when(requestBodyUriSpec.uri(Mockito.any(), isA(Object[].class))).thenReturn(requestBodySpec3); + when(restClient.post()).thenReturn(requestBodyUriSpec); + + // Act + String actualRegisterResult = restClientRegistrationClient.register("https://example.org/example", + new Application("Name", "https://example.org/example", "https://example.org/example", + "https://example.org/example", new HashMap<>())); + + // Assert + verify(restClient).post(); + verify(requestBodySpec2).body(isA(Object.class)); + verify(requestBodySpec3).headers(isA(Consumer.class)); + verify(requestBodySpec).retrieve(); + verify(responseSpec).body(isA(ParameterizedTypeReference.class)); + verify(requestBodyUriSpec).uri(eq("https://example.org/example"), isA(Object[].class)); + assertEquals("42", actualRegisterResult); + } + + /** + * Test {@link RestClientRegistrationClient#setRequestHeaders(HttpHeaders)}. + *

+ * Method under test: + * {@link RestClientRegistrationClient#setRequestHeaders(HttpHeaders)} + */ + @Test + @DisplayName("Test setRequestHeaders(HttpHeaders)") + @Tag("MaintainedByDiffblue") + void testSetRequestHeaders() { + // Arrange + HttpHeaders headers = new HttpHeaders(); + + // Act + restClientRegistrationClient.setRequestHeaders(headers); + + // Assert + assertEquals(2, headers.size()); + List getResult = headers.get(HttpHeaders.CONTENT_TYPE); + assertEquals(1, getResult.size()); + assertEquals("application/json", getResult.get(0)); + assertEquals(getResult, headers.get(HttpHeaders.ACCEPT)); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactoryDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactoryDiffblueTest.java new file mode 100644 index 00000000000..4bdced2845e --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactoryDiffblueTest.java @@ -0,0 +1,72 @@ +package de.codecentric.boot.admin.client.registration; + +import static org.junit.jupiter.api.Assertions.assertNull; +import de.codecentric.boot.admin.client.config.InstanceProperties; +import de.codecentric.boot.admin.client.registration.metadata.MetadataContributor; +import jakarta.servlet.ServletContext; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; +import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; +import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; +import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration( + classes = { ServletApplicationFactory.class, InstanceProperties.class, ManagementServerProperties.class, + ServerProperties.class, WebEndpointProperties.class, DispatcherServletPath.class }) +@DisabledInAotMode +@ExtendWith(SpringExtension.class) +class ServletApplicationFactoryDiffblueTest { + + @MockitoBean + private DispatcherServletPath dispatcherServletPath; + + @Autowired + private InstanceProperties instanceProperties; + + @Autowired + private ManagementServerProperties managementServerProperties; + + @MockitoBean + private MetadataContributor metadataContributor; + + @MockitoBean + private PathMappedEndpoints pathMappedEndpoints; + + @Autowired + private ServerProperties serverProperties; + + @Autowired + private ServletApplicationFactory servletApplicationFactory; + + @MockitoBean + private ServletContext servletContext; + + @Autowired + private WebEndpointProperties webEndpointProperties; + + /** + * Test {@link ServletApplicationFactory#getDispatcherServletPrefix()}. + *

    + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: {@link ServletApplicationFactory#getDispatcherServletPrefix()} + */ + @Test + @DisplayName("Test getDispatcherServletPrefix(); then return 'null'") + @Tag("MaintainedByDiffblue") + void testGetDispatcherServletPrefix_thenReturnNull() { + // Arrange, Act and Assert + assertNull(servletApplicationFactory.getDispatcherServletPrefix()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CloudFoundryMetadataContributorDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CloudFoundryMetadataContributorDiffblueTest.java new file mode 100644 index 00000000000..ad4d5c47fce --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CloudFoundryMetadataContributorDiffblueTest.java @@ -0,0 +1,117 @@ +package de.codecentric.boot.admin.client.registration.metadata; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties; +import java.util.ArrayList; +import java.util.Map; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { CloudFoundryMetadataContributor.class, CloudFoundryApplicationProperties.class }) +@ExtendWith(SpringExtension.class) +class CloudFoundryMetadataContributorDiffblueTest { + + @Autowired + private CloudFoundryApplicationProperties cloudFoundryApplicationProperties; + + @Autowired + private CloudFoundryMetadataContributor cloudFoundryMetadataContributor; + + /** + * Test + * {@link CloudFoundryMetadataContributor#CloudFoundryMetadataContributor(CloudFoundryApplicationProperties)}. + *

+ * Method under test: + * {@link CloudFoundryMetadataContributor#CloudFoundryMetadataContributor(CloudFoundryApplicationProperties)} + */ + @Test + @DisplayName("Test new CloudFoundryMetadataContributor(CloudFoundryApplicationProperties)") + @Tag("MaintainedByDiffblue") + void testNewCloudFoundryMetadataContributor() { + // Arrange + CloudFoundryApplicationProperties cfApplicationProperties = new CloudFoundryApplicationProperties(); + cfApplicationProperties.setApplicationId("42"); + cfApplicationProperties.setInstanceIndex("Instance Index"); + cfApplicationProperties.setUris(new ArrayList<>()); + + // Act and Assert + Map metadata = new CloudFoundryMetadataContributor(cfApplicationProperties).getMetadata(); + assertEquals(2, metadata.size()); + assertEquals("42", metadata.get("applicationId")); + assertEquals("Instance Index", metadata.get("instanceId")); + } + + /** + * Test {@link CloudFoundryMetadataContributor#getMetadata()}. + *

    + *
  • Given {@link CloudFoundryApplicationProperties} (default constructor) + * ApplicationId is {@code not blank}.
  • + *
+ *

+ * Method under test: {@link CloudFoundryMetadataContributor#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata(); given CloudFoundryApplicationProperties (default constructor) ApplicationId is 'not blank'") + @Tag("MaintainedByDiffblue") + void testGetMetadata_givenCloudFoundryApplicationPropertiesApplicationIdIsNotBlank() { + // Arrange + CloudFoundryApplicationProperties cfApplicationProperties = new CloudFoundryApplicationProperties(); + cfApplicationProperties.setUris(new ArrayList<>()); + cfApplicationProperties.setApplicationId("not blank"); + cfApplicationProperties.setInstanceIndex(null); + + // Act and Assert + assertTrue(new CloudFoundryMetadataContributor(cfApplicationProperties).getMetadata().isEmpty()); + } + + /** + * Test {@link CloudFoundryMetadataContributor#getMetadata()}. + *

    + *
  • Given {@link CloudFoundryMetadataContributor}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link CloudFoundryMetadataContributor#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata(); given CloudFoundryMetadataContributor; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetMetadata_givenCloudFoundryMetadataContributor_thenReturnEmpty() { + // Arrange, Act and Assert + assertTrue(cloudFoundryMetadataContributor.getMetadata().isEmpty()); + } + + /** + * Test {@link CloudFoundryMetadataContributor#getMetadata()}. + *

    + *
  • Then return size is two.
  • + *
+ *

+ * Method under test: {@link CloudFoundryMetadataContributor#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata(); then return size is two") + @Tag("MaintainedByDiffblue") + void testGetMetadata_thenReturnSizeIsTwo() { + // Arrange + CloudFoundryApplicationProperties cfApplicationProperties = new CloudFoundryApplicationProperties(); + cfApplicationProperties.setApplicationId("42"); + cfApplicationProperties.setInstanceIndex("Instance Index"); + cfApplicationProperties.setUris(new ArrayList<>()); + + // Act + Map actualMetadata = new CloudFoundryMetadataContributor(cfApplicationProperties).getMetadata(); + + // Assert + assertEquals(2, actualMetadata.size()); + assertEquals("42", actualMetadata.get("applicationId")); + assertEquals("Instance Index", actualMetadata.get("instanceId")); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CompositeMetadataContributorDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CompositeMetadataContributorDiffblueTest.java new file mode 100644 index 00000000000..51edaceb13b --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CompositeMetadataContributorDiffblueTest.java @@ -0,0 +1,102 @@ +package de.codecentric.boot.admin.client.registration.metadata; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +class CompositeMetadataContributorDiffblueTest { + + /** + * Test {@link CompositeMetadataContributor#CompositeMetadataContributor(List)}. + *

+ * Method under test: + * {@link CompositeMetadataContributor#CompositeMetadataContributor(List)} + */ + @Test + @DisplayName("Test new CompositeMetadataContributor(List)") + @Tag("MaintainedByDiffblue") + void testNewCompositeMetadataContributor() { + // Arrange, Act and Assert + assertTrue(new CompositeMetadataContributor(new ArrayList<>()).getMetadata().isEmpty()); + } + + /** + * Test {@link CompositeMetadataContributor#getMetadata()}. + *

+ * Method under test: {@link CompositeMetadataContributor#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata()") + @Tag("MaintainedByDiffblue") + void testGetMetadata() { + // Arrange, Act and Assert + assertTrue(new CompositeMetadataContributor(new ArrayList<>()).getMetadata().isEmpty()); + } + + /** + * Test {@link CompositeMetadataContributor#getMetadata()}. + *

    + *
  • Then calls {@link MetadataContributor#getMetadata()}.
  • + *
+ *

+ * Method under test: {@link CompositeMetadataContributor#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata(); then calls getMetadata()") + @Tag("MaintainedByDiffblue") + void testGetMetadata_thenCallsGetMetadata() { + // Arrange + MetadataContributor metadataContributor = mock(MetadataContributor.class); + when(metadataContributor.getMetadata()).thenReturn(new HashMap<>()); + + ArrayList delegates = new ArrayList<>(); + delegates.add(metadataContributor); + + // Act + Map actualMetadata = new CompositeMetadataContributor(delegates).getMetadata(); + + // Assert + verify(metadataContributor).getMetadata(); + assertTrue(actualMetadata.isEmpty()); + } + + /** + * Test {@link CompositeMetadataContributor#getMetadata()}. + *

    + *
  • Then calls {@link MetadataContributor#getMetadata()}.
  • + *
+ *

+ * Method under test: {@link CompositeMetadataContributor#getMetadata()} + */ + @Test + @DisplayName("Test getMetadata(); then calls getMetadata()") + @Tag("MaintainedByDiffblue") + void testGetMetadata_thenCallsGetMetadata2() { + // Arrange + MetadataContributor metadataContributor = mock(MetadataContributor.class); + when(metadataContributor.getMetadata()).thenReturn(new HashMap<>()); + MetadataContributor metadataContributor2 = mock(MetadataContributor.class); + when(metadataContributor2.getMetadata()).thenReturn(new HashMap<>()); + + ArrayList delegates = new ArrayList<>(); + delegates.add(metadataContributor2); + delegates.add(metadataContributor); + + // Act + Map actualMetadata = new CompositeMetadataContributor(delegates).getMetadata(); + + // Assert + verify(metadataContributor2).getMetadata(); + verify(metadataContributor).getMetadata(); + assertTrue(actualMetadata.isEmpty()); + } + +} diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/StartupDateMetadataContributorDiffblueTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/StartupDateMetadataContributorDiffblueTest.java new file mode 100644 index 00000000000..8f8549fb141 --- /dev/null +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/StartupDateMetadataContributorDiffblueTest.java @@ -0,0 +1,33 @@ +package de.codecentric.boot.admin.client.registration.metadata; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { StartupDateMetadataContributor.class }) +@ExtendWith(SpringExtension.class) +class StartupDateMetadataContributorDiffblueTest { + + @Autowired + private StartupDateMetadataContributor startupDateMetadataContributor; + + /** + * Test new {@link StartupDateMetadataContributor} (default constructor). + *

+ * Method under test: default or parameterless constructor of + * {@link StartupDateMetadataContributor} + */ + @Test + @DisplayName("Test new StartupDateMetadataContributor (default constructor)") + @Tag("MaintainedByDiffblue") + void testNewStartupDateMetadataContributor() { + // Arrange, Act and Assert + assertEquals(1, new StartupDateMetadataContributor().getMetadata().size()); + } + +} diff --git a/spring-boot-admin-pitest-aggregation/pom.xml b/spring-boot-admin-pitest-aggregation/pom.xml new file mode 100644 index 00000000000..493a9c7608c --- /dev/null +++ b/spring-boot-admin-pitest-aggregation/pom.xml @@ -0,0 +1,70 @@ + + + 4.0.0 + + spring-boot-admin-pitest-aggregation + Spring Boot Admin PiTest Aggregation + Spring Boot Admin PiTest Aggregation + + pom + + + de.codecentric + spring-boot-admin-build + ${revision} + ../spring-boot-admin-build + + + + 17 + 17 + UTF-8 + + + + + de.codecentric + spring-boot-admin-server + ${revision} + + + de.codecentric + spring-boot-admin-server-cloud + ${revision} + + + de.codecentric + spring-boot-admin-server-ui + ${revision} + + + de.codecentric + spring-boot-admin-client + ${revision} + + + + + + + org.pitest + pitest-maven + + + run-mutation-tests + none + + + report + prepare-package + + report-aggregate + + + + + + + diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..6c56d687d87 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..ba285cdb1da --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/report.json b/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/report.json new file mode 100644 index 00000000000..55c9a19e2a3 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-consul/.diffblue/reports/report.json @@ -0,0 +1,232 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:35:02.471337692Z", + "command" : "dcover coverage-reports ", + "totalTime" : 107.345, + "environmentDetectionTime" : 79.102, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 107.345, + "timeToLastTest" : 107.345, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T005" : "Trivial constructor", + "T006" : "Main method", + "T012" : "Synthetic method" + }, + "summary" : { + "classesCount" : 3, + "methodsCount" : 12, + "cumulativeDiffblueTestCount" : 0, + "cumulativeManualTestCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 75, + "perMethodTestability" : { + "T000" : 4, + "T005" : 1, + "T006" : 1, + "T012" : 6 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 1, + "T006" : 1, + "T012" : 6 + } + }, + "classes" : { + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1, + "T006" : 1 + }, + "perMethodOutcome" : { + "T005" : 1, + "T006" : 1 + } + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecurityPermitAllConfig" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecuritySecureConfig" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 4 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecurityPermitAllConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 51, + 52, + 53 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecurityPermitAllConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 57, + 58, + 64 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecurityPermitAllConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 57 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecurityPermitAllConfig.lambda$filterChain$1:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58, + 60, + 62, + 59, + 58 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecuritySecureConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 75, + 76, + 77 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecuritySecureConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 81, + 82, + 83, + 85, + 92, + 94, + 95, + 96, + 103 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecuritySecureConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90, + 86, + 87, + 88, + 89, + 90, + 91, + 90 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecuritySecureConfig.lambda$filterChain$1:(Lorg/springframework/security/web/authentication/SavedRequestAwareAuthenticationSuccessHandler;Lorg/springframework/security/config/annotation/web/configurers/FormLoginConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 92, + 93, + 92 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecuritySecureConfig.lambda$filterChain$2:(Lorg/springframework/security/config/annotation/web/configurers/LogoutConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication$SecuritySecureConfig.lambda$filterChain$3:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 96, + 98, + 100, + 97, + 96 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 39 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminConsulApplication.main:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T006", + "perMethodOutcome" : "T006", + "lineNumbers" : [ + 42, + 43 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..cffe6833ef0 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..c48cbffb185 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/report.json b/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/report.json new file mode 100644 index 00000000000..5c977a7a0ed --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-eureka/.diffblue/reports/report.json @@ -0,0 +1,195 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:33:18.574623963Z", + "command" : "dcover coverage-reports ", + "totalTime" : 103.889, + "environmentDetectionTime" : 72.674, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 103.889, + "timeToLastTest" : 103.889, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T003" : "Private method", + "T005" : "Trivial constructor", + "T006" : "Main method", + "T012" : "Synthetic method" + }, + "summary" : { + "classesCount" : 1, + "methodsCount" : 10, + "cumulativeDiffblueTestCount" : 0, + "cumulativeManualTestCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 68, + "perMethodTestability" : { + "T000" : 2, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 4 + } + }, + "classes" : { + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 4 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 46, + 47, + 48 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.lambda$securityWebFilterChainPermitAll$0:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$AuthorizeExchangeSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 57 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.lambda$securityWebFilterChainSecure$1:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$AuthorizeExchangeSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 71, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 71 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.lambda$securityWebFilterChainSecure$2:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$FormLoginSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 75, + 76, + 75 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.lambda$securityWebFilterChainSecure$3:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$LogoutSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 77, + 78, + 77 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.loginSuccessHandler:(Ljava/lang/String;)Lorg/springframework/security/web/server/authentication/ServerAuthenticationSuccessHandler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 93, + 94, + 95 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.logoutSuccessHandler:(Ljava/lang/String;)Lorg/springframework/security/web/server/authentication/logout/ServerLogoutSuccessHandler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 87, + 88, + 89 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.main:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T006", + "perMethodOutcome" : "T006", + "lineNumbers" : [ + 51, + 52 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.securityWebFilterChainPermitAll:(Lorg/springframework/security/config/web/server/ServerHttpSecurity;)Lorg/springframework/security/web/server/SecurityWebFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 57, + 58, + 59, + 57 + ] + }, + "de.codecentric.boot.admin.SpringBootAdminEurekaApplication.securityWebFilterChainSecure:(Lorg/springframework/security/config/web/server/ServerHttpSecurity;)Lorg/springframework/security/web/server/SecurityWebFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 66, + 75, + 77, + 79, + 80, + 81, + 65 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..05d733f36dc --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..be89469a86d --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/report.json b/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/report.json new file mode 100644 index 00000000000..2d8e797d5ff --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/.diffblue/reports/report.json @@ -0,0 +1,310 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:30:22.102882525Z", + "command" : "dcover coverage-reports ", + "totalTime" : 106.696, + "environmentDetectionTime" : 72.442, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 106.696, + "timeToLastTest" : 106.696, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T005" : "Trivial constructor", + "T006" : "Main method", + "T012" : "Synthetic method", + "T023" : "Testability unknown" + }, + "summary" : { + "classesCount" : 3, + "methodsCount" : 17, + "cumulativeDiffblueTestCount" : 0, + "cumulativeManualTestCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 117, + "perMethodTestability" : { + "T000" : 4, + "T005" : 3, + "T006" : 1, + "T012" : 8, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 3, + "T006" : 1, + "T012" : 8, + "T023" : 1 + } + }, + "classes" : { + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecurityPermitAllConfig" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecuritySecureConfig" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 4 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecurityPermitAllConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 108, + 109, + 110 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecurityPermitAllConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 114, + 115, + 123 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecurityPermitAllConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 114 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecurityPermitAllConfig.lambda$filterChain$1:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 115, + 116, + 118, + 119, + 120, + 121, + 117, + 115 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecuritySecureConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 134, + 135, + 136 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecuritySecureConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 140, + 141, + 142, + 144, + 151, + 153, + 154, + 155, + 163 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecuritySecureConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 149, + 145, + 146, + 147, + 148, + 149, + 150, + 149 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecuritySecureConfig.lambda$filterChain$1:(Lorg/springframework/security/web/authentication/SavedRequestAwareAuthenticationSuccessHandler;Lorg/springframework/security/config/annotation/web/configurers/FormLoginConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 151, + 152, + 151 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecuritySecureConfig.lambda$filterChain$2:(Lorg/springframework/security/config/annotation/web/configurers/LogoutConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 153 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication$SecuritySecureConfig.lambda$filterChain$3:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 155, + 156, + 158, + 159, + 160, + 161, + 157, + 155 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication.hazelcastConfig:()Lcom/hazelcast/config/Config;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 68, + 69, + 70, + 76, + 77, + 78, + 80, + 79, + 81, + 83, + 84, + 85, + 86, + 89, + 90, + 91, + 92, + 93 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication.lambda$loggingNotifier$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 99 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication.lambda$loggingNotifier$1:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 99 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication.loggingNotifier:()Lde/codecentric/boot/admin/server/notify/Notifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 99 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminHazelcastApplication.main:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T006", + "perMethodOutcome" : "T006", + "lineNumbers" : [ + 59, + 60 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..a0d5ca2c856 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..5306a06f828 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/report.json b/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/report.json new file mode 100644 index 00000000000..2b0d01aded1 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-reactive/.diffblue/reports/report.json @@ -0,0 +1,213 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:27:27.583938085Z", + "command" : "dcover coverage-reports ", + "totalTime" : 94.448, + "environmentDetectionTime" : 68.638, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 94.448, + "timeToLastTest" : 94.448, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T003" : "Private method", + "T005" : "Trivial constructor", + "T006" : "Main method", + "T012" : "Synthetic method" + }, + "summary" : { + "classesCount" : 1, + "methodsCount" : 12, + "cumulativeDiffblueTestCount" : 0, + "cumulativeManualTestCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 70, + "perMethodTestability" : { + "T000" : 3, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 5 + } + }, + "classes" : { + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 2, + "T005" : 1, + "T006" : 1, + "T012" : 5 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 44, + 45, + 46 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.lambda$notifier$4:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 98 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.lambda$securityWebFilterChainPermitAll$0:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$AuthorizeExchangeSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 55 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.lambda$securityWebFilterChainSecure$1:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$AuthorizeExchangeSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 69, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 69 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.lambda$securityWebFilterChainSecure$2:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$FormLoginSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 73, + 74, + 73 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.lambda$securityWebFilterChainSecure$3:(Lorg/springframework/security/config/web/server/ServerHttpSecurity$LogoutSpec;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 75, + 76, + 75 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.loginSuccessHandler:(Ljava/lang/String;)Lorg/springframework/security/web/server/authentication/ServerAuthenticationSuccessHandler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 91, + 92, + 93 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.logoutSuccessHandler:(Ljava/lang/String;)Lorg/springframework/security/web/server/authentication/logout/ServerLogoutSuccessHandler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 85, + 86, + 87 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.main:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T006", + "perMethodOutcome" : "T006", + "lineNumbers" : [ + 49, + 50 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.notifier:()Lde/codecentric/boot/admin/server/notify/Notifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 98 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.securityWebFilterChainPermitAll:(Lorg/springframework/security/config/web/server/ServerHttpSecurity;)Lorg/springframework/security/web/server/SecurityWebFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55, + 56, + 57, + 55 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminReactiveApplication.securityWebFilterChainSecure:(Lorg/springframework/security/config/web/server/ServerHttpSecurity;)Lorg/springframework/security/web/server/SecurityWebFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 63, + 64, + 73, + 75, + 77, + 78, + 79, + 63 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..4c0c5216448 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..ac161a2e13f --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/report.json b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/report.json new file mode 100644 index 00000000000..c0e5d3ca629 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.diffblue/reports/report.json @@ -0,0 +1,575 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:25:33.250463996Z", + "command" : "dcover coverage-reports ", + "totalTime" : 114.324, + "environmentDetectionTime" : 69.733, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 114.324, + "timeToLastTest" : 114.324, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T005" : "Trivial constructor", + "T006" : "Main method", + "T012" : "Synthetic method", + "T023" : "Testability unknown" + }, + "summary" : { + "classesCount" : 7, + "methodsCount" : 38, + "cumulativeDiffblueTestCount" : 0, + "cumulativeManualTestCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 288, + "perMethodTestability" : { + "T000" : 18, + "T005" : 6, + "T006" : 1, + "T012" : 11, + "T023" : 2 + }, + "perMethodOutcome" : { + "T000" : 18, + "T005" : 6, + "T006" : 1, + "T012" : 11, + "T023" : 2 + } + }, + "classes" : { + "de.codecentric.boot.admin.sample.CustomCsrfFilter" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2 + }, + "perMethodOutcome" : { + "T000" : 2 + } + }, + "de.codecentric.boot.admin.sample.CustomEndpoint" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.sample.CustomNotifier" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.sample.NotifierConfig" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.sample.SecurityPermitAllConfig" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig" : { + "methodsCount" : 9, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T005" : 1, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 3, + "T005" : 1, + "T012" : 5 + } + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication" : { + "methodsCount" : 14, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T005" : 1, + "T006" : 1, + "T012" : 3, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T005" : 1, + "T006" : 1, + "T012" : 3, + "T023" : 1 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.sample.CustomCsrfFilter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.sample.CustomCsrfFilter.doFilterInternal:(Ljakarta/servlet/http/HttpServletRequest;Ljakarta/servlet/http/HttpServletResponse;Ljakarta/servlet/FilterChain;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38, + 40, + 42, + 43, + 45, + 46, + 47, + 48, + 52, + 53 + ] + }, + "de.codecentric.boot.admin.sample.CustomEndpoint.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.sample.CustomEndpoint.invoke:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 27 + ] + }, + "de.codecentric.boot.admin.sample.CustomNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.sample.CustomNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 36, + 37 + ] + }, + "de.codecentric.boot.admin.sample.CustomNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41 + ] + }, + "de.codecentric.boot.admin.sample.CustomNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42, + 43, + 44, + 43, + 47, + 48, + 47, + 50 + ] + }, + "de.codecentric.boot.admin.sample.NotifierConfig.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/beans/factory/ObjectProvider;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 42, + 43, + 44, + 45 + ] + }, + "de.codecentric.boot.admin.sample.NotifierConfig.filteringNotifier:()Lde/codecentric/boot/admin/server/notify/filter/FilteringNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 49, + 50 + ] + }, + "de.codecentric.boot.admin.sample.NotifierConfig.remindingNotifier:()Lde/codecentric/boot/admin/server/notify/RemindingNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 56, + 57, + 58, + 59 + ] + }, + "de.codecentric.boot.admin.sample.SecurityPermitAllConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 40, + 41, + 42 + ] + }, + "de.codecentric.boot.admin.sample.SecurityPermitAllConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 47, + 49, + 50, + 59 + ] + }, + "de.codecentric.boot.admin.sample.SecurityPermitAllConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.sample.SecurityPermitAllConfig.lambda$filterChain$1:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 50, + 51, + 53, + 54, + 55, + 56, + 57, + 52, + 50 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;Lorg/springframework/boot/autoconfigure/security/SecurityProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 54, + 55, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 61, + 62, + 63, + 65, + 78, + 80, + 81, + 83, + 84, + 92, + 94 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 76, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 76 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.lambda$filterChain$1:(Lorg/springframework/security/web/authentication/SavedRequestAwareAuthenticationSuccessHandler;Lorg/springframework/security/config/annotation/web/configurers/FormLoginConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 79 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.lambda$filterChain$2:(Lorg/springframework/security/config/annotation/web/configurers/LogoutConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.lambda$filterChain$3:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 84, + 85, + 87, + 88, + 89, + 86, + 84 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.lambda$filterChain$4:(Lorg/springframework/security/config/annotation/web/configurers/RememberMeConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 92 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.passwordEncoder:()Lorg/springframework/security/crypto/password/PasswordEncoder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107 + ] + }, + "de.codecentric.boot.admin.sample.SecuritySecureConfig.userDetailsService:(Lorg/springframework/security/crypto/password/PasswordEncoder;)Lorg/springframework/security/provisioning/InMemoryUserDetailsManager;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 101, + 102 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 48 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.auditEventRepository:()Lorg/springframework/boot/actuate/audit/AuditEventRepository;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 102 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.auditLog:()Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 66 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.cacheManager:()Lorg/springframework/cache/CacheManager;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.customEndpoint:()Lde/codecentric/boot/admin/sample/CustomEndpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 81 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.customHttpHeadersProvider:()Lde/codecentric/boot/admin/server/web/client/HttpHeadersProvider;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 87 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.customNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)Lde/codecentric/boot/admin/sample/CustomNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.dataSource:()Lorg/springframework/jdbc/datasource/embedded/EmbeddedDatabase;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107, + 108, + 109, + 107 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.httpTraceRepository:()Lorg/springframework/boot/actuate/web/exchanges/HttpExchangeRepository;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 97 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.lambda$auditLog$0:(Lorg/springframework/web/reactive/function/client/ClientRequest;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/reactivestreams/Subscription;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 67, + 68, + 70 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.lambda$auditLog$1:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 66 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.lambda$customHttpHeadersProvider$2:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 88, + 89, + 90 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminServletApplication.main:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T006", + "perMethodOutcome" : "T006", + "lineNumbers" : [ + 53, + 54, + 55, + 56 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..2bce339dd7d --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..5b805a295c0 --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/report.json b/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/report.json new file mode 100644 index 00000000000..9d4ea6a85ee --- /dev/null +++ b/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/.diffblue/reports/report.json @@ -0,0 +1,240 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:36:49.8267933Z", + "command" : "dcover coverage-reports ", + "totalTime" : 97.268, + "environmentDetectionTime" : 68.964, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 97.268, + "timeToLastTest" : 97.268, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T005" : "Trivial constructor", + "T006" : "Main method", + "T012" : "Synthetic method" + }, + "summary" : { + "classesCount" : 3, + "methodsCount" : 12, + "cumulativeDiffblueTestCount" : 0, + "cumulativeManualTestCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 75, + "perMethodTestability" : { + "T000" : 2, + "T005" : 3, + "T006" : 1, + "T012" : 6 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 3, + "T006" : 1, + "T012" : 6 + } + }, + "classes" : { + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1, + "T006" : 1 + }, + "perMethodOutcome" : { + "T005" : 1, + "T006" : 1 + } + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecurityPermitAllConfig" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecuritySecureConfig" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 4 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecurityPermitAllConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 51, + 52, + 53 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecurityPermitAllConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 57, + 58, + 65 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecurityPermitAllConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 57 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecurityPermitAllConfig.lambda$filterChain$1:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58, + 60, + 61, + 62, + 63, + 59, + 58 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecuritySecureConfig.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 76, + 77, + 78 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecuritySecureConfig.filterChain:(Lorg/springframework/security/config/annotation/web/builders/HttpSecurity;)Lorg/springframework/security/web/SecurityFilterChain;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 82, + 83, + 84, + 86, + 93, + 95, + 96, + 97, + 104 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecuritySecureConfig.lambda$filterChain$0:(Lorg/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 91, + 87, + 88, + 89, + 90, + 91, + 92, + 91 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecuritySecureConfig.lambda$filterChain$1:(Lorg/springframework/security/web/authentication/SavedRequestAwareAuthenticationSuccessHandler;Lorg/springframework/security/config/annotation/web/configurers/FormLoginConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 93, + 94, + 93 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecuritySecureConfig.lambda$filterChain$2:(Lorg/springframework/security/config/annotation/web/configurers/LogoutConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 95 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication$SecuritySecureConfig.lambda$filterChain$3:(Lorg/springframework/security/config/annotation/web/configurers/CsrfConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 97, + 99, + 100, + 101, + 102, + 98, + 97 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 39 + ] + }, + "de.codecentric.boot.admin.sample.SpringBootAdminZookeeperApplication.main:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T006", + "perMethodOutcome" : "T006", + "lineNumbers" : [ + 42, + 43 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-server-cloud/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-server-cloud/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..5f9d26cceed --- /dev/null +++ b/spring-boot-admin-server-cloud/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-server-cloud/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-server-cloud/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..c69878b29b6 --- /dev/null +++ b/spring-boot-admin-server-cloud/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-server-cloud/.diffblue/reports/report.json b/spring-boot-admin-server-cloud/.diffblue/reports/report.json new file mode 100644 index 00000000000..736d3393fee --- /dev/null +++ b/spring-boot-admin-server-cloud/.diffblue/reports/report.json @@ -0,0 +1,947 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:38:27.102128665Z", + "command" : "dcover coverage-reports ", + "totalTime" : 115.092, + "environmentDetectionTime" : 69.952, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 115.092, + "timeToLastTest" : 115.092, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T001" : "Trivial getter", + "T002" : "Trivial setter", + "T003" : "Private method", + "T005" : "Trivial constructor", + "T010" : "Abstract or interface method", + "T012" : "Synthetic method", + "T023" : "Testability unknown" + }, + "summary" : { + "classesCount" : 11, + "methodsCount" : 66, + "cumulativeDiffblueTestCount" : 135, + "cumulativeManualTestCount" : 36, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 453, + "perMethodTestability" : { + "T000" : 30, + "T001" : 6, + "T002" : 7, + "T003" : 8, + "T005" : 5, + "T010" : 1, + "T012" : 7, + "T023" : 2 + }, + "perMethodOutcome" : { + "T000" : 30, + "T001" : 6, + "T002" : 7, + "T003" : 8, + "T005" : 5, + "T010" : 1, + "T012" : 7, + "T023" : 2 + } + }, + "classes" : { + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$EurekaConverterConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesConverterConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesDiscoveryClientCondition" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1 + }, + "perMethodOutcome" : { + "T003" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesDiscoveryClientCondition$Fabric8KubernetesCondition" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1 + }, + "perMethodOutcome" : { + "T003" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesDiscoveryClientCondition$OfficialKubernetesCondition" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1 + }, + "perMethodOutcome" : { + "T003" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter" : { + "methodsCount" : 18, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 10, + "T001" : 2, + "T002" : 2, + "T003" : 1, + "T005" : 1, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 10, + "T001" : 2, + "T002" : 2, + "T003" : 1, + "T005" : 1, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.discovery.EurekaServiceInstanceConverter" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener" : { + "methodsCount" : 33, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 13, + "T001" : 4, + "T002" : 5, + "T003" : 4, + "T012" : 6, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 13, + "T001" : 4, + "T002" : 5, + "T003" : 4, + "T012" : 6, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.cloud.discovery.KubernetesServiceInstanceConverter" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2 + }, + "perMethodOutcome" : { + "T000" : 2 + } + }, + "de.codecentric.boot.admin.server.cloud.discovery.ServiceInstanceConverter" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$EurekaConverterConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 74 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$EurekaConverterConfiguration.serviceInstanceConverter:()Lde/codecentric/boot/admin/server/cloud/discovery/EurekaServiceInstanceConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesConverterConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 87 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesConverterConfiguration.serviceInstanceConverter:(Lorg/springframework/cloud/kubernetes/commons/discovery/KubernetesDiscoveryProperties;)Lde/codecentric/boot/admin/server/cloud/discovery/KubernetesServiceInstanceConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 93 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesDiscoveryClientCondition$Fabric8KubernetesCondition.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 110 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesDiscoveryClientCondition$OfficialKubernetesCondition.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 105 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration$KubernetesDiscoveryClientCondition.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 101, + 102 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 52 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration.instanceDiscoveryListener:(Lde/codecentric/boot/admin/server/cloud/discovery/ServiceInstanceConverter;Lorg/springframework/cloud/client/discovery/DiscoveryClient;Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)Lde/codecentric/boot/admin/server/cloud/discovery/InstanceDiscoveryListener;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 59, + 60, + 61 + ] + }, + "de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration.serviceInstanceConverter:()Lde/codecentric/boot/admin/server/cloud/discovery/DefaultServiceInstanceConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 68 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 45, + 63, + 69 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.convert:(Lorg/springframework/cloud/client/ServiceInstance;)Lde/codecentric/boot/admin/server/domain/values/Registration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 84, + 85, + 84, + 87, + 88, + 89, + 91, + 92, + 93, + 94, + 95, + 91 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getHealthEndpointPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 188 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getHealthPath:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107, + 108, + 109, + 111 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getHealthUrl:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 99, + 100, + 101, + 102, + 103, + 99 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getManagementContextPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 180 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getManagementHost:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 144, + 145, + 146, + 148 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getManagementPath:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 160, + 161, + 162, + 164 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getManagementPort:(Lorg/springframework/cloud/client/ServiceInstance;)I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 152, + 153, + 154, + 156 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getManagementScheme:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 136, + 137, + 138, + 140 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getManagementUrl:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 115, + 116, + 117, + 118, + 121, + 122, + 123, + 126, + 127, + 128, + 132 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getMetadata:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 172, + 176, + 172, + 173, + 174, + 175, + 176, + 172 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getMetadataValue:(Lorg/springframework/cloud/client/ServiceInstance;[Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 72, + 73, + 74, + 75, + 76, + 73, + 79 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.getServiceUrl:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 168 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.lambda$getMetadata$0:(Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 175 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.setHealthEndpointPath:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 192, + 193 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter.setManagementContextPath:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 184, + 185 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.EurekaServiceInstanceConverter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.EurekaServiceInstanceConverter.getHealthUrl:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37, + 38, + 41, + 42, + 43, + 44, + 46 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.:(Lorg/springframework/cloud/client/discovery/DiscoveryClient;Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 93, + 64, + 66, + 72, + 78, + 84, + 90, + 94, + 95, + 96, + 97 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.discover:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 141 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.discoverIfNeeded:(Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 125, + 126, + 128 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.getIgnoredInstancesMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 225 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.getIgnoredServices:()Ljava/util/Set;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 205 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.getInstancesMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.getServices:()Ljava/util/Set;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 209 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.isInstanceAllowedBasedOnMetadata:(Lorg/springframework/cloud/client/ServiceInstance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 233, + 234, + 237, + 238, + 239, + 241, + 243 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.isInstanceIgnoredBasedOnMetadata:(Lorg/springframework/cloud/client/ServiceInstance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 247, + 248, + 251, + 252, + 253, + 255, + 257 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.isMapContainsEntry:(Ljava/util/Map;Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 261, + 262 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.lambda$discover$0:(Ljava/lang/Void;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.lambda$discover$1:(Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.lambda$matchesPattern$5:(Ljava/lang/String;Ljava/lang/String;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 164 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.lambda$removeStaleInstances$2:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 146 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.lambda$removeStaleInstances$3:(Ljava/util/Set;Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 148 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.lambda$removeStaleInstances$4:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 149 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.matchesPattern:(Ljava/lang/String;Ljava/util/Set;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 163, + 164, + 163 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.onApplicationEvent:(Lorg/springframework/cloud/client/discovery/event/HeartbeatEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 121, + 122 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.onApplicationReady:(Lorg/springframework/boot/context/event/ApplicationReadyEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 101, + 102 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.onInstanceRegistered:(Lorg/springframework/cloud/client/discovery/event/InstanceRegisteredEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 106, + 107 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.onParentHeartbeat:(Lorg/springframework/cloud/client/discovery/event/ParentHeartbeatEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 116, + 117 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.onRefreshInstances:(Lde/codecentric/boot/admin/server/web/client/RefreshInstancesEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 111, + 112 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.registerInstance:(Lorg/springframework/cloud/client/ServiceInstance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 179, + 180, + 181, + 183, + 184, + 185 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.removeStaleInstances:(Ljava/util/Set;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 144 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.setConverter:(Lde/codecentric/boot/admin/server/cloud/discovery/ServiceInstanceConverter;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 197, + 198 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.setIgnoredInstancesMetadata:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 229, + 230 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.setIgnoredServices:(Ljava/util/Set;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 201, + 202 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.setInstancesMetadata:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 221, + 222 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.setServices:(Ljava/util/Set;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 213, + 214 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.shouldRegisterInstanceBasedOnMetadata:(Lorg/springframework/cloud/client/ServiceInstance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 168, + 169, + 170, + 171, + 172, + 171, + 174 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.shouldRegisterService:(Ljava/lang/String;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 155, + 156, + 157, + 159 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.InstanceDiscoveryListener.toString:(Lorg/springframework/cloud/client/ServiceInstance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 190, + 191, + 192, + 193, + 191 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.KubernetesServiceInstanceConverter.:(Lorg/springframework/cloud/kubernetes/commons/discovery/KubernetesDiscoveryProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 30, + 31, + 32, + 35, + 37 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.KubernetesServiceInstanceConverter.getManagementPort:(Lorg/springframework/cloud/client/ServiceInstance;)I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 44, + 45, + 46, + 48 + ] + }, + "de.codecentric.boot.admin.server.cloud.discovery.ServiceInstanceConverter.convert:(Lorg/springframework/cloud/client/ServiceInstance;)Lde/codecentric/boot/admin/server/domain/values/Registration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-server-cloud/pom.xml b/spring-boot-admin-server-cloud/pom.xml index 6296aafcd53..7f213cf4657 100644 --- a/spring-boot-admin-server-cloud/pom.xml +++ b/spring-boot-admin-server-cloud/pom.xml @@ -121,5 +121,11 @@ reactor-test test + + org.junit.platform + junit-platform-launcher + 1.12.1 + test + diff --git a/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/config/AdminServerDiscoveryAutoConfigurationDiffblueTest.java b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/config/AdminServerDiscoveryAutoConfigurationDiffblueTest.java new file mode 100644 index 00000000000..2d29deb9e93 --- /dev/null +++ b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/config/AdminServerDiscoveryAutoConfigurationDiffblueTest.java @@ -0,0 +1,139 @@ +package de.codecentric.boot.admin.server.cloud.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration.EurekaConverterConfiguration; +import de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration.KubernetesConverterConfiguration; +import de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter; +import de.codecentric.boot.admin.server.cloud.discovery.EurekaServiceInstanceConverter; +import de.codecentric.boot.admin.server.cloud.discovery.KubernetesServiceInstanceConverter; +import java.util.HashMap; +import java.util.HashSet; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties; +import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties.Metadata; + +class AdminServerDiscoveryAutoConfigurationDiffblueTest { + + /** + * Test EurekaConverterConfiguration + * {@link EurekaConverterConfiguration#serviceInstanceConverter()}. + *

+ * Method under test: {@link EurekaConverterConfiguration#serviceInstanceConverter()} + */ + @Test + @DisplayName("Test EurekaConverterConfiguration serviceInstanceConverter()") + @Tag("MaintainedByDiffblue") + void testEurekaConverterConfigurationServiceInstanceConverter() { + // Arrange and Act + EurekaServiceInstanceConverter actualServiceInstanceConverterResult = new EurekaConverterConfiguration() + .serviceInstanceConverter(); + + // Assert + assertEquals("/actuator", actualServiceInstanceConverterResult.getManagementContextPath()); + assertEquals("health", actualServiceInstanceConverterResult.getHealthEndpointPath()); + } + + /** + * Test KubernetesConverterConfiguration + * {@link KubernetesConverterConfiguration#serviceInstanceConverter(KubernetesDiscoveryProperties)}. + *

+ * Method under test: + * {@link KubernetesConverterConfiguration#serviceInstanceConverter(KubernetesDiscoveryProperties)} + */ + @Test + @DisplayName("Test KubernetesConverterConfiguration serviceInstanceConverter(KubernetesDiscoveryProperties)") + @Tag("MaintainedByDiffblue") + void testKubernetesConverterConfigurationServiceInstanceConverter() { + // Arrange + KubernetesConverterConfiguration kubernetesConverterConfiguration = new KubernetesConverterConfiguration(); + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + HashMap serviceLabels = new HashMap<>(); + + // Act + KubernetesServiceInstanceConverter actualServiceInstanceConverterResult = kubernetesConverterConfiguration + .serviceInstanceConverter(new KubernetesDiscoveryProperties(true, true, namespaces, true, 1L, true, + "Filter", knownSecurePorts, serviceLabels, "Primary Port Name", + new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, "Ports Prefix"), 1, true)); + + // Assert + assertEquals("/actuator", actualServiceInstanceConverterResult.getManagementContextPath()); + assertEquals("health", actualServiceInstanceConverterResult.getHealthEndpointPath()); + } + + /** + * Test KubernetesConverterConfiguration + * {@link KubernetesConverterConfiguration#serviceInstanceConverter(KubernetesDiscoveryProperties)}. + *

+ * Method under test: + * {@link KubernetesConverterConfiguration#serviceInstanceConverter(KubernetesDiscoveryProperties)} + */ + @Test + @DisplayName("Test KubernetesConverterConfiguration serviceInstanceConverter(KubernetesDiscoveryProperties)") + @Tag("MaintainedByDiffblue") + void testKubernetesConverterConfigurationServiceInstanceConverter2() { + // Arrange + KubernetesConverterConfiguration kubernetesConverterConfiguration = new KubernetesConverterConfiguration(); + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + + // Act + KubernetesServiceInstanceConverter actualServiceInstanceConverterResult = kubernetesConverterConfiguration + .serviceInstanceConverter(new KubernetesDiscoveryProperties(true, true, namespaces, true, 1L, true, + "Filter", knownSecurePorts, new HashMap<>(), "Primary Port Name", null, 1, true)); + + // Assert + assertEquals("/actuator", actualServiceInstanceConverterResult.getManagementContextPath()); + assertEquals("health", actualServiceInstanceConverterResult.getHealthEndpointPath()); + } + + /** + * Test KubernetesConverterConfiguration + * {@link KubernetesConverterConfiguration#serviceInstanceConverter(KubernetesDiscoveryProperties)}. + *

+ * Method under test: + * {@link KubernetesConverterConfiguration#serviceInstanceConverter(KubernetesDiscoveryProperties)} + */ + @Test + @DisplayName("Test KubernetesConverterConfiguration serviceInstanceConverter(KubernetesDiscoveryProperties)") + @Tag("MaintainedByDiffblue") + void testKubernetesConverterConfigurationServiceInstanceConverter3() { + // Arrange + KubernetesConverterConfiguration kubernetesConverterConfiguration = new KubernetesConverterConfiguration(); + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + HashMap serviceLabels = new HashMap<>(); + + // Act + KubernetesServiceInstanceConverter actualServiceInstanceConverterResult = kubernetesConverterConfiguration + .serviceInstanceConverter(new KubernetesDiscoveryProperties(true, true, namespaces, true, 1L, true, + "Filter", knownSecurePorts, serviceLabels, "Primary Port Name", + new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, null), 1, true)); + + // Assert + assertEquals("/actuator", actualServiceInstanceConverterResult.getManagementContextPath()); + assertEquals("health", actualServiceInstanceConverterResult.getHealthEndpointPath()); + } + + /** + * Test {@link AdminServerDiscoveryAutoConfiguration#serviceInstanceConverter()}. + *

+ * Method under test: + * {@link AdminServerDiscoveryAutoConfiguration#serviceInstanceConverter()} + */ + @Test + @DisplayName("Test serviceInstanceConverter()") + @Tag("MaintainedByDiffblue") + void testServiceInstanceConverter() { + // Arrange and Act + DefaultServiceInstanceConverter actualServiceInstanceConverterResult = new AdminServerDiscoveryAutoConfiguration() + .serviceInstanceConverter(); + + // Assert + assertEquals("/actuator", actualServiceInstanceConverterResult.getManagementContextPath()); + assertEquals("health", actualServiceInstanceConverterResult.getHealthEndpointPath()); + } + +} diff --git a/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/DefaultServiceInstanceConverterDiffblueTest.java b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/DefaultServiceInstanceConverterDiffblueTest.java new file mode 100644 index 00000000000..38ca13853b7 --- /dev/null +++ b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/DefaultServiceInstanceConverterDiffblueTest.java @@ -0,0 +1,454 @@ +package de.codecentric.boot.admin.server.cloud.discovery; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import de.codecentric.boot.admin.server.domain.values.Registration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.client.DefaultServiceInstance; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties; +import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties.Metadata; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { DefaultServiceInstanceConverter.class }) +@ExtendWith(SpringExtension.class) +class DefaultServiceInstanceConverterDiffblueTest { + + @Autowired + private DefaultServiceInstanceConverter defaultServiceInstanceConverter; + + /** + * Test + * {@link DefaultServiceInstanceConverter#getMetadataValue(ServiceInstance, String[])}. + *

    + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getMetadataValue(ServiceInstance, String[])} + */ + @Test + @DisplayName("Test getMetadataValue(ServiceInstance, String[]); then return 'null'") + @Tag("MaintainedByDiffblue") + void testGetMetadataValue_thenReturnNull() { + // Arrange, Act and Assert + assertNull(DefaultServiceInstanceConverter + .getMetadataValue(new DefaultServiceInstance("42", "42", "localhost", 8080, true), "Keys")); + } + + /** + * Test {@link DefaultServiceInstanceConverter#convert(ServiceInstance)}. + *

+ * Method under test: {@link DefaultServiceInstanceConverter#convert(ServiceInstance)} + */ + @Test + @DisplayName("Test convert(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testConvert() { + // Arrange and Act + Registration actualConvertResult = defaultServiceInstanceConverter + .convert(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + + // Assert + assertEquals("42", actualConvertResult.getName()); + assertEquals("https://localhost:8080", actualConvertResult.getServiceUrl()); + assertEquals("https://localhost:8080/actuator", actualConvertResult.getManagementUrl()); + assertEquals("https://localhost:8080/actuator/health", actualConvertResult.getHealthUrl()); + assertNull(actualConvertResult.getSource()); + assertTrue(actualConvertResult.getMetadata().isEmpty()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#convert(ServiceInstance)}. + *

+ * Method under test: {@link DefaultServiceInstanceConverter#convert(ServiceInstance)} + */ + @Test + @DisplayName("Test convert(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testConvert2() { + // Arrange + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + HashMap serviceLabels = new HashMap<>(); + KubernetesServiceInstanceConverter kubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + new KubernetesDiscoveryProperties(true, true, namespaces, true, 3L, true, + "Converting service '{}' running at '{}' with metadata {}", knownSecurePorts, serviceLabels, + "Converting service '{}' running at '{}' with metadata {}", + new Metadata(true, "Converting service '{}' running at '{}' with metadata {}", true, + "Converting service '{}' running at '{}' with metadata {}", true, + "Converting service '{}' running at '{}' with metadata {}"), + 3, true)); + + // Act + Registration actualConvertResult = kubernetesServiceInstanceConverter.convert(new DefaultServiceInstance( + "Converting service '{}' running at '{}' with metadata {}", "42", "localhost", 8080, true)); + + // Assert + assertEquals("42", actualConvertResult.getName()); + assertEquals("https://localhost:8080", actualConvertResult.getServiceUrl()); + assertEquals("https://localhost:8080/actuator", actualConvertResult.getManagementUrl()); + assertEquals("https://localhost:8080/actuator/health", actualConvertResult.getHealthUrl()); + assertNull(actualConvertResult.getSource()); + assertTrue(actualConvertResult.getMetadata().isEmpty()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getHealthUrl(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getHealthUrl(ServiceInstance)} + */ + @Test + @DisplayName("Test getHealthUrl(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetHealthUrl() { + // Arrange, Act and Assert + assertEquals("https://localhost:8080/actuator/health", + defaultServiceInstanceConverter + .getHealthUrl(new DefaultServiceInstance("42", "42", "localhost", 8080, true)) + .toString()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getHealthUrl(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getHealthUrl(ServiceInstance)} + */ + @Test + @DisplayName("Test getHealthUrl(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetHealthUrl2() { + // Arrange + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + HashMap serviceLabels = new HashMap<>(); + KubernetesServiceInstanceConverter kubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + new KubernetesDiscoveryProperties(true, true, namespaces, true, 1L, true, "Filter", knownSecurePorts, + serviceLabels, "Primary Port Name", + new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, "Ports Prefix"), 1, + true)); + + // Act and Assert + assertEquals("https://localhost:8080/actuator/health", + kubernetesServiceInstanceConverter + .getHealthUrl(new DefaultServiceInstance("localhost", "42", "localhost", 8080, true)) + .toString()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getHealthPath(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getHealthPath(ServiceInstance)} + */ + @Test + @DisplayName("Test getHealthPath(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetHealthPath() { + // Arrange, Act and Assert + assertEquals("health", defaultServiceInstanceConverter + .getHealthPath(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getManagementUrl(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getManagementUrl(ServiceInstance)} + */ + @Test + @DisplayName("Test getManagementUrl(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetManagementUrl() { + // Arrange, Act and Assert + assertEquals("https://localhost:8080/actuator", + defaultServiceInstanceConverter + .getManagementUrl(new DefaultServiceInstance("42", "42", "localhost", 8080, true)) + .toString()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getManagementUrl(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getManagementUrl(ServiceInstance)} + */ + @Test + @DisplayName("Test getManagementUrl(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetManagementUrl2() { + // Arrange + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + HashMap serviceLabels = new HashMap<>(); + KubernetesServiceInstanceConverter kubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + new KubernetesDiscoveryProperties(true, true, namespaces, true, 1L, true, "Filter", knownSecurePorts, + serviceLabels, "Primary Port Name", + new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, "Ports Prefix"), 1, + true)); + + // Act and Assert + assertEquals("https://localhost:8080/actuator", + kubernetesServiceInstanceConverter + .getManagementUrl(new DefaultServiceInstance("localhost", "42", "localhost", 8080, true)) + .toString()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getManagementHost(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getManagementHost(ServiceInstance)} + */ + @Test + @DisplayName("Test getManagementHost(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetManagementHost() { + // Arrange, Act and Assert + assertEquals("localhost", defaultServiceInstanceConverter + .getManagementHost(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getManagementPort(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getManagementPort(ServiceInstance)} + */ + @Test + @DisplayName("Test getManagementPort(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetManagementPort() { + // Arrange + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + HashMap serviceLabels = new HashMap<>(); + KubernetesServiceInstanceConverter kubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + new KubernetesDiscoveryProperties(true, true, namespaces, true, 1L, true, "Filter", knownSecurePorts, + serviceLabels, "Primary Port Name", + new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, "Ports Prefix"), 1, + true)); + + // Act and Assert + assertEquals(8080, kubernetesServiceInstanceConverter + .getManagementPort(new DefaultServiceInstance("Instance Id", "42", "localhost", 8080, true))); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getManagementPort(ServiceInstance)}. + *

    + *
  • Given {@link DefaultServiceInstanceConverter}.
  • + *
+ *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getManagementPort(ServiceInstance)} + */ + @Test + @DisplayName("Test getManagementPort(ServiceInstance); given DefaultServiceInstanceConverter") + @Tag("MaintainedByDiffblue") + void testGetManagementPort_givenDefaultServiceInstanceConverter() { + // Arrange, Act and Assert + assertEquals(8080, defaultServiceInstanceConverter + .getManagementPort(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getManagementPath(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getManagementPath(ServiceInstance)} + */ + @Test + @DisplayName("Test getManagementPath(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetManagementPath() { + // Arrange, Act and Assert + assertEquals("/actuator", defaultServiceInstanceConverter + .getManagementPath(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getServiceUrl(ServiceInstance)}. + *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getServiceUrl(ServiceInstance)} + */ + @Test + @DisplayName("Test getServiceUrl(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetServiceUrl() { + // Arrange, Act and Assert + assertEquals("https://localhost:8080", + defaultServiceInstanceConverter + .getServiceUrl(new DefaultServiceInstance("42", "42", "localhost", 8080, true)) + .toString()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)}. + *

    + *
  • Given {@code 42}.
  • + *
  • When {@link HashMap#HashMap()} {@code 42} is {@code 42}.
  • + *
  • Then return {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)} + */ + @Test + @DisplayName("Test getMetadata(ServiceInstance); given '42'; when HashMap() '42' is '42'; then return HashMap()") + @Tag("MaintainedByDiffblue") + void testGetMetadata_given42_whenHashMap42Is42_thenReturnHashMap() { + // Arrange + DefaultServiceInstanceConverter defaultServiceInstanceConverter = new DefaultServiceInstanceConverter(); + + HashMap metadata = new HashMap<>(); + metadata.put("42", "42"); + metadata.put("foo", "foo"); + + // Act and Assert + assertEquals(metadata, defaultServiceInstanceConverter + .getMetadata(new DefaultServiceInstance("42", "42", "localhost", 8080, true, metadata))); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)}. + *

    + *
  • Given {@link DefaultServiceInstanceConverter}.
  • + *
+ *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)} + */ + @Test + @DisplayName("Test getMetadata(ServiceInstance); given DefaultServiceInstanceConverter") + @Tag("MaintainedByDiffblue") + void testGetMetadata_givenDefaultServiceInstanceConverter() { + // Arrange, Act and Assert + assertTrue(defaultServiceInstanceConverter + .getMetadata(new DefaultServiceInstance("42", "42", "localhost", 8080, true)) + .isEmpty()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)}. + *

    + *
  • Given {@code null}.
  • + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code null}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)} + */ + @Test + @DisplayName("Test getMetadata(ServiceInstance); given 'null'; when HashMap() 'foo' is 'null'; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetMetadata_givenNull_whenHashMapFooIsNull_thenReturnEmpty() { + // Arrange + DefaultServiceInstanceConverter defaultServiceInstanceConverter = new DefaultServiceInstanceConverter(); + + HashMap metadata = new HashMap<>(); + metadata.put("foo", null); + + // Act and Assert + assertTrue(defaultServiceInstanceConverter + .getMetadata(new DefaultServiceInstance("42", "42", "localhost", 8080, true, metadata)) + .isEmpty()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)}. + *

    + *
  • Given {@code null}.
  • + *
  • When {@link HashMap#HashMap()} {@code null} is {@code foo}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)} + */ + @Test + @DisplayName("Test getMetadata(ServiceInstance); given 'null'; when HashMap() 'null' is 'foo'; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetMetadata_givenNull_whenHashMapNullIsFoo_thenReturnEmpty() { + // Arrange + DefaultServiceInstanceConverter defaultServiceInstanceConverter = new DefaultServiceInstanceConverter(); + + HashMap metadata = new HashMap<>(); + metadata.put(null, "foo"); + + // Act and Assert + assertTrue(defaultServiceInstanceConverter + .getMetadata(new DefaultServiceInstance("42", "42", "localhost", 8080, true, metadata)) + .isEmpty()); + } + + /** + * Test {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)}. + *

    + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code foo}.
  • + *
  • Then return size is one.
  • + *
+ *

+ * Method under test: + * {@link DefaultServiceInstanceConverter#getMetadata(ServiceInstance)} + */ + @Test + @DisplayName("Test getMetadata(ServiceInstance); when HashMap() 'foo' is 'foo'; then return size is one") + @Tag("MaintainedByDiffblue") + void testGetMetadata_whenHashMapFooIsFoo_thenReturnSizeIsOne() { + // Arrange + DefaultServiceInstanceConverter defaultServiceInstanceConverter = new DefaultServiceInstanceConverter(); + + HashMap metadata = new HashMap<>(); + metadata.put("foo", "foo"); + + // Act + Map actualMetadata = defaultServiceInstanceConverter + .getMetadata(new DefaultServiceInstance("42", "42", "localhost", 8080, true, metadata)); + + // Assert + assertEquals(1, actualMetadata.size()); + assertEquals("foo", actualMetadata.get("foo")); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • default or parameterless constructor of {@link DefaultServiceInstanceConverter} + *
  • {@link DefaultServiceInstanceConverter#setHealthEndpointPath(String)} + *
  • {@link DefaultServiceInstanceConverter#setManagementContextPath(String)} + *
  • {@link DefaultServiceInstanceConverter#getHealthEndpointPath()} + *
  • {@link DefaultServiceInstanceConverter#getManagementContextPath()} + *
+ */ + @Test + @DisplayName("Test getters and setters") + @Tag("MaintainedByDiffblue") + void testGettersAndSetters() { + // Arrange and Act + DefaultServiceInstanceConverter actualDefaultServiceInstanceConverter = new DefaultServiceInstanceConverter(); + actualDefaultServiceInstanceConverter.setHealthEndpointPath("https://config.us-east-2.amazonaws.com"); + actualDefaultServiceInstanceConverter.setManagementContextPath("Management Context Path"); + String actualHealthEndpointPath = actualDefaultServiceInstanceConverter.getHealthEndpointPath(); + + // Assert + assertEquals("Management Context Path", actualDefaultServiceInstanceConverter.getManagementContextPath()); + assertEquals("https://config.us-east-2.amazonaws.com", actualHealthEndpointPath); + } + +} diff --git a/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/EurekaServiceInstanceConverterDiffblueTest.java b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/EurekaServiceInstanceConverterDiffblueTest.java new file mode 100644 index 00000000000..412ce6a8da8 --- /dev/null +++ b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/EurekaServiceInstanceConverterDiffblueTest.java @@ -0,0 +1,59 @@ +package de.codecentric.boot.admin.server.cloud.discovery; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.client.DefaultServiceInstance; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { EurekaServiceInstanceConverter.class }) +@ExtendWith(SpringExtension.class) +class EurekaServiceInstanceConverterDiffblueTest { + + @Autowired + private EurekaServiceInstanceConverter eurekaServiceInstanceConverter; + + /** + * Test {@link EurekaServiceInstanceConverter#getHealthUrl(ServiceInstance)}. + *
    + *
  • Then return toString is {@code https://localhost:8080/actuator/health}.
  • + *
+ *

+ * Method under test: + * {@link EurekaServiceInstanceConverter#getHealthUrl(ServiceInstance)} + */ + @Test + @DisplayName("Test getHealthUrl(ServiceInstance); then return toString is 'https://localhost:8080/actuator/health'") + @Tag("MaintainedByDiffblue") + void testGetHealthUrl_thenReturnToStringIsHttpsLocalhost8080ActuatorHealth() { + // Arrange, Act and Assert + assertEquals("https://localhost:8080/actuator/health", + eurekaServiceInstanceConverter + .getHealthUrl(new DefaultServiceInstance("42", "42", "localhost", 8080, true)) + .toString()); + } + + /** + * Test new {@link EurekaServiceInstanceConverter} (default constructor). + *

+ * Method under test: default or parameterless constructor of + * {@link EurekaServiceInstanceConverter} + */ + @Test + @DisplayName("Test new EurekaServiceInstanceConverter (default constructor)") + @Tag("MaintainedByDiffblue") + void testNewEurekaServiceInstanceConverter() { + // Arrange and Act + EurekaServiceInstanceConverter actualEurekaServiceInstanceConverter = new EurekaServiceInstanceConverter(); + + // Assert + assertEquals("/actuator", actualEurekaServiceInstanceConverter.getManagementContextPath()); + assertEquals("health", actualEurekaServiceInstanceConverter.getHealthEndpointPath()); + } + +} diff --git a/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/InstanceDiscoveryListenerDiffblueTest.java b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/InstanceDiscoveryListenerDiffblueTest.java new file mode 100644 index 00000000000..1417cee6a28 --- /dev/null +++ b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/InstanceDiscoveryListenerDiffblueTest.java @@ -0,0 +1,3652 @@ +package de.codecentric.boot.admin.server.cloud.discovery; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import de.codecentric.boot.admin.server.services.InstanceFilter; +import de.codecentric.boot.admin.server.services.InstanceIdGenerator; +import de.codecentric.boot.admin.server.services.InstanceRegistry; +import de.codecentric.boot.admin.server.web.client.RefreshInstancesEvent; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; +import org.reactivestreams.Subscriber; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.cloud.client.DefaultServiceInstance; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.cloud.client.discovery.composite.CompositeDiscoveryClient; +import org.springframework.cloud.client.discovery.event.HeartbeatEvent; +import org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent; +import org.springframework.cloud.client.discovery.event.ParentHeartbeatEvent; +import org.springframework.cloud.kubernetes.commons.discovery.DefaultKubernetesServiceInstance; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import reactor.core.publisher.EmitterProcessor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.GroupedFlux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@ExtendWith(MockitoExtension.class) +class InstanceDiscoveryListenerDiffblueTest { + + @Mock + private DiscoveryClient discoveryClient; + + @InjectMocks + private InstanceDiscoveryListener instanceDiscoveryListener; + + @Mock + private InstanceRegistry instanceRegistry; + + @Mock + private InstanceRepository instanceRepository; + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.register(Mockito.any())).thenReturn(justResult); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRepository).findAll(); + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady3() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList + .add(new DefaultServiceInstance("42", "42", "Discovering new instances from DiscoveryClient", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady4() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 59L)); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link ArrayList#ArrayList()} add + * {@link DefaultServiceInstance#DefaultServiceInstance()}.
  • + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given ArrayList() add DefaultServiceInstance(); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenArrayListAddDefaultServiceInstance_thenCallsFindAll() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance()); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link DiscoveryClient#getInstances(String)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given ArrayList() add 'null'; then calls getInstances(String)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenArrayListAddNull_thenCallsGetInstances() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given ArrayList() add 'null'; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenArrayListAddNull_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return create three and {@code true}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given InMemoryEventStore findAll() return create three and 'true'") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenInMemoryEventStoreFindAllReturnCreateThreeAndTrue() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + EmitterProcessor createResult = EmitterProcessor.create(3, true); + when(eventStore.findAll()).thenReturn(createResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given InMemoryEventStore findAll() return fromIterable ArrayList()") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenInMemoryEventStoreFindAllReturnFromIterableArrayList() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenInstanceIdWithValueIs42_thenCallsFindAll() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#register(Registration)} + * return {@code null}.
  • + *
  • Then calls {@link InstanceRegistry#register(Registration)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given InstanceRegistry register(Registration) return 'null'; then calls register(Registration)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenInstanceRegistryRegisterReturnNull_thenCallsRegister() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + when(instanceRegistry.register(Mockito.any())).thenReturn(null); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Given {@link Mono} {@link Mono#subscribe(Subscriber)} does nothing.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); given Mono subscribe(Subscriber) does nothing; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_givenMonoSubscribeDoesNothing_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_thenCallsFindAll() { + // Arrange + when(discoveryClient.getServices()).thenReturn(new ArrayList<>()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_thenCallsFindAll2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(new ArrayList<>()); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)}. + *
    + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationReady(ApplicationReadyEvent)} + */ + @Test + @DisplayName("Test onApplicationReady(ApplicationReadyEvent); then calls groupBy(Function)") + @Tag("MaintainedByDiffblue") + void testOnApplicationReady_thenCallsGroupBy() { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + Class forNameResult = Object.class; + SpringApplication application = new SpringApplication(forNameResult); + + // Act + instanceDiscoveryListener.onApplicationReady(new ApplicationReadyEvent(application, new String[] { "Args" }, + new AnnotationConfigReactiveWebApplicationContext(), null)); + + // Assert + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.register(Mockito.any())).thenReturn(justResult); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRepository).findAll(); + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered3() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList + .add(new DefaultServiceInstance("42", "42", "Discovering new instances from DiscoveryClient", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered4() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered5() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 59L)); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add + * {@link DefaultServiceInstance#DefaultServiceInstance()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); given ArrayList() add DefaultServiceInstance()") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_givenArrayListAddDefaultServiceInstance() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance()); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link DiscoveryClient#getInstances(String)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); given ArrayList() add 'null'; then calls getInstances(String)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_givenArrayListAddNull_thenCallsGetInstances() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); given ArrayList() add 'null'; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_givenArrayListAddNull_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return create three and {@code true}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); given InMemoryEventStore findAll() return create three and 'true'") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_givenInMemoryEventStoreFindAllReturnCreateThreeAndTrue() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + EmitterProcessor createResult = EmitterProcessor.create(3, true); + when(eventStore.findAll()).thenReturn(createResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_givenInstanceIdWithValueIs42_thenCallsFindAll() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#register(Registration)} + * return {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); given InstanceRegistry register(Registration) return 'null'") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_givenInstanceRegistryRegisterReturnNull() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + when(instanceRegistry.register(Mockito.any())).thenReturn(null); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Given {@link Mono} {@link Mono#subscribe(Subscriber)} does nothing.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); given Mono subscribe(Subscriber) does nothing; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_givenMonoSubscribeDoesNothing_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_thenCallsFindAll() { + // Arrange + when(discoveryClient.getServices()).thenReturn(new ArrayList<>()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_thenCallsFindAll2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(new ArrayList<>()); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)}. + *

    + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onInstanceRegistered(InstanceRegisteredEvent)} + */ + @Test + @DisplayName("Test onInstanceRegistered(InstanceRegisteredEvent); then calls groupBy(Function)") + @Tag("MaintainedByDiffblue") + void testOnInstanceRegistered_thenCallsGroupBy() { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onInstanceRegistered(new InstanceRegisteredEvent<>("Source", "Config")); + + // Assert + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.register(Mockito.any())).thenReturn(justResult); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRepository).findAll(); + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances3() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList + .add(new DefaultServiceInstance("42", "42", "Discovering new instances from DiscoveryClient", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances4() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 59L)); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add + * {@link DefaultServiceInstance#DefaultServiceInstance()}.
  • + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given ArrayList() add DefaultServiceInstance(); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenArrayListAddDefaultServiceInstance_thenCallsFindAll() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance()); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link DiscoveryClient#getInstances(String)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given ArrayList() add 'null'; then calls getInstances(String)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenArrayListAddNull_thenCallsGetInstances() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given ArrayList() add 'null'; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenArrayListAddNull_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return create three and {@code true}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given InMemoryEventStore findAll() return create three and 'true'") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenInMemoryEventStoreFindAllReturnCreateThreeAndTrue() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + EmitterProcessor createResult = EmitterProcessor.create(3, true); + when(eventStore.findAll()).thenReturn(createResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given InMemoryEventStore findAll() return fromIterable ArrayList()") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenInMemoryEventStoreFindAllReturnFromIterableArrayList() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenInstanceIdWithValueIs42_thenCallsFindAll() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#register(Registration)} + * return {@code null}.
  • + *
  • Then calls {@link InstanceRegistry#register(Registration)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given InstanceRegistry register(Registration) return 'null'; then calls register(Registration)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenInstanceRegistryRegisterReturnNull_thenCallsRegister() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + when(instanceRegistry.register(Mockito.any())).thenReturn(null); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Given {@link Mono} {@link Mono#subscribe(Subscriber)} does nothing.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); given Mono subscribe(Subscriber) does nothing; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_givenMonoSubscribeDoesNothing_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_thenCallsFindAll() { + // Arrange + when(discoveryClient.getServices()).thenReturn(new ArrayList<>()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_thenCallsFindAll2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(new ArrayList<>()); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)}. + *

    + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onRefreshInstances(RefreshInstancesEvent)} + */ + @Test + @DisplayName("Test onRefreshInstances(RefreshInstancesEvent); then calls groupBy(Function)") + @Tag("MaintainedByDiffblue") + void testOnRefreshInstances_thenCallsGroupBy() { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onRefreshInstances(new RefreshInstancesEvent("Source")); + + // Assert + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.register(Mockito.any())).thenReturn(justResult); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRepository).findAll(); + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat3() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList + .add(new DefaultServiceInstance("42", "42", "Discovering new instances from DiscoveryClient", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add + * {@link DefaultServiceInstance#DefaultServiceInstance()}.
  • + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given ArrayList() add DefaultServiceInstance(); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenArrayListAddDefaultServiceInstance_thenCallsFindAll() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance()); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link DiscoveryClient#getInstances(String)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given ArrayList() add 'null'; then calls getInstances(String)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenArrayListAddNull_thenCallsGetInstances() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given ArrayList() add 'null'; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenArrayListAddNull_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return create three and {@code true}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given InMemoryEventStore findAll() return create three and 'true'") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenInMemoryEventStoreFindAllReturnCreateThreeAndTrue() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + EmitterProcessor createResult = EmitterProcessor.create(3, true); + when(eventStore.findAll()).thenReturn(createResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given InMemoryEventStore findAll() return fromIterable ArrayList()") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenInMemoryEventStoreFindAllReturnFromIterableArrayList() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenInstanceIdWithValueIs42_thenCallsFindAll() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenInstanceIdWithValueIs42_thenCallsFindAll2() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#register(Registration)} + * return {@code null}.
  • + *
  • Then calls {@link InstanceRegistry#register(Registration)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given InstanceRegistry register(Registration) return 'null'; then calls register(Registration)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenInstanceRegistryRegisterReturnNull_thenCallsRegister() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + when(instanceRegistry.register(Mockito.any())).thenReturn(null); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Given {@link Mono} {@link Mono#subscribe(Subscriber)} does nothing.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); given Mono subscribe(Subscriber) does nothing; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_givenMonoSubscribeDoesNothing_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_thenCallsFindAll() { + // Arrange + when(discoveryClient.getServices()).thenReturn(new ArrayList<>()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_thenCallsFindAll2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(new ArrayList<>()); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)}. + *

    + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onParentHeartbeat(ParentHeartbeatEvent)} + */ + @Test + @DisplayName("Test onParentHeartbeat(ParentHeartbeatEvent); then calls groupBy(Function)") + @Tag("MaintainedByDiffblue") + void testOnParentHeartbeat_thenCallsGroupBy() { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onParentHeartbeat(new ParentHeartbeatEvent("Source", "Value")); + + // Assert + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.register(Mockito.any())).thenReturn(justResult); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRepository).findAll(); + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent3() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList + .add(new DefaultServiceInstance("42", "42", "Discovering new instances from DiscoveryClient", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add + * {@link DefaultServiceInstance#DefaultServiceInstance()}.
  • + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given ArrayList() add DefaultServiceInstance(); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenArrayListAddDefaultServiceInstance_thenCallsFindAll() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance()); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link DiscoveryClient#getInstances(String)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given ArrayList() add 'null'; then calls getInstances(String)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenArrayListAddNull_thenCallsGetInstances() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given ArrayList() add 'null'; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenArrayListAddNull_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return create three and {@code true}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given InMemoryEventStore findAll() return create three and 'true'") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenInMemoryEventStoreFindAllReturnCreateThreeAndTrue() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + EmitterProcessor createResult = EmitterProcessor.create(3, true); + when(eventStore.findAll()).thenReturn(createResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given InMemoryEventStore findAll() return fromIterable ArrayList()") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenInMemoryEventStoreFindAllReturnFromIterableArrayList() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenInstanceIdWithValueIs42_thenCallsFindAll() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenInstanceIdWithValueIs42_thenCallsFindAll2() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#register(Registration)} + * return {@code null}.
  • + *
  • Then calls {@link InstanceRegistry#register(Registration)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given InstanceRegistry register(Registration) return 'null'; then calls register(Registration)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenInstanceRegistryRegisterReturnNull_thenCallsRegister() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + when(instanceRegistry.register(Mockito.any())).thenReturn(null); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Given {@link Mono} {@link Mono#subscribe(Subscriber)} does nothing.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); given Mono subscribe(Subscriber) does nothing; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_givenMonoSubscribeDoesNothing_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_thenCallsFindAll() { + // Arrange + when(discoveryClient.getServices()).thenReturn(new ArrayList<>()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_thenCallsFindAll2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(new ArrayList<>()); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)}. + *

    + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#onApplicationEvent(HeartbeatEvent)} + */ + @Test + @DisplayName("Test onApplicationEvent(HeartbeatEvent); then calls groupBy(Function)") + @Tag("MaintainedByDiffblue") + void testOnApplicationEvent_thenCallsGroupBy() { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository); + + // Act + instanceDiscoveryListener.onApplicationEvent(new HeartbeatEvent("Source", "State")); + + // Assert + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover()") + @Tag("MaintainedByDiffblue") + void testDiscover() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover()") + @Tag("MaintainedByDiffblue") + void testDiscover2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList + .add(new DefaultServiceInstance("42", "42", "Discovering new instances from DiscoveryClient", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover()") + @Tag("MaintainedByDiffblue") + void testDiscover3() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 59L)); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + + // Act + new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository) + .discover(); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add + * {@link DefaultServiceInstance#DefaultServiceInstance()}.
  • + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given ArrayList() add DefaultServiceInstance(); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testDiscover_givenArrayListAddDefaultServiceInstance_thenCallsFindAll() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance()); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link DiscoveryClient#getInstances(String)}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given ArrayList() add 'null'; then calls getInstances(String)") + @Tag("MaintainedByDiffblue") + void testDiscover_givenArrayListAddNull_thenCallsGetInstances() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code null}.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given ArrayList() add 'null'; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testDiscover_givenArrayListAddNull_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + serviceInstanceList.add(null); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given Flux groupBy(Function) return fromIterable ArrayList(); then calls groupBy(Function)") + @Tag("MaintainedByDiffblue") + void testDiscover_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + + // Act + new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository) + .discover(); + + // Assert + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return create three and {@code true}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given InMemoryEventStore findAll() return create three and 'true'") + @Tag("MaintainedByDiffblue") + void testDiscover_givenInMemoryEventStoreFindAllReturnCreateThreeAndTrue() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + EmitterProcessor createResult = EmitterProcessor.create(3, true); + when(eventStore.findAll()).thenReturn(createResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + + // Act + new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository) + .discover(); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link InMemoryEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given InMemoryEventStore findAll() return fromIterable ArrayList()") + @Tag("MaintainedByDiffblue") + void testDiscover_givenInMemoryEventStoreFindAllReturnFromIterableArrayList() { + // Arrange + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + + // Act + new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository) + .discover(); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given InstanceId with value is '42'; then calls findAll()") + @Tag("MaintainedByDiffblue") + void testDiscover_givenInstanceIdWithValueIs42_thenCallsFindAll() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + InMemoryEventStore eventStore = mock(InMemoryEventStore.class); + when(eventStore.findAll()).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + + // Act + new InstanceDiscoveryListener(discoveryClient, + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + repository) + .discover(); + + // Assert + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#register(Registration)} + * return just {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given InstanceRegistry register(Registration) return just InstanceId with value is '42'") + @Tag("MaintainedByDiffblue") + void testDiscover_givenInstanceRegistryRegisterReturnJustInstanceIdWithValueIs42() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.register(Mockito.any())).thenReturn(justResult); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRepository).findAll(); + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#register(Registration)} + * return {@code null}.
  • + *
  • Then calls {@link InstanceRegistry#register(Registration)}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given InstanceRegistry register(Registration) return 'null'; then calls register(Registration)") + @Tag("MaintainedByDiffblue") + void testDiscover_givenInstanceRegistryRegisterReturnNull_thenCallsRegister() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + when(instanceRegistry.register(Mockito.any())).thenReturn(null); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Given {@link Mono} {@link Mono#subscribe(Subscriber)} does nothing.
  • + *
  • Then calls {@link Mono#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); given Mono subscribe(Subscriber) does nothing; then calls subscribe(Subscriber)") + @Tag("MaintainedByDiffblue") + void testDiscover_givenMonoSubscribeDoesNothing_thenCallsSubscribe() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + + ArrayList serviceInstanceList = new ArrayList<>(); + serviceInstanceList.add(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(serviceInstanceList); + when(discoveryClient.getServices()).thenReturn(stringList); + Mono mono = mock(Mono.class); + doNothing().when(mono).subscribe(Mockito.>any()); + when(instanceRegistry.register(Mockito.any())).thenReturn(mono); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + verify(mono).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testDiscover_thenCallsFindAll() { + // Arrange + when(discoveryClient.getServices()).thenReturn(new ArrayList<>()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#discover()}. + *

    + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: {@link InstanceDiscoveryListener#discover()} + */ + @Test + @DisplayName("Test discover(); then calls findAll()") + @Tag("MaintainedByDiffblue") + void testDiscover_thenCallsFindAll2() { + // Arrange + ArrayList stringList = new ArrayList<>(); + stringList.add("Discovering new instances from DiscoveryClient"); + when(discoveryClient.getInstances(Mockito.any())).thenReturn(new ArrayList<>()); + when(discoveryClient.getServices()).thenReturn(stringList); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act + instanceDiscoveryListener.discover(); + + // Assert + verify(instanceRepository).findAll(); + verify(discoveryClient).getInstances(eq("Discovering new instances from DiscoveryClient")); + verify(discoveryClient).getServices(); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "", "localhost", 8080, true))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(instanceDiscoveryListener.registerInstance(new DefaultServiceInstance("42", "42", + "Converting service '{}' running at '{}' with metadata {}", 8080, true))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance3() throws AssertionError { + // Arrange + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + String value = "42"; + InstanceId ofResult = InstanceId.of(value); + when(generator.generateId(Mockito.any())).thenReturn(ofResult); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + generator, mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.assertNext(i -> { + assertSame(ofResult, i); + return; + }).expectComplete().verify(); + verify(generator).generateId(isA(Registration.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given + * {@link EventsourcingInstanceRepository#EventsourcingInstanceRepository(InstanceEventStore)} + * with eventStore is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given EventsourcingInstanceRepository(InstanceEventStore) with eventStore is 'null'") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenEventsourcingInstanceRepositoryWithEventStoreIsNull() throws AssertionError { + // Arrange + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(null), generator, + mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectComplete().verify(); + verify(generator).generateId(isA(Registration.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given Flux collectList() return just ArrayList()") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenFluxCollectListReturnJustArrayList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry registry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given {@link InstanceDiscoveryListener}.
  • + *
  • When {@link DefaultServiceInstance#DefaultServiceInstance()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given InstanceDiscoveryListener; when DefaultServiceInstance()") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenInstanceDiscoveryListener_whenDefaultServiceInstance() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(instanceDiscoveryListener.registerInstance(new DefaultServiceInstance())); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given {@link InstanceEventStore} {@link InstanceEventStore#find(InstanceId)} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given InstanceEventStore find(InstanceId) return fromIterable ArrayList()") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenInstanceEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + InstanceEventStore eventStore = mock(InstanceEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry registry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given {@link InstanceIdGenerator} + * {@link InstanceIdGenerator#generateId(Registration)} return {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given InstanceIdGenerator generateId(Registration) return 'null'") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenInstanceIdGeneratorGenerateIdReturnNull() throws AssertionError { + // Arrange + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(null); + InstanceRegistry registry = new InstanceRegistry(mock(InstanceRepository.class), generator, + mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectComplete().verify(); + verify(generator).generateId(isA(Registration.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given {@link InstanceRepository} + * {@link InstanceRepository#compute(InstanceId, BiFunction)} return + * {@code null}.
  • + *
  • Then calls {@link InstanceRepository#compute(InstanceId, BiFunction)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given InstanceRepository compute(InstanceId, BiFunction) return 'null'; then calls compute(InstanceId, BiFunction)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenInstanceRepositoryComputeReturnNull_thenCallsCompute() throws AssertionError { + // Arrange + InstanceRepository repository = mock(InstanceRepository.class); + when(repository.compute(Mockito.any(), + Mockito.>>any())) + .thenReturn(null); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry registry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectComplete().verify(); + verify(repository).compute(isA(InstanceId.class), isA(BiFunction.class)); + verify(generator).generateId(isA(Registration.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given Mono filter(Predicate) return just ArrayList(); then calls filter(Predicate)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry registry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Given {@link Mono} {@link Mono#flatMap(Function)} return just + * {@code Data}.
  • + *
  • Then calls {@link Mono#flatMap(Function)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given Mono flatMap(Function) return just 'Data'; then calls flatMap(Function)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenMonoFlatMapReturnJustData_thenCallsFlatMap() throws AssertionError { + // Arrange + Mono mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.flatMap(Mockito.>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.map(Mockito., Object>>any())).thenReturn(mono); + Mono> mono3 = mock(Mono.class); + when(mono3.filter(Mockito.>>any())).thenReturn(mono2); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono3); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry registry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + verify(mono3).filter(isA(Predicate.class)); + verify(mono).flatMap(isA(Function.class)); + verify(mono2).map(isA(Function.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *
    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); given Mono map(Function) return just 'Data'; then calls filter(Predicate)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_givenMonoMapReturnJustData_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry registry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *
    + *
  • Then calls {@link ServiceInstanceConverter#convert(ServiceInstance)}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); then calls convert(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_thenCallsConvert() { + // Arrange + InstanceRegistry registry = mock(InstanceRegistry.class); + Mono justResult = Mono.just(InstanceId.of("42")); + when(registry.register(Mockito.any())).thenReturn(justResult); + ServiceInstanceConverter converter = mock(ServiceInstanceConverter.class); + Registration buildResult = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + when(converter.convert(Mockito.any())).thenReturn(buildResult); + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + instanceDiscoveryListener.setConverter(converter); + + // Act + Mono actualRegisterInstanceResult = instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + + // Assert + verify(converter).convert(isA(ServiceInstance.class)); + verify(registry).register(isA(Registration.class)); + assertSame(justResult, actualRegisterInstanceResult); + } + + /** + * Test {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)}. + *

    + *
  • Then return just {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: + * {@link InstanceDiscoveryListener#registerInstance(ServiceInstance)} + */ + @Test + @DisplayName("Test registerInstance(ServiceInstance); then return just InstanceId with value is '42'") + @Tag("MaintainedByDiffblue") + void testRegisterInstance_thenReturnJustInstanceIdWithValueIs42() { + // Arrange + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.register(Mockito.any())).thenReturn(justResult); + + // Act + Mono actualRegisterInstanceResult = instanceDiscoveryListener + .registerInstance(new DefaultServiceInstance("42", "42", "localhost", 8080, true)); + + // Assert + verify(instanceRegistry).register(isA(Registration.class)); + assertSame(justResult, actualRegisterInstanceResult); + } + + /** + * Test {@link InstanceDiscoveryListener#toString(ServiceInstance)} with + * {@code ServiceInstance}. + *

+ * Method under test: {@link InstanceDiscoveryListener#toString(ServiceInstance)} + */ + @Test + @DisplayName("Test toString(ServiceInstance) with 'ServiceInstance'") + @Tag("MaintainedByDiffblue") + void testToStringWithServiceInstance() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act and Assert + assertEquals("serviceId=42, instanceId=42, url= https://localhost:8080", + instanceDiscoveryListener.toString(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + } + + /** + * Test {@link InstanceDiscoveryListener#toString(ServiceInstance)} with + * {@code ServiceInstance}. + *

+ * Method under test: {@link InstanceDiscoveryListener#toString(ServiceInstance)} + */ + @Test + @DisplayName("Test toString(ServiceInstance) with 'ServiceInstance'") + @Tag("MaintainedByDiffblue") + void testToStringWithServiceInstance2() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + DefaultServiceInstance instance = new DefaultServiceInstance("42", "42", "localhost", 8080, true); + instance.setSecure(false); + + // Act and Assert + assertEquals("serviceId=42, instanceId=42, url= http://localhost:8080", + instanceDiscoveryListener.toString(instance)); + } + + /** + * Test {@link InstanceDiscoveryListener#toString(ServiceInstance)} with + * {@code ServiceInstance}. + *

+ * Method under test: {@link InstanceDiscoveryListener#toString(ServiceInstance)} + */ + @Test + @DisplayName("Test toString(ServiceInstance) with 'ServiceInstance'") + @Tag("MaintainedByDiffblue") + void testToStringWithServiceInstance3() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + HashMap metadata = new HashMap<>(); + + // Act and Assert + assertEquals("serviceId=42, instanceId=42, url= https://localhost:8080", + instanceDiscoveryListener.toString(new DefaultKubernetesServiceInstance("42", "42", "localhost", 8080, + metadata, true, "https", "https", new HashMap<>()))); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link InstanceDiscoveryListener#setConverter(ServiceInstanceConverter)} + *
  • {@link InstanceDiscoveryListener#setIgnoredInstancesMetadata(Map)} + *
  • {@link InstanceDiscoveryListener#setIgnoredServices(Set)} + *
  • {@link InstanceDiscoveryListener#setInstancesMetadata(Map)} + *
  • {@link InstanceDiscoveryListener#setServices(Set)} + *
  • {@link InstanceDiscoveryListener#getIgnoredInstancesMetadata()} + *
  • {@link InstanceDiscoveryListener#getIgnoredServices()} + *
  • {@link InstanceDiscoveryListener#getInstancesMetadata()} + *
  • {@link InstanceDiscoveryListener#getServices()} + *
+ */ + @Test + @DisplayName("Test getters and setters") + @Tag("MaintainedByDiffblue") + void testGettersAndSetters() { + // Arrange + CompositeDiscoveryClient discoveryClient = new CompositeDiscoveryClient(new ArrayList<>()); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore(3)), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + InstanceDiscoveryListener instanceDiscoveryListener = new InstanceDiscoveryListener(discoveryClient, registry, + new EventsourcingInstanceRepository(new InMemoryEventStore(3))); + + // Act + instanceDiscoveryListener.setConverter(mock(ServiceInstanceConverter.class)); + HashMap ignoredInstancesMetadata = new HashMap<>(); + instanceDiscoveryListener.setIgnoredInstancesMetadata(ignoredInstancesMetadata); + HashSet ignoredServices = new HashSet<>(); + instanceDiscoveryListener.setIgnoredServices(ignoredServices); + HashMap instancesMetadata = new HashMap<>(); + instanceDiscoveryListener.setInstancesMetadata(instancesMetadata); + HashSet services = new HashSet<>(); + instanceDiscoveryListener.setServices(services); + Map actualIgnoredInstancesMetadata = instanceDiscoveryListener.getIgnoredInstancesMetadata(); + Set actualIgnoredServices = instanceDiscoveryListener.getIgnoredServices(); + Map actualInstancesMetadata = instanceDiscoveryListener.getInstancesMetadata(); + Set actualServices = instanceDiscoveryListener.getServices(); + + // Assert + assertTrue(actualIgnoredInstancesMetadata.isEmpty()); + assertTrue(actualInstancesMetadata.isEmpty()); + assertTrue(actualIgnoredServices.isEmpty()); + assertTrue(actualServices.isEmpty()); + assertSame(ignoredInstancesMetadata, actualIgnoredInstancesMetadata); + assertSame(instancesMetadata, actualInstancesMetadata); + assertSame(ignoredServices, actualIgnoredServices); + assertSame(services, actualServices); + } + +} diff --git a/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/KubernetesServiceInstanceConverterDiffblueTest.java b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/KubernetesServiceInstanceConverterDiffblueTest.java new file mode 100644 index 00000000000..365c8506a86 --- /dev/null +++ b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/KubernetesServiceInstanceConverterDiffblueTest.java @@ -0,0 +1,137 @@ +package de.codecentric.boot.admin.server.cloud.discovery; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.HashMap; +import java.util.HashSet; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.client.DefaultServiceInstance; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties; +import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties.Metadata; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { KubernetesServiceInstanceConverter.class }) +@DisabledInAotMode +@ExtendWith(SpringExtension.class) +class KubernetesServiceInstanceConverterDiffblueTest { + + @MockitoBean + private KubernetesDiscoveryProperties kubernetesDiscoveryProperties; + + @Autowired + private KubernetesServiceInstanceConverter kubernetesServiceInstanceConverter; + + /** + * Test + * {@link KubernetesServiceInstanceConverter#KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)}. + *

+ * Method under test: + * {@link KubernetesServiceInstanceConverter#KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)} + */ + @Test + @DisplayName("Test new KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)") + @Tag("MaintainedByDiffblue") + void testNewKubernetesServiceInstanceConverter() { + // Arrange + when(kubernetesDiscoveryProperties.metadata()) + .thenReturn(new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, "Ports Prefix")); + + // Act + KubernetesServiceInstanceConverter actualKubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + kubernetesDiscoveryProperties); + + // Assert + verify(kubernetesDiscoveryProperties, atLeast(1)).metadata(); + assertEquals("/actuator", actualKubernetesServiceInstanceConverter.getManagementContextPath()); + assertEquals("health", actualKubernetesServiceInstanceConverter.getHealthEndpointPath()); + } + + /** + * Test + * {@link KubernetesServiceInstanceConverter#KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)}. + *

+ * Method under test: + * {@link KubernetesServiceInstanceConverter#KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)} + */ + @Test + @DisplayName("Test new KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)") + @Tag("MaintainedByDiffblue") + void testNewKubernetesServiceInstanceConverter2() { + // Arrange + when(kubernetesDiscoveryProperties.metadata()) + .thenReturn(new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, null)); + + // Act + KubernetesServiceInstanceConverter actualKubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + kubernetesDiscoveryProperties); + + // Assert + verify(kubernetesDiscoveryProperties, atLeast(1)).metadata(); + assertEquals("/actuator", actualKubernetesServiceInstanceConverter.getManagementContextPath()); + assertEquals("health", actualKubernetesServiceInstanceConverter.getHealthEndpointPath()); + } + + /** + * Test + * {@link KubernetesServiceInstanceConverter#KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)}. + *

    + *
  • Given {@code null}.
  • + *
+ *

+ * Method under test: + * {@link KubernetesServiceInstanceConverter#KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties)} + */ + @Test + @DisplayName("Test new KubernetesServiceInstanceConverter(KubernetesDiscoveryProperties); given 'null'") + @Tag("MaintainedByDiffblue") + void testNewKubernetesServiceInstanceConverter_givenNull() { + // Arrange + when(kubernetesDiscoveryProperties.metadata()).thenReturn(null); + + // Act + KubernetesServiceInstanceConverter actualKubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + kubernetesDiscoveryProperties); + + // Assert + verify(kubernetesDiscoveryProperties, times(2)).metadata(); + assertEquals("/actuator", actualKubernetesServiceInstanceConverter.getManagementContextPath()); + assertEquals("health", actualKubernetesServiceInstanceConverter.getHealthEndpointPath()); + } + + /** + * Test {@link KubernetesServiceInstanceConverter#getManagementPort(ServiceInstance)}. + *

+ * Method under test: + * {@link KubernetesServiceInstanceConverter#getManagementPort(ServiceInstance)} + */ + @Test + @DisplayName("Test getManagementPort(ServiceInstance)") + @Tag("MaintainedByDiffblue") + void testGetManagementPort() { + // Arrange + HashSet namespaces = new HashSet<>(); + HashSet knownSecurePorts = new HashSet<>(); + HashMap serviceLabels = new HashMap<>(); + KubernetesServiceInstanceConverter kubernetesServiceInstanceConverter = new KubernetesServiceInstanceConverter( + new KubernetesDiscoveryProperties(true, true, namespaces, true, 1L, true, "Filter", knownSecurePorts, + serviceLabels, "Primary Port Name", + new Metadata(true, "Labels Prefix", true, "Annotations Prefix", true, "Ports Prefix"), 1, + true)); + + // Act and Assert + assertEquals(8080, kubernetesServiceInstanceConverter + .getManagementPort(new DefaultServiceInstance("42", "42", "localhost", 8080, true))); + } + +} diff --git a/spring-boot-admin-server-ui/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-server-ui/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..e6e1cf565fa --- /dev/null +++ b/spring-boot-admin-server-ui/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-server-ui/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-server-ui/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..f8cc82713d9 --- /dev/null +++ b/spring-boot-admin-server-ui/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-server-ui/.diffblue/reports/report.json b/spring-boot-admin-server-ui/.diffblue/reports/report.json new file mode 100644 index 00000000000..ccd8282fa5a --- /dev/null +++ b/spring-boot-admin-server-ui/.diffblue/reports/report.json @@ -0,0 +1,3112 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:11:20.306182981Z", + "command" : "dcover coverage-reports ", + "totalTime" : 354.789, + "environmentDetectionTime" : 76.285, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 354.789, + "timeToLastTest" : 354.789, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T001" : "Trivial getter", + "T002" : "Trivial setter", + "T003" : "Private method", + "T005" : "Trivial constructor", + "T012" : "Synthetic method", + "T021" : "Empty method body", + "T023" : "Testability unknown" + }, + "summary" : { + "classesCount" : 26, + "methodsCount" : 265, + "cumulativeDiffblueTestCount" : 60, + "cumulativeManualTestCount" : 89, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 922, + "perMethodTestability" : { + "T000" : 39, + "T001" : 1, + "T002" : 10, + "T003" : 9, + "T005" : 12, + "T012" : 184, + "T021" : 2, + "T023" : 8 + }, + "perMethodOutcome" : { + "T000" : 39, + "T001" : 1, + "T002" : 10, + "T003" : 9, + "T005" : 12, + "T012" : 184, + "T021" : 2, + "T023" : 8 + } + }, + "classes" : { + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T005" : 1, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T005" : 1, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1 + }, + "perMethodOutcome" : { + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration$AdminUiWebfluxConfig" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 3, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1 + }, + "perMethodOutcome" : { + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration$AdminUiWebMvcConfig" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties" : { + "methodsCount" : 46, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 45, + "T023" : 1 + }, + "perMethodOutcome" : { + "T012" : 45, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T012" : 11 + }, + "perMethodOutcome" : { + "T000" : 1, + "T012" : 11 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette" : { + "methodsCount" : 21, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T002" : 10, + "T005" : 1, + "T012" : 10 + }, + "perMethodOutcome" : { + "T002" : 10, + "T005" : 1, + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer" : { + "methodsCount" : 19, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 19 + }, + "perMethodOutcome" : { + "T012" : 19 + } + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme" : { + "methodsCount" : 11, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 11 + }, + "perMethodOutcome" : { + "T012" : 11 + } + }, + "de.codecentric.boot.admin.server.ui.config.CssColorUtils" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.config.ServerRuntimeHints" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 3, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 3, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.config.SpringNativeServerAutoConfiguration" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1 + }, + "perMethodOutcome" : { + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T012" : 7, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T012" : 7, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensionsScanner" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 3, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 3, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.extensions.UiRoutesScanner" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 2, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 2, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 1, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 1, + "T012" : 4 + } + }, + "de.codecentric.boot.admin.server.ui.web.UiController" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T001" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T001" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T012" : 9 + }, + "perMethodOutcome" : { + "T000" : 1, + "T012" : 9 + } + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings" : { + "methodsCount" : 21, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 21 + }, + "perMethodOutcome" : { + "T012" : 21 + } + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder" : { + "methodsCount" : 18, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 18 + }, + "perMethodOutcome" : { + "T012" : 18 + } + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T012" : 7 + }, + "perMethodOutcome" : { + "T000" : 1, + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T012" : 4, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T012" : 4, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T012" : 1, + "T021" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T012" : 1, + "T021" : 2, + "T023" : 1 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration$AdminUiWebfluxConfig.:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties;Lde/codecentric/boot/admin/server/config/AdminServerProperties;Lorg/springframework/boot/autoconfigure/web/reactive/WebFluxProperties;Lorg/springframework/context/ApplicationContext;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 176, + 177, + 178, + 179, + 180, + 181 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration$AdminUiWebfluxConfig.addResourceHandlers:(Lorg/springframework/web/reactive/config/ResourceHandlerRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 207, + 208, + 209, + 210, + 212, + 213, + 214, + 215, + 216 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration$AdminUiWebfluxConfig.homepageForwardFilter:(Lde/codecentric/boot/admin/server/ui/web/HomepageForwardingFilterConfig;)Lde/codecentric/boot/admin/server/ui/web/reactive/HomepageForwardingFilter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 222 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration$AdminUiWebfluxConfig.homepageForwardingFilterConfig:()Lde/codecentric/boot/admin/server/ui/web/HomepageForwardingFilterConfig;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 185, + 186, + 188, + 187, + 190, + 191, + 192, + 193, + 194, + 195, + 197, + 198, + 199, + 200, + 202 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration$AdminUiWebfluxConfig.lambda$homepageForwardingFilterConfig$0:(ZLjava/lang/String;Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 193 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration$AdminUiWebfluxConfig.lambda$homepageForwardingFilterConfig$1:(ZLjava/lang/String;Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 199 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ReactiveUiConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 162 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration$AdminUiWebMvcConfig.:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties;Lde/codecentric/boot/admin/server/config/AdminServerProperties;Lorg/springframework/context/ApplicationContext;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 244, + 245, + 246, + 247, + 248 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration$AdminUiWebMvcConfig.addResourceHandlers:(Lorg/springframework/web/servlet/config/annotation/ResourceHandlerRegistry;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 277, + 278, + 279, + 280, + 281, + 282, + 283 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration$AdminUiWebMvcConfig.configurePathMatch:(Lorg/springframework/web/servlet/config/annotation/PathMatchConfigurer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 252, + 253 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration$AdminUiWebMvcConfig.homepageForwardFilter:(Lde/codecentric/boot/admin/server/ui/web/HomepageForwardingFilterConfig;)Lde/codecentric/boot/admin/server/ui/web/servlet/HomepageForwardingFilter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 289 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration$AdminUiWebMvcConfig.homepageForwardingFilterConfig:()Lde/codecentric/boot/admin/server/ui/web/HomepageForwardingFilterConfig;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 257, + 259, + 260, + 261, + 262, + 263, + 264, + 266, + 267, + 268, + 269, + 271 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration$ServletUiConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 232 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties;Lde/codecentric/boot/admin/server/config/AdminServerProperties;Lorg/springframework/context/ApplicationContext;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 88, + 89, + 90, + 91, + 92 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.adminTemplateResolver:()Lorg/thymeleaf/spring6/templateresolver/SpringResourceTemplateResolver;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.cssColorUtils:()Lde/codecentric/boot/admin/server/ui/config/CssColorUtils;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 96 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.homeUiController:(Lde/codecentric/boot/admin/server/ui/extensions/UiExtensions;)Lde/codecentric/boot/admin/server/ui/web/UiController;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 102, + 103, + 104, + 105, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 116, + 115, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 126, + 127, + 128 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.lambda$uiExtensions$0:(Lde/codecentric/boot/admin/server/ui/extensions/UiExtension;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 135 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.normalizeHomepageUrl:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 154, + 155, + 157 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.uiExtensions:()Lde/codecentric/boot/admin/server/ui/extensions/UiExtensions;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 133, + 134, + 135, + 136 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182, + 188, + 190, + 195, + 200 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.getMaxAge:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 190 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.getNoCache:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 195 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.getNoStore:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 200 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.setMaxAge:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.setNoCache:(Ljava/lang/Boolean;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.setNoStore:(Ljava/lang/Boolean;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.toCacheControl:()Lorg/springframework/http/CacheControl;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 203, + 204, + 206, + 207, + 209, + 210, + 212 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Cache.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 182 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 236, + 238, + 240, + 242, + 244, + 246, + 248, + 250, + 252, + 254, + 256 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade100:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 240 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade200:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 242 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade300:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 244 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade400:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 246 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade500:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 248 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade50:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 238 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade600:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 250 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade700:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 252 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade800:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 254 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.getShade900:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 256 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set100:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 263, + 264 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set200:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 267, + 268 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set300:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 271, + 272 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set400:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 275, + 276 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set500:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 279, + 280 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set50:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 259, + 260 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set600:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 283, + 284 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set700:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 287, + 288 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set800:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 291, + 292 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$Palette.set900:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 295, + 296 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142, + 148, + 153, + 158, + 163, + 168, + 173, + 178 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.getCache:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 148 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.getDatasource:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 153 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.getGc:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.getLogfile:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 178 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.getMemory:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 168 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.getProcess:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 163 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.getThreads:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 173 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.setCache:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.setDatasource:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.setGc:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.setLogfile:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.setMemory:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.setProcess:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.setThreads:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$PollTimer.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217, + 220, + 222, + 224 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.getBackgroundEnabled:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 220 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.getColor:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 224 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.getPalette:()Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$Palette;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 222 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.setBackgroundEnabled:(Ljava/lang/Boolean;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.setColor:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.setPalette:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$Palette;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties$UiTheme.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 217 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34, + 46, + 51, + 56, + 61, + 66, + 71, + 76, + 81, + 88, + 94, + 99, + 104, + 109, + 114, + 120, + 122, + 128, + 133, + 138, + 140 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getAdditionalRouteExcludes:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 128 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getAvailableLanguages:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 120 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getBrand:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 81 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getCache:()Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$Cache;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 99 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getEnableToasts:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 133 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getExtensionResourceLocations:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 51 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getExternalViews:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 104 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getFavicon:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 66 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getFaviconDanger:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 71 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getHideInstanceUrl:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 138 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getLoginIcon:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 61 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getPollTimer:()Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$PollTimer;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getPublicUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getResourceLocations:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getTemplateLocation:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 56 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getTheme:()Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$UiTheme;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.getViewSettings:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 109 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.isCacheTemplates:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.isRememberMeEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 114 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setAdditionalRouteExcludes:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setAvailableLanguages:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setBrand:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setCache:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$Cache;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setCacheTemplates:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setEnableToasts:(Ljava/lang/Boolean;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setExtensionResourceLocations:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setExternalViews:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setFavicon:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setFaviconDanger:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setHideInstanceUrl:(Ljava/lang/Boolean;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setLoginIcon:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setPollTimer:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$PollTimer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setPublicUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setRememberMeEnabled:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setResourceLocations:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setTemplateLocation:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setTheme:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$UiTheme;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setTitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.setViewSettings:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.config.CssColorUtils.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.config.CssColorUtils.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.ui.config.CssColorUtils.hexToRgb:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 26, + 27, + 29, + 30, + 29 + ] + }, + "de.codecentric.boot.admin.server.ui.config.ServerRuntimeHints.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 70 + ] + }, + "de.codecentric.boot.admin.server.ui.config.ServerRuntimeHints.registerHints:(Lorg/springframework/aot/hint/RuntimeHints;Ljava/lang/ClassLoader;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 74, + 76, + 78, + 79 + ] + }, + "de.codecentric.boot.admin.server.ui.config.ServerRuntimeHints.registerReflectionHints:(Lorg/springframework/aot/hint/RuntimeHints;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 105, + 106, + 107, + 110, + 111, + 113, + 115, + 117, + 119, + 121, + 123, + 125, + 127, + 129, + 131, + 133, + 135, + 137, + 139, + 141, + 143, + 145, + 147, + 149, + 151, + 153, + 155, + 158, + 160, + 162, + 164, + 166, + 168, + 170, + 172, + 174, + 176, + 178, + 180, + 182, + 184, + 187, + 189, + 188, + 192, + 194, + 195, + 196, + 197, + 200, + 197, + 103, + 201 + ] + }, + "de.codecentric.boot.admin.server.ui.config.ServerRuntimeHints.registerResourcesHints:(Lorg/springframework/aot/hint/RuntimeHints;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 97, + 98, + 99, + 100, + 101 + ] + }, + "de.codecentric.boot.admin.server.ui.config.ServerRuntimeHints.registerSerializationHints:(Lorg/springframework/aot/hint/RuntimeHints;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94 + ] + }, + "de.codecentric.boot.admin.server.ui.config.SpringNativeServerAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension.:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension.getResourceLocation:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 24 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension.getResourcePath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 22 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtension.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 19 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 31, + 32, + 33 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 24 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 24 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.getCssExtensions:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42, + 43, + 41 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.getExtensions:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.getJsExtensions:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 24 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.iterator:()Ljava/util/Iterator;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.lambda$getCssExtensions$0:(Lde/codecentric/boot/admin/server/ui/extensions/UiExtension;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.lambda$getJsExtensions$1:(Lde/codecentric/boot/admin/server/ui/extensions/UiExtension;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensions.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 24 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensionsScanner.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensionsScanner.:(Lorg/springframework/core/io/support/ResourcePatternResolver;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 40, + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensionsScanner.getResourcePath:(Ljava/lang/String;Lorg/springframework/core/io/Resource;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 74, + 75, + 76, + 77, + 78, + 81 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensionsScanner.resolveAssets:(Ljava/lang/String;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 60, + 61, + 62, + 63, + 62, + 64, + 61 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensionsScanner.scan:([Ljava/lang/String;)Lde/codecentric/boot/admin/server/ui/extensions/UiExtensions;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 54, + 46, + 56 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiExtensionsScanner.toPattern:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiRoutesScanner.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.extensions.UiRoutesScanner.:(Lorg/springframework/core/io/support/ResourcePatternResolver;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 41, + 42, + 43 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiRoutesScanner.readLines:(Ljava/io/InputStream;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 58, + 59, + 60, + 59, + 58, + 61, + 62, + 63 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiRoutesScanner.scan:([Ljava/lang/String;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 46, + 47, + 48, + 49, + 50, + 48, + 47, + 54 + ] + }, + "de.codecentric.boot.admin.server.ui.extensions.UiRoutesScanner.toPattern:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig.:(Ljava/lang/String;Ljava/util/List;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig.getHomepage:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig.getRoutesExcludes:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig.getRoutesIncludes:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher.:(Ljava/util/List;Ljava/util/List;Ljava/util/function/Function;Ljava/util/function/Function;Ljava/util/function/Function;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 42, + 43, + 44, + 45, + 46, + 47, + 48 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher.lambda$test$0:(Ljava/lang/String;Ljava/util/regex/Pattern;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 56 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher.lambda$test$1:(Ljava/lang/String;Ljava/util/regex/Pattern;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 57 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher.lambda$test$2:(Lorg/springframework/http/MediaType;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 62 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher.lambda$toPatterns$3:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 67 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher.test:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 51, + 52, + 55, + 56, + 57, + 58, + 59, + 62 + ] + }, + "de.codecentric.boot.admin.server.ui.web.HomepageForwardingMatcher.toPatterns:(Ljava/util/List;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 66, + 67, + 68, + 69, + 66 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;ZLjava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 186, + 187, + 188, + 189, + 191, + 192, + 193, + 194, + 195, + 196 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.getChildren:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 184 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.getLabel:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 164 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.getOrder:()Ljava/lang/Integer;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 174 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.getUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 169 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.isIframe:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 179 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ExternalView.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.availableLanguages:(Ljava/util/List;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.brand:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.build:()Lde/codecentric/boot/admin/server/ui/web/UiController$Settings;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.enableToasts:(Ljava/lang/Boolean;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.externalViews:(Ljava/util/List;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.favicon:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.faviconDanger:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.hideInstanceUrl:(Ljava/lang/Boolean;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.loginIcon:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.notificationFilterEnabled:(Z)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.pollTimer:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$PollTimer;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.rememberMeEnabled:(Z)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.routes:(Ljava/util/List;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.theme:(Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$UiTheme;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.title:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings$SettingsBuilder.viewSettings:(Ljava/util/List;)Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$PollTimer;Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$UiTheme;ZZLjava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.builder:()Lde/codecentric/boot/admin/server/ui/web/UiController$Settings$SettingsBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getAvailableLanguages:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 143 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getBrand:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getEnableToasts:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 151 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getExternalViews:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 147 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getFavicon:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 131 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getFaviconDanger:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 133 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getHideInstanceUrl:()Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 153 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getLoginIcon:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 129 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getPollTimer:()Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$PollTimer;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 135 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getRoutes:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 145 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getTheme:()Lde/codecentric/boot/admin/server/ui/config/AdminServerUiProperties$UiTheme;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 125 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.getViewSettings:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 149 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.isNotificationFilterEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 139 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.isRememberMeEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 141 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$Settings.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.:(Ljava/lang/String;Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 214, + 215, + 216, + 217, + 218 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 200 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 200 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.getName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 207 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 200 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.isEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 212 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.setEnabled:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 200 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController$ViewSettings.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 200 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.:(Ljava/lang/String;Lde/codecentric/boot/admin/server/ui/extensions/UiExtensions;Lde/codecentric/boot/admin/server/ui/web/UiController$Settings;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 53, + 54, + 55, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.getBaseUrl:(Lorg/springframework/web/util/UriComponentsBuilder;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 61, + 62, + 63, + 65, + 66, + 68, + 69, + 71, + 72, + 74 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.getCssExtensions:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 84 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.getJsExtensions:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.getUiSettings:()Lde/codecentric/boot/admin/server/ui/web/UiController$Settings;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 79 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.getUser:(Ljava/security/Principal;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 94, + 95, + 97 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.index:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 103 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.login:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 118 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.sbaSettings:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 108 + ] + }, + "de.codecentric.boot.admin.server.ui.web.UiController.variablesCss:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 113 + ] + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.:(Lde/codecentric/boot/admin/server/ui/web/HomepageForwardingFilterConfig;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 49, + 50 + ] + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.:(Ljava/lang/String;Ljava/util/List;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 40, + 41, + 42, + 46 + ] + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.filter:(Lorg/springframework/web/server/ServerWebExchange;Lorg/springframework/web/server/WebFilterChain;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 54, + 55, + 56, + 58 + ] + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.lambda$filter$3:(Lorg/springframework/http/server/reactive/ServerHttpRequest$Builder;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 56 + ] + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.lambda$new$0:(Lorg/springframework/http/server/reactive/ServerHttpRequest;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.lambda$new$1:(Lorg/springframework/http/server/reactive/ServerHttpRequest;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.ui.web.reactive.HomepageForwardingFilter.lambda$new$2:(Lorg/springframework/http/server/reactive/ServerHttpRequest;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 45 + ] + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter.:(Lde/codecentric/boot/admin/server/ui/web/HomepageForwardingFilterConfig;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 62, + 63 + ] + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter.:(Ljava/lang/String;Ljava/util/List;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 53, + 54, + 55, + 56, + 57, + 59 + ] + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter.destroy:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T021", + "perMethodOutcome" : "T021", + "lineNumbers" : [ + 85 + ] + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter.doFilter:(Ljakarta/servlet/ServletRequest;Ljakarta/servlet/ServletResponse;Ljakarta/servlet/FilterChain;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 68, + 69, + 70, + 71, + 72, + 76, + 77 + ] + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter.init:(Ljakarta/servlet/FilterConfig;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T021", + "perMethodOutcome" : "T021", + "lineNumbers" : [ + 81 + ] + }, + "de.codecentric.boot.admin.server.ui.web.servlet.HomepageForwardingFilter.lambda$new$0:(Ljakarta/servlet/http/HttpServletRequest;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-server-ui/package-lock.json b/spring-boot-admin-server-ui/package-lock.json index 3385f725218..09085712527 100644 --- a/spring-boot-admin-server-ui/package-lock.json +++ b/spring-boot-admin-server-ui/package-lock.json @@ -178,9 +178,9 @@ } }, "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -206,9 +206,9 @@ } }, "node_modules/@babel/helper-function-name/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -233,9 +233,9 @@ } }, "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -260,9 +260,9 @@ } }, "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -292,12 +292,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", - "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "version": "7.27.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.5.tgz", + "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==", "license": "MIT", "dependencies": { - "@babel/types": "^7.27.1" + "@babel/types": "^7.27.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -307,9 +307,9 @@ } }, "node_modules/@babel/parser/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.27.1", @@ -320,9 +320,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", - "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", + "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", "dev": true, "license": "MIT", "engines": { @@ -345,9 +345,9 @@ } }, "node_modules/@babel/template/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -381,14 +381,14 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/generator": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz", - "integrity": "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==", + "version": "7.27.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.5.tgz", + "integrity": "sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.27.1", - "@babel/types": "^7.27.1", + "@babel/parser": "^7.27.5", + "@babel/types": "^7.27.3", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -398,9 +398,9 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -540,9 +540,9 @@ } }, "node_modules/@csstools/css-calc": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.3.tgz", - "integrity": "sha512-XBG3talrhid44BY1x3MHzUx/aTG8+x/Zi57M4aTKK9RFB4aLlF3TTSzfzn8nWVHWL3FgAXAxmupmDd6VWww+pw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", "dev": true, "funding": [ { @@ -559,14 +559,14 @@ "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-color-parser": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.9.tgz", - "integrity": "sha512-wILs5Zk7BU86UArYBJTPy/FMPPKVKHMj1ycCEyf3VUptol0JNRLFU/BZsJ4aiIHJEbSLiizzRrw8Pc1uAEDrXw==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.10.tgz", + "integrity": "sha512-TiJ5Ajr6WRd1r8HSiwJvZBiJOqtH86aHpUjq5aEKWHiII2Qfjqd/HCWKPOW8EP4vcspXbHnXrwIDlu5savQipg==", "dev": true, "funding": [ { @@ -581,20 +581,20 @@ "license": "MIT", "dependencies": { "@csstools/color-helpers": "^5.0.2", - "@csstools/css-calc": "^2.1.3" + "@csstools/css-calc": "^2.1.4" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-parser-algorithms": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz", - "integrity": "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", "dev": true, "funding": [ { @@ -611,13 +611,13 @@ "node": ">=18" }, "peerDependencies": { - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-tokenizer": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz", - "integrity": "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", "dev": true, "funding": [ { @@ -1113,9 +1113,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -1284,9 +1284,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -1330,14 +1330,14 @@ "license": "BSD-3-Clause" }, "node_modules/@inquirer/confirm": { - "version": "5.1.10", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.10.tgz", - "integrity": "sha512-FxbQ9giWxUWKUk2O5XZ6PduVnH2CZ/fmMKMBkH71MHJvWr7WL5AHKevhzF1L5uYWB2P548o1RzVxrNd3dpmk6g==", + "version": "5.1.12", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.12.tgz", + "integrity": "sha512-dpq+ielV9/bqgXRUbNH//KsY6WEw9DrGPmipkpmgC1Y46cwuBTNx7PXFWTjc3MQ+urcc0QxoVHcMI0FW4Ok0hg==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.11", - "@inquirer/type": "^3.0.6" + "@inquirer/core": "^10.1.13", + "@inquirer/type": "^3.0.7" }, "engines": { "node": ">=18" @@ -1352,14 +1352,14 @@ } }, "node_modules/@inquirer/core": { - "version": "10.1.11", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.11.tgz", - "integrity": "sha512-BXwI/MCqdtAhzNQlBEFE7CEflhPkl/BqvAuV/aK6lW3DClIfYVDWPP/kXuXHtBWC7/EEbNqd/1BGq2BGBBnuxw==", + "version": "10.1.13", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.13.tgz", + "integrity": "sha512-1viSxebkYN2nJULlzCxES6G9/stgHSepZ9LqqfdIGPHj5OHhiBUXVS0a6R0bEC2A+VL4D9w6QB66ebCr6HGllA==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/figures": "^1.0.11", - "@inquirer/type": "^3.0.6", + "@inquirer/figures": "^1.0.12", + "@inquirer/type": "^3.0.7", "ansi-escapes": "^4.3.2", "cli-width": "^4.1.0", "mute-stream": "^2.0.0", @@ -1417,9 +1417,9 @@ } }, "node_modules/@inquirer/figures": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.11.tgz", - "integrity": "sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.12.tgz", + "integrity": "sha512-MJttijd8rMFcKJC8NYmprWr6hD3r9Gd9qUC0XwPNwoEPWSMVJwA2MlXxF+nhZZNMY+HXsWa+o7KY2emWYIn0jQ==", "dev": true, "license": "MIT", "engines": { @@ -1427,9 +1427,9 @@ } }, "node_modules/@inquirer/type": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.6.tgz", - "integrity": "sha512-/mKVCtVpyBu3IDarv0G+59KC4stsD5mDsGpYh+GKs1NZT88Jh52+cuoA1AtLk2Q0r/quNl+1cSUyLRHBFeD0XA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.7.tgz", + "integrity": "sha512-PfunHQcjwnju84L+ycmcMKB/pTPIngjUJvfnRhKY6FKPuYXlM4aQCb/nIdTFR6BEhMjFvngzvng/vBAJMZpLSA==", "dev": true, "license": "MIT", "engines": { @@ -1612,9 +1612,9 @@ } }, "node_modules/@mswjs/interceptors": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.39.1.tgz", - "integrity": "sha512-f/OVak8vv5LCi85wPDOUpqgAQV4qoZTr4H/pPuRggtdzgnU4+BYBv0+gK853ln//PDL7mUkAkR2kW313Tu1i8g==", + "version": "0.39.2", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.39.2.tgz", + "integrity": "sha512-RuzCup9Ct91Y7V79xwCb146RaBRHZ7NBbrIUySumd1rpKqHL5OonaqrGIbug5hNwP/fRyxFMA6ISgw4FTtYFYg==", "dev": true, "license": "MIT", "dependencies": { @@ -2021,9 +2021,9 @@ } }, "node_modules/@pkgr/core": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.4.tgz", - "integrity": "sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw==", + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.7.tgz", + "integrity": "sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg==", "dev": true, "license": "MIT", "engines": { @@ -2034,9 +2034,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.0.tgz", - "integrity": "sha512-KxN+zCjOYHGwCl4UCtSfZ6jrq/qi88JDUtiEFk8LELEHq2Egfc/FgW+jItZiOLRuQfb/3xJSgFuNPC9jzggX+A==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.0.tgz", + "integrity": "sha512-xEiEE5oDW6tK4jXCAyliuntGR+amEMO7HLtdSshVuhFnKTYoeYMyXQK7pLouAJJj5KHdwdn87bfHAR2nSdNAUA==", "cpu": [ "arm" ], @@ -2048,9 +2048,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.0.tgz", - "integrity": "sha512-yDvqx3lWlcugozax3DItKJI5j05B0d4Kvnjx+5mwiUpWramVvmAByYigMplaoAQ3pvdprGCTCE03eduqE/8mPQ==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.44.0.tgz", + "integrity": "sha512-uNSk/TgvMbskcHxXYHzqwiyBlJ/lGcv8DaUfcnNwict8ba9GTTNxfn3/FAoFZYgkaXXAdrAA+SLyKplyi349Jw==", "cpu": [ "arm64" ], @@ -2062,9 +2062,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.0.tgz", - "integrity": "sha512-2KOU574vD3gzcPSjxO0eyR5iWlnxxtmW1F5CkNOHmMlueKNCQkxR6+ekgWyVnz6zaZihpUNkGxjsYrkTJKhkaw==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.44.0.tgz", + "integrity": "sha512-VGF3wy0Eq1gcEIkSCr8Ke03CWT+Pm2yveKLaDvq51pPpZza3JX/ClxXOCmTYYq3us5MvEuNRTaeyFThCKRQhOA==", "cpu": [ "arm64" ], @@ -2076,9 +2076,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.0.tgz", - "integrity": "sha512-gE5ACNSxHcEZyP2BA9TuTakfZvULEW4YAOtxl/A/YDbIir/wPKukde0BNPlnBiP88ecaN4BJI2TtAd+HKuZPQQ==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.44.0.tgz", + "integrity": "sha512-fBkyrDhwquRvrTxSGH/qqt3/T0w5Rg0L7ZIDypvBPc1/gzjJle6acCpZ36blwuwcKD/u6oCE/sRWlUAcxLWQbQ==", "cpu": [ "x64" ], @@ -2090,9 +2090,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.0.tgz", - "integrity": "sha512-GSxU6r5HnWij7FoSo7cZg3l5GPg4HFLkzsFFh0N/b16q5buW1NAWuCJ+HMtIdUEi6XF0qH+hN0TEd78laRp7Dg==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.44.0.tgz", + "integrity": "sha512-u5AZzdQJYJXByB8giQ+r4VyfZP+walV+xHWdaFx/1VxsOn6eWJhK2Vl2eElvDJFKQBo/hcYIBg/jaKS8ZmKeNQ==", "cpu": [ "arm64" ], @@ -2104,9 +2104,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.0.tgz", - "integrity": "sha512-KGiGKGDg8qLRyOWmk6IeiHJzsN/OYxO6nSbT0Vj4MwjS2XQy/5emsmtoqLAabqrohbgLWJ5GV3s/ljdrIr8Qjg==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.44.0.tgz", + "integrity": "sha512-qC0kS48c/s3EtdArkimctY7h3nHicQeEUdjJzYVJYR3ct3kWSafmn6jkNCA8InbUdge6PVx6keqjk5lVGJf99g==", "cpu": [ "x64" ], @@ -2118,9 +2118,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.0.tgz", - "integrity": "sha512-46OzWeqEVQyX3N2/QdiU/CMXYDH/lSHpgfBkuhl3igpZiaB3ZIfSjKuOnybFVBQzjsLwkus2mjaESy8H41SzvA==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.44.0.tgz", + "integrity": "sha512-x+e/Z9H0RAWckn4V2OZZl6EmV0L2diuX3QB0uM1r6BvhUIv6xBPL5mrAX2E3e8N8rEHVPwFfz/ETUbV4oW9+lQ==", "cpu": [ "arm" ], @@ -2132,9 +2132,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.0.tgz", - "integrity": "sha512-lfgW3KtQP4YauqdPpcUZHPcqQXmTmH4nYU0cplNeW583CMkAGjtImw4PKli09NFi2iQgChk4e9erkwlfYem6Lg==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.44.0.tgz", + "integrity": "sha512-1exwiBFf4PU/8HvI8s80icyCcnAIB86MCBdst51fwFmH5dyeoWVPVgmQPcKrMtBQ0W5pAs7jBCWuRXgEpRzSCg==", "cpu": [ "arm" ], @@ -2146,9 +2146,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.0.tgz", - "integrity": "sha512-nn8mEyzMbdEJzT7cwxgObuwviMx6kPRxzYiOl6o/o+ChQq23gfdlZcUNnt89lPhhz3BYsZ72rp0rxNqBSfqlqw==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.44.0.tgz", + "integrity": "sha512-ZTR2mxBHb4tK4wGf9b8SYg0Y6KQPjGpR4UWwTFdnmjB4qRtoATZ5dWn3KsDwGa5Z2ZBOE7K52L36J9LueKBdOQ==", "cpu": [ "arm64" ], @@ -2160,9 +2160,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.0.tgz", - "integrity": "sha512-l+QK99je2zUKGd31Gh+45c4pGDAqZSuWQiuRFCdHYC2CSiO47qUWsCcenrI6p22hvHZrDje9QjwSMAFL3iwXwQ==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.44.0.tgz", + "integrity": "sha512-GFWfAhVhWGd4r6UxmnKRTBwP1qmModHtd5gkraeW2G490BpFOZkFtem8yuX2NyafIP/mGpRJgTJ2PwohQkUY/Q==", "cpu": [ "arm64" ], @@ -2174,9 +2174,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.0.tgz", - "integrity": "sha512-WbnJaxPv1gPIm6S8O/Wg+wfE/OzGSXlBMbOe4ie+zMyykMOeqmgD1BhPxZQuDqwUN+0T/xOFtL2RUWBspnZj3w==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.44.0.tgz", + "integrity": "sha512-xw+FTGcov/ejdusVOqKgMGW3c4+AgqrfvzWEVXcNP6zq2ue+lsYUgJ+5Rtn/OTJf7e2CbgTFvzLW2j0YAtj0Gg==", "cpu": [ "loong64" ], @@ -2188,9 +2188,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.0.tgz", - "integrity": "sha512-eRDWR5t67/b2g8Q/S8XPi0YdbKcCs4WQ8vklNnUYLaSWF+Cbv2axZsp4jni6/j7eKvMLYCYdcsv8dcU+a6QNFg==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.44.0.tgz", + "integrity": "sha512-bKGibTr9IdF0zr21kMvkZT4K6NV+jjRnBoVMt2uNMG0BYWm3qOVmYnXKzx7UhwrviKnmK46IKMByMgvpdQlyJQ==", "cpu": [ "ppc64" ], @@ -2202,9 +2202,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.0.tgz", - "integrity": "sha512-TWrZb6GF5jsEKG7T1IHwlLMDRy2f3DPqYldmIhnA2DVqvvhY2Ai184vZGgahRrg8k9UBWoSlHv+suRfTN7Ua4A==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.44.0.tgz", + "integrity": "sha512-vV3cL48U5kDaKZtXrti12YRa7TyxgKAIDoYdqSIOMOFBXqFj2XbChHAtXquEn2+n78ciFgr4KIqEbydEGPxXgA==", "cpu": [ "riscv64" ], @@ -2216,9 +2216,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.0.tgz", - "integrity": "sha512-ieQljaZKuJpmWvd8gW87ZmSFwid6AxMDk5bhONJ57U8zT77zpZ/TPKkU9HpnnFrM4zsgr4kiGuzbIbZTGi7u9A==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.44.0.tgz", + "integrity": "sha512-TDKO8KlHJuvTEdfw5YYFBjhFts2TR0VpZsnLLSYmB7AaohJhM8ctDSdDnUGq77hUh4m/djRafw+9zQpkOanE2Q==", "cpu": [ "riscv64" ], @@ -2230,9 +2230,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.0.tgz", - "integrity": "sha512-/L3pW48SxrWAlVsKCN0dGLB2bi8Nv8pr5S5ocSM+S0XCn5RCVCXqi8GVtHFsOBBCSeR+u9brV2zno5+mg3S4Aw==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.44.0.tgz", + "integrity": "sha512-8541GEyktXaw4lvnGp9m84KENcxInhAt6vPWJ9RodsB/iGjHoMB2Pp5MVBCiKIRxrxzJhGCxmNzdu+oDQ7kwRA==", "cpu": [ "s390x" ], @@ -2244,9 +2244,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.0.tgz", - "integrity": "sha512-XMLeKjyH8NsEDCRptf6LO8lJk23o9wvB+dJwcXMaH6ZQbbkHu2dbGIUindbMtRN6ux1xKi16iXWu6q9mu7gDhQ==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.0.tgz", + "integrity": "sha512-iUVJc3c0o8l9Sa/qlDL2Z9UP92UZZW1+EmQ4xfjTc1akr0iUFZNfxrXJ/R1T90h/ILm9iXEY6+iPrmYB3pXKjw==", "cpu": [ "x64" ], @@ -2258,9 +2258,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.0.tgz", - "integrity": "sha512-m/P7LycHZTvSQeXhFmgmdqEiTqSV80zn6xHaQ1JSqwCtD1YGtwEK515Qmy9DcB2HK4dOUVypQxvhVSy06cJPEg==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.44.0.tgz", + "integrity": "sha512-PQUobbhLTQT5yz/SPg116VJBgz+XOtXt8D1ck+sfJJhuEsMj2jSej5yTdp8CvWBSceu+WW+ibVL6dm0ptG5fcA==", "cpu": [ "x64" ], @@ -2272,9 +2272,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.0.tgz", - "integrity": "sha512-4yodtcOrFHpbomJGVEqZ8fzD4kfBeCbpsUy5Pqk4RluXOdsWdjLnjhiKy2w3qzcASWd04fp52Xz7JKarVJ5BTg==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.44.0.tgz", + "integrity": "sha512-M0CpcHf8TWn+4oTxJfh7LQuTuaYeXGbk0eageVjQCKzYLsajWS/lFC94qlRqOlyC2KvRT90ZrfXULYmukeIy7w==", "cpu": [ "arm64" ], @@ -2286,9 +2286,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.0.tgz", - "integrity": "sha512-tmazCrAsKzdkXssEc65zIE1oC6xPHwfy9d5Ta25SRCDOZS+I6RypVVShWALNuU9bxIfGA0aqrmzlzoM5wO5SPQ==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.44.0.tgz", + "integrity": "sha512-3XJ0NQtMAXTWFW8FqZKcw3gOQwBtVWP/u8TpHP3CRPXD7Pd6s8lLdH3sHWh8vqKCyyiI8xW5ltJScQmBU9j7WA==", "cpu": [ "ia32" ], @@ -2300,9 +2300,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.0.tgz", - "integrity": "sha512-h1J+Yzjo/X+0EAvR2kIXJDuTuyT7drc+t2ALY0nIcGPbTatNOf0VWdhEA2Z4AAjv6X1NJV7SYo5oCTYRJhSlVA==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.44.0.tgz", + "integrity": "sha512-Q2Mgwt+D8hd5FIPUuPDsvPR7Bguza6yTkJxspDGkZj7tBRn2y4KSWYuIXpftFSjBra76TbKerCV7rgFPQrn+wQ==", "cpu": [ "x64" ], @@ -2316,7 +2316,7 @@ "node_modules/@stekoe/vue-toast-notificationcenter": { "version": "1.0.0", "resolved": "https://github.com/SteKoe/vue-toast-notificationcenter/archive/refs/tags/1.0.0-RC5.tar.gz", - "integrity": "sha1-EbY3nFQmIdRZ8QqmyWvF7ZFaDCI= sha512-ilr6m5m0SIyDI6ecfdDNv9baiQCbf+hh7xblPVd60/KuMSoc5DJgUKpRcN7aDVzrY2Y9dj+nP433LbeFFffYtw==", + "integrity": "sha512-ilr6m5m0SIyDI6ecfdDNv9baiQCbf+hh7xblPVd60/KuMSoc5DJgUKpRcN7aDVzrY2Y9dj+nP433LbeFFffYtw==", "peerDependencies": { "vue": "^3.2.25" } @@ -2608,13 +2608,13 @@ } }, "node_modules/@storybook/builder-vite": { - "version": "9.0.11", - "resolved": "https://registry.npmjs.org/@storybook/builder-vite/-/builder-vite-9.0.11.tgz", - "integrity": "sha512-S/Kg+afUue7/bmPBKoeQcozIr/L+bhnpo1eBJ5l9EIGL1adqmbUq4eOsd16C+tZMUiOuxs+eND52QtnEg+MDyg==", + "version": "9.0.12", + "resolved": "https://registry.npmjs.org/@storybook/builder-vite/-/builder-vite-9.0.12.tgz", + "integrity": "sha512-Jh6CJKHJQ+N1BiPr6fY91EMV5X0xBuIAhLpaNSKrshkdnXd/fBbRgE8iPJdnr+SCqaFErBjAjBzKkotwKU138A==", "dev": true, "license": "MIT", "dependencies": { - "@storybook/csf-plugin": "9.0.11", + "@storybook/csf-plugin": "9.0.12", "ts-dedent": "^2.0.0" }, "funding": { @@ -2622,14 +2622,14 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^9.0.11", + "storybook": "^9.0.12", "vite": "^5.0.0 || ^6.0.0" } }, "node_modules/@storybook/builder-vite/node_modules/@storybook/csf-plugin": { - "version": "9.0.11", - "resolved": "https://registry.npmjs.org/@storybook/csf-plugin/-/csf-plugin-9.0.11.tgz", - "integrity": "sha512-uJc8ovkAjUbBT5zLPPubBBEIpYOFG5zY5yDbgunq3ZrhWJl3axBe3mHJJ7RH4FtgKw3gKpn7Z5vNqWpMuL5Tbw==", + "version": "9.0.12", + "resolved": "https://registry.npmjs.org/@storybook/csf-plugin/-/csf-plugin-9.0.12.tgz", + "integrity": "sha512-5EueJQJAu77Lh+EedG4Q/kEOZNlTY/g+fWsT7B5DTtLVy0ypnghsHY8X3KYT/0+NNgTtoO0if4F+ejVYaLnMzA==", "dev": true, "license": "MIT", "dependencies": { @@ -2640,7 +2640,7 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^9.0.11" + "storybook": "^9.0.12" } }, "node_modules/@storybook/csf-plugin": { @@ -2721,14 +2721,14 @@ } }, "node_modules/@storybook/vue3-vite": { - "version": "9.0.11", - "resolved": "https://registry.npmjs.org/@storybook/vue3-vite/-/vue3-vite-9.0.11.tgz", - "integrity": "sha512-hgQTPnayJ/z7Utg6iTt7XOXln0L+Y7a1xlJgqqjcHw608M7N5SvNtlxZzM/JX5y+V3doFoE6LVf4c/kaUMfWuA==", + "version": "9.0.12", + "resolved": "https://registry.npmjs.org/@storybook/vue3-vite/-/vue3-vite-9.0.12.tgz", + "integrity": "sha512-WrIqByXA/9FNs3UEKM5W7enEeTYghAwxdQg9h6EWLg8essXmEFQM2IETE4YHrZqbz0eUKRZL9uU1Chzc+0mZvQ==", "dev": true, "license": "MIT", "dependencies": { - "@storybook/builder-vite": "9.0.11", - "@storybook/vue3": "9.0.11", + "@storybook/builder-vite": "9.0.12", + "@storybook/vue3": "9.0.12", "find-package-json": "^1.2.0", "magic-string": "^0.30.0", "typescript": "^5.8.3", @@ -2743,10 +2743,33 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^9.0.11", + "storybook": "^9.0.12", "vite": "^5.0.0 || ^6.0.0" } }, + "node_modules/@storybook/vue3-vite/node_modules/@storybook/vue3": { + "version": "9.0.12", + "resolved": "https://registry.npmjs.org/@storybook/vue3/-/vue3-9.0.12.tgz", + "integrity": "sha512-pnNqBsVSaIZ7E9iA7vdIg4fiJfxd3EB57vp4FwtmNBpHjHeP9S2yZKaov7LEC2+pWraqSL/tVqsYC8oUzhh1Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@storybook/global": "^5.0.0", + "type-fest": "~2.19", + "vue-component-type-helpers": "latest" + }, + "engines": { + "node": ">=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "storybook": "^9.0.12", + "vue": "^3.0.0" + } + }, "node_modules/@tailwindcss/forms": { "version": "0.5.10", "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.10.tgz", @@ -2775,9 +2798,9 @@ } }, "node_modules/@tanstack/virtual-core": { - "version": "3.13.9", - "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.13.9.tgz", - "integrity": "sha512-3jztt0jpaoJO5TARe2WIHC1UQC3VMLAFUW5mmMo0yrkwtDB2AQP0+sh10BVUpWrnvHjSLvzFizydtEGLCJKFoQ==", + "version": "3.13.10", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.13.10.tgz", + "integrity": "sha512-sPEDhXREou5HyZYqSWIqdU580rsF6FGeN7vpzijmP3KTiOGjOMZASz4Y6+QKjiFQwhWrR58OP8izYaNGVxvViA==", "license": "MIT", "funding": { "type": "github", @@ -2785,12 +2808,12 @@ } }, "node_modules/@tanstack/vue-virtual": { - "version": "3.13.9", - "resolved": "https://registry.npmjs.org/@tanstack/vue-virtual/-/vue-virtual-3.13.9.tgz", - "integrity": "sha512-HsvHaOo+o52cVcPhomKDZ3CMpTF/B2qg+BhPHIQJwzn4VIqDyt/rRVqtIomG6jE83IFsE2vlr6cmx7h3dHA0SA==", + "version": "3.13.10", + "resolved": "https://registry.npmjs.org/@tanstack/vue-virtual/-/vue-virtual-3.13.10.tgz", + "integrity": "sha512-1UZmUiMNyKxQ1JFPtO3rfRmK7IuLYwfj/foPC7FVWj6yHand4ry5joFh8LQ1Ckm7Dfe/08cv6LKZNc4WYj7hxQ==", "license": "MIT", "dependencies": { - "@tanstack/virtual-core": "3.13.9" + "@tanstack/virtual-core": "3.13.10" }, "funding": { "type": "github", @@ -3291,9 +3314,9 @@ "license": "MIT" }, "node_modules/@types/estree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, "license": "MIT" }, @@ -3305,9 +3328,9 @@ "license": "MIT" }, "node_modules/@types/lodash": { - "version": "4.17.17", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.17.tgz", - "integrity": "sha512-RRVJ+J3J+WmyOTqnz3PiBLA501eKwXl2noseKOrNo/6+XEHjTAxO4xHvxQB6QuNm+s4WRbn6rSiap8+EA+ykFQ==", + "version": "4.17.18", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.18.tgz", + "integrity": "sha512-KJ65INaxqxmU6EoCiJmRPZC9H9RVWCRd349tXM2M3O5NA7cY6YL7c0bHAHQ93NOfTObEQ004kd2QVHs/r0+m4g==", "dev": true, "license": "MIT" }, @@ -3346,9 +3369,9 @@ "license": "MIT" }, "node_modules/@types/statuses": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.5.tgz", - "integrity": "sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.6.tgz", + "integrity": "sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==", "dev": true, "license": "MIT" }, @@ -3417,122 +3440,6 @@ "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz", - "integrity": "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz", - "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz", - "integrity": "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.34.1", - "@typescript-eslint/tsconfig-utils": "8.34.1", - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.1.tgz", - "integrity": "sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.34.1", - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/typescript-estree": "8.34.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz", - "integrity": "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.34.1", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@typescript-eslint/parser": { "version": "8.34.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.34.1.tgz", @@ -3558,98 +3465,6 @@ "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz", - "integrity": "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz", - "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz", - "integrity": "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.34.1", - "@typescript-eslint/tsconfig-utils": "8.34.1", - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz", - "integrity": "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.34.1", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@typescript-eslint/project-service": { "version": "8.34.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.1.tgz", @@ -3672,29 +3487,15 @@ "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/project-service/node_modules/@typescript-eslint/types": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz", - "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.1.tgz", - "integrity": "sha512-7IsIaIDeZn7kffk7qXC3o6Z4UblZJKV3UBpkvRNpr5NSyLji7tvTcvmnMNYuYLyh26mN8W723xpo3i4MlD33vA==", + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz", + "integrity": "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1" + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/visitor-keys": "8.34.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3745,25 +3546,7 @@ "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.34.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz", - "integrity": "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { + "node_modules/@typescript-eslint/types": { "version": "8.34.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz", "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==", @@ -3777,7 +3560,7 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { + "node_modules/@typescript-eslint/typescript-estree": { "version": "8.34.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz", "integrity": "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==", @@ -3806,7 +3589,7 @@ "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { + "node_modules/@typescript-eslint/utils": { "version": "8.34.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.1.tgz", "integrity": "sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ==", @@ -3830,7 +3613,7 @@ "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { + "node_modules/@typescript-eslint/visitor-keys": { "version": "8.34.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz", "integrity": "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==", @@ -3848,7 +3631,7 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/eslint-visitor-keys": { + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", @@ -3861,102 +3644,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@typescript-eslint/types": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.1.tgz", - "integrity": "sha512-YmybwXUJcgGqgAp6bEsgpPXEg6dcCyPyCSr0CAAueacR/CCBi25G3V8gGQ2kRzQRBNol7VQknxMs9HvVa9Rvfg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.1.tgz", - "integrity": "sha512-Y3AP9EIfYwBb4kWGb+simvPaqQoT5oJuzzj9m0i6FCY6SPvlomY2Ei4UEMm7+FXtlNJbor80ximyslzaQF6xhg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.1.tgz", - "integrity": "sha512-DsSFNIgLSrc89gpq1LJB7Hm1YpuhK086DRDJSNrewcGvYloWW1vZLHBTIvarKZDcAORIy/uWNx8Gad+4oMpkSA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.32.1", - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/typescript-estree": "8.32.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.1.tgz", - "integrity": "sha512-ar0tjQfObzhSaW3C3QNmTc5ofj0hDoNQ5XWrCy6zDyabdr0TWhCkClp+rywGNj/odAFBVzzJrK4tEq5M4Hmu4w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.32.1", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@ungap/structured-clone": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", @@ -3979,15 +3666,14 @@ } }, "node_modules/@vitest/expect": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.3.tgz", - "integrity": "sha512-W2RH2TPWVHA1o7UmaFKISPvdicFJH+mjykctJFoAkUw+SPTJTGjUNdKscFBrqM7IPnCVu6zihtKYa7TkZS1dkQ==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.9.tgz", + "integrity": "sha512-5eCqRItYgIML7NNVgJj6TVCmdzE7ZVgJhruW0ziSQV4V7PvLkDL1bBkBdcTs/VuIz0IxPb5da1IDSqc1TR9eig==", "dev": true, "license": "MIT", "dependencies": { - "@types/chai": "^5.2.2", - "@vitest/spy": "3.2.3", - "@vitest/utils": "3.2.3", + "@vitest/spy": "3.0.9", + "@vitest/utils": "3.0.9", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" }, @@ -4022,20 +3708,33 @@ } } }, - "node_modules/@vitest/mocker/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "node_modules/@vitest/mocker/node_modules/@vitest/spy": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.3.tgz", + "integrity": "sha512-JHu9Wl+7bf6FEejTCREy+DmgWe+rQKbK+y32C/k5f4TBIAlijhJbRBIRIOCEpVevgRsCQR2iHRUH2/qKVM/plw==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "^1.0.0" + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker/node_modules/tinyspy": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.3.tgz", + "integrity": "sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" } }, "node_modules/@vitest/pretty-format": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.3.tgz", - "integrity": "sha512-yFglXGkr9hW/yEXngO+IKMhP0jxyFw2/qys/CK4fFUZnSltD+MU7dVYGrH8rvPcK/O6feXQA+EU33gjaBBbAng==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.9.tgz", + "integrity": "sha512-OW9F8t2J3AwFEwENg3yMyKWweF7oRJlMyHOMIhO5F3n0+cgQAJZBjNgrF8dLwFTEXl5jUqBLXd9QyyKv8zEcmA==", "dev": true, "license": "MIT", "dependencies": { @@ -4060,6 +3759,34 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/@vitest/runner/node_modules/@vitest/pretty-format": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.3.tgz", + "integrity": "sha512-yFglXGkr9hW/yEXngO+IKMhP0jxyFw2/qys/CK4fFUZnSltD+MU7dVYGrH8rvPcK/O6feXQA+EU33gjaBBbAng==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner/node_modules/@vitest/utils": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.3.tgz", + "integrity": "sha512-4zFBCU5Pf+4Z6v+rwnZ1HU1yzOKKvDkMXZrymE2PBlbjKJRlrOxbvpfPSvJTGRIwGoahaOGvp+kbCoxifhzJ1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.3", + "loupe": "^3.1.3", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/@vitest/snapshot": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.3.tgz", @@ -4075,37 +3802,40 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/spy": { + "node_modules/@vitest/snapshot/node_modules/@vitest/pretty-format": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.3.tgz", - "integrity": "sha512-JHu9Wl+7bf6FEejTCREy+DmgWe+rQKbK+y32C/k5f4TBIAlijhJbRBIRIOCEpVevgRsCQR2iHRUH2/qKVM/plw==", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.3.tgz", + "integrity": "sha512-yFglXGkr9hW/yEXngO+IKMhP0jxyFw2/qys/CK4fFUZnSltD+MU7dVYGrH8rvPcK/O6feXQA+EU33gjaBBbAng==", "dev": true, "license": "MIT", "dependencies": { - "tinyspy": "^4.0.3" + "tinyrainbow": "^2.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/spy/node_modules/tinyspy": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.3.tgz", - "integrity": "sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==", + "node_modules/@vitest/spy": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.9.tgz", + "integrity": "sha512-/CcK2UDl0aQ2wtkp3YVWldrpLRNCfVcIOFGlVGKO4R5eajsH393Z1yiXLVQ7vWsj26JOEjeZI0x5sm5P4OGUNQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">=14.0.0" + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.3.tgz", - "integrity": "sha512-4zFBCU5Pf+4Z6v+rwnZ1HU1yzOKKvDkMXZrymE2PBlbjKJRlrOxbvpfPSvJTGRIwGoahaOGvp+kbCoxifhzJ1Q==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.9.tgz", + "integrity": "sha512-ilHM5fHhZ89MCp5aAaM9uhfl1c2JdxVxl3McqsdVyVNN6JffnEen8UMCdRTzOhGXNQGo5GNL9QugHrz727Wnng==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.2.3", + "@vitest/pretty-format": "3.0.9", "loupe": "^3.1.3", "tinyrainbow": "^2.0.0" }, @@ -4155,6 +3885,12 @@ "source-map-js": "^1.2.1" } }, + "node_modules/@vue/compiler-core/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, "node_modules/@vue/compiler-dom": { "version": "3.5.16", "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.16.tgz", @@ -4182,6 +3918,12 @@ "source-map-js": "^1.2.1" } }, + "node_modules/@vue/compiler-sfc/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, "node_modules/@vue/compiler-ssr": { "version": "3.5.16", "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.16.tgz", @@ -4210,16 +3952,16 @@ "license": "MIT" }, "node_modules/@vue/eslint-config-typescript": { - "version": "14.5.0", - "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-14.5.0.tgz", - "integrity": "sha512-5oPOyuwkw++AP5gHDh5YFmST50dPfWOcm3/W7Nbh42IK5O3H74ytWAw0TrCRTaBoD/02khnWXuZf1Bz1xflavQ==", + "version": "14.5.1", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-14.5.1.tgz", + "integrity": "sha512-ys6qdYHGXS/WLt0r5vUcTiG163F4NbNpx3ABTsGITw8k5uCFiv4g9E1N9Jydlw62KzJMVKGcpXbg6LCA3fV+eA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "^8.26.0", + "@typescript-eslint/utils": "^8.34.1", "fast-glob": "^3.3.3", - "typescript-eslint": "^8.26.0", - "vue-eslint-parser": "^10.1.1" + "typescript-eslint": "^8.34.1", + "vue-eslint-parser": "^10.1.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4332,9 +4074,9 @@ } }, "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", "bin": { @@ -4729,9 +4471,9 @@ "license": "ISC" }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4752,9 +4494,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", - "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", + "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", "dev": true, "funding": [ { @@ -4772,8 +4514,8 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001716", - "electron-to-chromium": "^1.5.149", + "caniuse-lite": "^1.0.30001718", + "electron-to-chromium": "^1.5.160", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -4870,9 +4612,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001718", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", - "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", + "version": "1.0.30001724", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001724.tgz", + "integrity": "sha512-WqJo7p0TbHDOythNTqYujmaJTvtYRZrjpP8TCvH6Vb9CYJerJNKamKzIWOM4BkQatWj9H2lYulpdAQNBe7QhNA==", "dev": true, "funding": [ { @@ -5203,13 +4945,13 @@ } }, "node_modules/cssstyle": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.3.1.tgz", - "integrity": "sha512-ZgW+Jgdd7i52AaLYCriF8Mxqft0gD/R9i9wi6RWBhs1pqdPEzPjym7rvRKi397WmQFf3SlyUsszhw+VVCbx79Q==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.5.0.tgz", + "integrity": "sha512-/7gw8TGrvH/0g564EnhgFZogTMVe+lifpB7LWU+PEsiq5o83TUXR3fDbzTRXOJhoJwck5IS9ez3Em5LNMMO2aw==", "dev": true, "license": "MIT", "dependencies": { - "@asamuzakjp/css-color": "^3.1.2", + "@asamuzakjp/css-color": "^3.2.0", "rrweb-cssom": "^0.8.0" }, "engines": { @@ -5680,9 +5422,9 @@ "license": "MIT" }, "node_modules/decode-named-character-reference": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.1.0.tgz", - "integrity": "sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz", + "integrity": "sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -5973,9 +5715,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.157", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.157.tgz", - "integrity": "sha512-/0ybgsQd1muo8QlnuTpKwtl0oX5YMlUGbm8xyqgDU00motRkKFFbUJySAQBWcY79rVqNLWIWa87BGVGClwAB2w==", + "version": "1.5.171", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.171.tgz", + "integrity": "sha512-scWpzXEJEMrGJa4Y6m/tVotb0WuvNmasv3wWVzUAeCgKU0ToFOhUW6Z+xWnRQANMYGxN4ngJXIThgBJOqzVPCQ==", "dev": true, "license": "ISC" }, @@ -6222,9 +5964,9 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz", - "integrity": "sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.0.tgz", + "integrity": "sha512-8qsOYwkkGrahrgoUv76NZi23koqXOGiiEzXMrT8Q7VcYaUISR+5MorIUxfWqYXN0fN/31WbSrxCxFkVQ43wwrA==", "dev": true, "license": "MIT", "dependencies": { @@ -6336,9 +6078,9 @@ } }, "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -6491,10 +6233,14 @@ } }, "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "license": "MIT" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } }, "node_modules/esutils": { "version": "2.0.3", @@ -6598,9 +6344,9 @@ } }, "node_modules/fdir": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", - "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", "dev": true, "license": "MIT", "peerDependencies": { @@ -6744,14 +6490,15 @@ } }, "node_modules/form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -7139,9 +6886,9 @@ } }, "node_modules/ignore": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", - "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", "engines": { @@ -7149,9 +6896,9 @@ } }, "node_modules/immutable": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.2.tgz", - "integrity": "sha512-qHKXW1q6liAk1Oys6umoaZbDRqjcjgSrbnrifHsfsttza7zcvRAsL7mMV6xWcyhwQy7Xj5v4hhbr6b+iDYwlmQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz", + "integrity": "sha512-+chQdDfvscSF1SJqv2gn4SRO2ZyS3xL3r7IW/wWEEzrzLisnOlKiQu5ytC/BVNcS15C39WT2Hg/bjKjDMcu+zg==", "dev": true, "license": "MIT" }, @@ -7996,9 +7743,9 @@ } }, "node_modules/loupe": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", - "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.4.tgz", + "integrity": "sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==", "dev": true, "license": "MIT" }, @@ -9419,9 +9166,9 @@ } }, "node_modules/parse5/node_modules/entities": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.0.tgz", - "integrity": "sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -9762,9 +9509,9 @@ } }, "node_modules/prettier": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", - "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.0.tgz", + "integrity": "sha512-ujSB9uXHJKzM/2GBuE0hBOUgC77CN3Bnpqa+g80bkv3T3A93wL/xlzDATHhnhkzifz/UE2SNOvmbTz5hSkDlHw==", "dev": true, "license": "MIT", "bin": { @@ -10316,9 +10063,9 @@ } }, "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -10368,13 +10115,13 @@ "license": "Unlicense" }, "node_modules/rollup": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.0.tgz", - "integrity": "sha512-HqMFpUbWlf/tvcxBFNKnJyzc7Lk+XO3FGc3pbNBLqEbOz0gPLRgcrlS3UF4MfUrVlstOaP/q0kM6GVvi+LrLRg==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.44.0.tgz", + "integrity": "sha512-qHcdEzLCiktQIfwBq420pn2dP+30uzqYxv9ETm91wdt2R9AFcWfjNAmje4NWlnCIQ5RMTzVf0ZyisOKqHR6RwA==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "1.0.7" + "@types/estree": "1.0.8" }, "bin": { "rollup": "dist/bin/rollup" @@ -10384,26 +10131,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.41.0", - "@rollup/rollup-android-arm64": "4.41.0", - "@rollup/rollup-darwin-arm64": "4.41.0", - "@rollup/rollup-darwin-x64": "4.41.0", - "@rollup/rollup-freebsd-arm64": "4.41.0", - "@rollup/rollup-freebsd-x64": "4.41.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.41.0", - "@rollup/rollup-linux-arm-musleabihf": "4.41.0", - "@rollup/rollup-linux-arm64-gnu": "4.41.0", - "@rollup/rollup-linux-arm64-musl": "4.41.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.41.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.41.0", - "@rollup/rollup-linux-riscv64-gnu": "4.41.0", - "@rollup/rollup-linux-riscv64-musl": "4.41.0", - "@rollup/rollup-linux-s390x-gnu": "4.41.0", - "@rollup/rollup-linux-x64-gnu": "4.41.0", - "@rollup/rollup-linux-x64-musl": "4.41.0", - "@rollup/rollup-win32-arm64-msvc": "4.41.0", - "@rollup/rollup-win32-ia32-msvc": "4.41.0", - "@rollup/rollup-win32-x64-msvc": "4.41.0", + "@rollup/rollup-android-arm-eabi": "4.44.0", + "@rollup/rollup-android-arm64": "4.44.0", + "@rollup/rollup-darwin-arm64": "4.44.0", + "@rollup/rollup-darwin-x64": "4.44.0", + "@rollup/rollup-freebsd-arm64": "4.44.0", + "@rollup/rollup-freebsd-x64": "4.44.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.44.0", + "@rollup/rollup-linux-arm-musleabihf": "4.44.0", + "@rollup/rollup-linux-arm64-gnu": "4.44.0", + "@rollup/rollup-linux-arm64-musl": "4.44.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.44.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.44.0", + "@rollup/rollup-linux-riscv64-gnu": "4.44.0", + "@rollup/rollup-linux-riscv64-musl": "4.44.0", + "@rollup/rollup-linux-s390x-gnu": "4.44.0", + "@rollup/rollup-linux-x64-gnu": "4.44.0", + "@rollup/rollup-linux-x64-musl": "4.44.0", + "@rollup/rollup-win32-arm64-msvc": "4.44.0", + "@rollup/rollup-win32-ia32-msvc": "4.44.0", + "@rollup/rollup-win32-x64-msvc": "4.44.0", "fsevents": "~2.3.2" } }, @@ -10784,9 +10531,9 @@ "license": "MIT" }, "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, "license": "MIT", "engines": { @@ -10873,63 +10620,6 @@ } } }, - "node_modules/storybook/node_modules/@vitest/expect": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.9.tgz", - "integrity": "sha512-5eCqRItYgIML7NNVgJj6TVCmdzE7ZVgJhruW0ziSQV4V7PvLkDL1bBkBdcTs/VuIz0IxPb5da1IDSqc1TR9eig==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "3.0.9", - "@vitest/utils": "3.0.9", - "chai": "^5.2.0", - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/storybook/node_modules/@vitest/pretty-format": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.9.tgz", - "integrity": "sha512-OW9F8t2J3AwFEwENg3yMyKWweF7oRJlMyHOMIhO5F3n0+cgQAJZBjNgrF8dLwFTEXl5jUqBLXd9QyyKv8zEcmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/storybook/node_modules/@vitest/spy": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.9.tgz", - "integrity": "sha512-/CcK2UDl0aQ2wtkp3YVWldrpLRNCfVcIOFGlVGKO4R5eajsH393Z1yiXLVQ7vWsj26JOEjeZI0x5sm5P4OGUNQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyspy": "^3.0.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/storybook/node_modules/@vitest/utils": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.9.tgz", - "integrity": "sha512-ilHM5fHhZ89MCp5aAaM9uhfl1c2JdxVxl3McqsdVyVNN6JffnEen8UMCdRTzOhGXNQGo5GNL9QugHrz727Wnng==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "3.0.9", - "loupe": "^3.1.3", - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, "node_modules/strict-event-emitter": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", @@ -11357,9 +11047,9 @@ } }, "node_modules/tinypool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.0.tgz", - "integrity": "sha512-7CotroY9a8DKsKprEy/a14aCCm8jYVmR7aFy4fpkZM8sdpNJbKkixuNjgM50yCmip2ezc8z4N7k3oe2+rfRJCQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", "dev": true, "license": "MIT", "engines": { @@ -11600,9 +11290,9 @@ } }, "node_modules/ts-node-dev/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -11787,94 +11477,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.32.1.tgz", - "integrity": "sha512-D7el+eaDHAmXvrZBy1zpzSNIRqnCOrkwTgZxTu3MUqRWk8k0q9m9Ho4+vPf7iHtgUfrK/o8IZaEApsxPlHTFCg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/eslint-plugin": "8.32.1", - "@typescript-eslint/parser": "8.32.1", - "@typescript-eslint/utils": "8.32.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.1.tgz", - "integrity": "sha512-6u6Plg9nP/J1GRpe/vcjjabo6Uc5YQPAMxsgQyGC/I0RuukiG1wIe3+Vtg3IrSCVJDmqK3j8adrtzXSENRtFgg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.32.1", - "@typescript-eslint/type-utils": "8.32.1", - "@typescript-eslint/utils": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1", - "graphemer": "^1.4.0", - "ignore": "^7.0.0", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz", - "integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/scope-manager": "8.32.1", - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/typescript-estree": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/type-utils": { - "version": "8.32.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.1.tgz", - "integrity": "sha512-mv9YpQGA8iIsl5KyUPi+FGLm7+bA4fgXaeRcFKRDRwDMu4iwrSHeDPipwueNXhdIIZltwCJv+NkxftECbIZWfA==", + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.34.1.tgz", + "integrity": "sha512-XjS+b6Vg9oT1BaIUfkW3M3LvqZE++rbzAMEHuccCfO/YkP43ha6w3jTEMilQxMF92nVOYCcdjv1ZUhAa1D/0ow==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.32.1", - "@typescript-eslint/utils": "8.32.1", - "debug": "^4.3.4", - "ts-api-utils": "^2.1.0" + "@typescript-eslint/eslint-plugin": "8.34.1", + "@typescript-eslint/parser": "8.34.1", + "@typescript-eslint/utils": "8.34.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -12360,6 +11971,77 @@ } } }, + "node_modules/vitest/node_modules/@vitest/expect": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.3.tgz", + "integrity": "sha512-W2RH2TPWVHA1o7UmaFKISPvdicFJH+mjykctJFoAkUw+SPTJTGjUNdKscFBrqM7IPnCVu6zihtKYa7TkZS1dkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.3", + "@vitest/utils": "3.2.3", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest/node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest/node_modules/@vitest/spy": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.3.tgz", + "integrity": "sha512-JHu9Wl+7bf6FEejTCREy+DmgWe+rQKbK+y32C/k5f4TBIAlijhJbRBIRIOCEpVevgRsCQR2iHRUH2/qKVM/plw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest/node_modules/@vitest/utils": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.3.tgz", + "integrity": "sha512-4zFBCU5Pf+4Z6v+rwnZ1HU1yzOKKvDkMXZrymE2PBlbjKJRlrOxbvpfPSvJTGRIwGoahaOGvp+kbCoxifhzJ1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.3", + "loupe": "^3.1.3", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest/node_modules/@vitest/utils/node_modules/@vitest/pretty-format": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.3.tgz", + "integrity": "sha512-yFglXGkr9hW/yEXngO+IKMhP0jxyFw2/qys/CK4fFUZnSltD+MU7dVYGrH8rvPcK/O6feXQA+EU33gjaBBbAng==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/vitest/node_modules/picomatch": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", @@ -12373,6 +12055,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/vitest/node_modules/tinyspy": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.3.tgz", + "integrity": "sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/void-elements": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", @@ -12464,9 +12156,9 @@ } }, "node_modules/vue-docgen-api/node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -12513,9 +12205,9 @@ } }, "node_modules/vue-eslint-parser/node_modules/eslint-scope": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", - "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -12530,9 +12222,9 @@ } }, "node_modules/vue-eslint-parser/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -12543,15 +12235,15 @@ } }, "node_modules/vue-eslint-parser/node_modules/espree": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.14.0", + "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.0" + "eslint-visitor-keys": "^4.2.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/spring-boot-admin-server-ui/pom.xml b/spring-boot-admin-server-ui/pom.xml index 3c051f901ca..532464ceba8 100644 --- a/spring-boot-admin-server-ui/pom.xml +++ b/spring-boot-admin-server-ui/pom.xml @@ -67,6 +67,19 @@ spring-boot-starter-security test + + io.projectreactor + reactor-test + 3.7.6 + test + + + org.junit.platform + junit-platform-launcher + 1.12.1 + test + + diff --git a/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js b/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js index 760cdeb57b3..de7bc0f292d 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js +++ b/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js @@ -5,45 +5,44 @@ * Mock Service Worker. * @see https://github.com/mswjs/msw * - Please do NOT modify this file. - * - Please do NOT serve this file on production. */ -const PACKAGE_VERSION = '2.7.3'; -const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'; -const IS_MOCKED_RESPONSE = Symbol('isMockedResponse'); -const activeClientIds = new Set(); +const PACKAGE_VERSION = '2.10.2' +const INTEGRITY_CHECKSUM = 'f5825c521429caf22a4dd13b66e243af' +const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') +const activeClientIds = new Set() -self.addEventListener('install', function () { - self.skipWaiting(); -}); +addEventListener('install', function () { + self.skipWaiting() +}) -self.addEventListener('activate', function (event) { - event.waitUntil(self.clients.claim()); -}); +addEventListener('activate', function (event) { + event.waitUntil(self.clients.claim()) +}) -self.addEventListener('message', async function (event) { - const clientId = event.source.id; +addEventListener('message', async function (event) { + const clientId = Reflect.get(event.source || {}, 'id') if (!clientId || !self.clients) { - return; + return } - const client = await self.clients.get(clientId); + const client = await self.clients.get(clientId) if (!client) { - return; + return } const allClients = await self.clients.matchAll({ type: 'window', - }); + }) switch (event.data) { case 'KEEPALIVE_REQUEST': { sendToClient(client, { type: 'KEEPALIVE_RESPONSE', - }); - break; + }) + break } case 'INTEGRITY_CHECK_REQUEST': { @@ -53,12 +52,12 @@ self.addEventListener('message', async function (event) { packageVersion: PACKAGE_VERSION, checksum: INTEGRITY_CHECKSUM, }, - }); - break; + }) + break } case 'MOCK_ACTIVATE': { - activeClientIds.add(clientId); + activeClientIds.add(clientId) sendToClient(client, { type: 'MOCKING_ENABLED', @@ -68,157 +67,176 @@ self.addEventListener('message', async function (event) { frameType: client.frameType, }, }, - }); - break; + }) + break } case 'MOCK_DEACTIVATE': { - activeClientIds.delete(clientId); - break; + activeClientIds.delete(clientId) + break } case 'CLIENT_CLOSED': { - activeClientIds.delete(clientId); + activeClientIds.delete(clientId) const remainingClients = allClients.filter((client) => { - return client.id !== clientId; - }); + return client.id !== clientId + }) // Unregister itself when there are no more clients if (remainingClients.length === 0) { - self.registration.unregister(); + self.registration.unregister() } - break; + break } } -}); - -self.addEventListener('fetch', function (event) { - const { request } = event; +}) +addEventListener('fetch', function (event) { // Bypass navigation requests. - if (request.mode === 'navigate') { - return; + if (event.request.mode === 'navigate') { + return } // Opening the DevTools triggers the "only-if-cached" request // that cannot be handled by the worker. Bypass such requests. - if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { - return; + if ( + event.request.cache === 'only-if-cached' && + event.request.mode !== 'same-origin' + ) { + return } // Bypass all requests when there are no active clients. // Prevents the self-unregistered worked from handling requests // after it's been deleted (still remains active until the next reload). if (activeClientIds.size === 0) { - return; + return } - // Generate unique request ID. - const requestId = crypto.randomUUID(); - event.respondWith(handleRequest(event, requestId)); -}); + const requestId = crypto.randomUUID() + event.respondWith(handleRequest(event, requestId)) +}) +/** + * @param {FetchEvent} event + * @param {string} requestId + */ async function handleRequest(event, requestId) { - const client = await resolveMainClient(event); - const response = await getResponse(event, client, requestId); + const client = await resolveMainClient(event) + const requestCloneForEvents = event.request.clone() + const response = await getResponse(event, client, requestId) // Send back the response clone for the "response:*" life-cycle events. // Ensure MSW is active and ready to handle the message, otherwise // this message will pend indefinitely. if (client && activeClientIds.has(client.id)) { - (async function () { - const responseClone = response.clone(); - - sendToClient( - client, - { - type: 'RESPONSE', - payload: { - requestId, - isMockedResponse: IS_MOCKED_RESPONSE in response, + const serializedRequest = await serializeRequest(requestCloneForEvents) + + // Clone the response so both the client and the library could consume it. + const responseClone = response.clone() + + sendToClient( + client, + { + type: 'RESPONSE', + payload: { + isMockedResponse: IS_MOCKED_RESPONSE in response, + request: { + id: requestId, + ...serializedRequest, + }, + response: { type: responseClone.type, status: responseClone.status, statusText: responseClone.statusText, - body: responseClone.body, headers: Object.fromEntries(responseClone.headers.entries()), + body: responseClone.body, }, }, - [responseClone.body], - ); - })(); + }, + responseClone.body ? [serializedRequest.body, responseClone.body] : [], + ) } - return response; + return response } -// Resolve the main client for the given event. -// Client that issues a request doesn't necessarily equal the client -// that registered the worker. It's with the latter the worker should -// communicate with during the response resolving phase. +/** + * Resolve the main client for the given event. + * Client that issues a request doesn't necessarily equal the client + * that registered the worker. It's with the latter the worker should + * communicate with during the response resolving phase. + * @param {FetchEvent} event + * @returns {Promise} + */ async function resolveMainClient(event) { - const client = await self.clients.get(event.clientId); + const client = await self.clients.get(event.clientId) if (activeClientIds.has(event.clientId)) { - return client; + return client } if (client?.frameType === 'top-level') { - return client; + return client } const allClients = await self.clients.matchAll({ type: 'window', - }); + }) return allClients .filter((client) => { // Get only those clients that are currently visible. - return client.visibilityState === 'visible'; + return client.visibilityState === 'visible' }) .find((client) => { // Find the client ID that's recorded in the // set of clients that have registered the worker. - return activeClientIds.has(client.id); - }); + return activeClientIds.has(client.id) + }) } +/** + * @param {FetchEvent} event + * @param {Client | undefined} client + * @param {string} requestId + * @returns {Promise} + */ async function getResponse(event, client, requestId) { - const { request } = event; - // Clone the request because it might've been already used // (i.e. its body has been read and sent to the client). - const requestClone = request.clone(); + const requestClone = event.request.clone() function passthrough() { // Cast the request headers to a new Headers instance // so the headers can be manipulated with. - const headers = new Headers(requestClone.headers); + const headers = new Headers(requestClone.headers) // Remove the "accept" header value that marked this request as passthrough. // This prevents request alteration and also keeps it compliant with the // user-defined CORS policies. - const acceptHeader = headers.get('accept'); + const acceptHeader = headers.get('accept') if (acceptHeader) { - const values = acceptHeader.split(',').map((value) => value.trim()); + const values = acceptHeader.split(',').map((value) => value.trim()) const filteredValues = values.filter( (value) => value !== 'msw/passthrough', - ); + ) if (filteredValues.length > 0) { - headers.set('accept', filteredValues.join(', ')); + headers.set('accept', filteredValues.join(', ')) } else { - headers.delete('accept'); + headers.delete('accept') } } - return fetch(requestClone, { headers }); + return fetch(requestClone, { headers }) } // Bypass mocking when the client is not active. if (!client) { - return passthrough(); + return passthrough() } // Bypass initial page load requests (i.e. static assets). @@ -226,82 +244,101 @@ async function getResponse(event, client, requestId) { // means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet // and is not ready to handle requests. if (!activeClientIds.has(client.id)) { - return passthrough(); + return passthrough() } // Notify the client that a request has been intercepted. - const requestBuffer = await request.arrayBuffer(); + const serializedRequest = await serializeRequest(event.request) const clientMessage = await sendToClient( client, { type: 'REQUEST', payload: { id: requestId, - url: request.url, - mode: request.mode, - method: request.method, - headers: Object.fromEntries(request.headers.entries()), - cache: request.cache, - credentials: request.credentials, - destination: request.destination, - integrity: request.integrity, - redirect: request.redirect, - referrer: request.referrer, - referrerPolicy: request.referrerPolicy, - body: requestBuffer, - keepalive: request.keepalive, + ...serializedRequest, }, }, - [requestBuffer], - ); + [serializedRequest.body], + ) switch (clientMessage.type) { case 'MOCK_RESPONSE': { - return respondWithMock(clientMessage.data); + return respondWithMock(clientMessage.data) } case 'PASSTHROUGH': { - return passthrough(); + return passthrough() } } - return passthrough(); + return passthrough() } +/** + * @param {Client} client + * @param {any} message + * @param {Array} transferrables + * @returns {Promise} + */ function sendToClient(client, message, transferrables = []) { return new Promise((resolve, reject) => { - const channel = new MessageChannel(); + const channel = new MessageChannel() channel.port1.onmessage = (event) => { if (event.data && event.data.error) { - return reject(event.data.error); + return reject(event.data.error) } - resolve(event.data); - }; + resolve(event.data) + } - client.postMessage( - message, - [channel.port2].concat(transferrables.filter(Boolean)), - ); - }); + client.postMessage(message, [ + channel.port2, + ...transferrables.filter(Boolean), + ]) + }) } -async function respondWithMock(response) { +/** + * @param {Response} response + * @returns {Response} + */ +function respondWithMock(response) { // Setting response status code to 0 is a no-op. // However, when responding with a "Response.error()", the produced Response // instance will have status code set to 0. Since it's not possible to create // a Response instance with status code 0, handle that use-case separately. if (response.status === 0) { - return Response.error(); + return Response.error() } - const mockedResponse = new Response(response.body, response); + const mockedResponse = new Response(response.body, response) Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, { value: true, enumerable: true, - }); + }) + + return mockedResponse +} - return mockedResponse; +/** + * @param {Request} request + */ +async function serializeRequest(request) { + return { + url: request.url, + mode: request.mode, + method: request.method, + headers: Object.fromEntries(request.headers.entries()), + cache: request.cache, + credentials: request.credentials, + destination: request.destination, + integrity: request.integrity, + redirect: request.redirect, + referrer: request.referrer, + referrerPolicy: request.referrerPolicy, + body: await request.arrayBuffer(), + keepalive: request.keepalive, + } } diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfigurationDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfigurationDiffblueTest.java new file mode 100644 index 00000000000..bd4ef5d8cd5 --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfigurationDiffblueTest.java @@ -0,0 +1,748 @@ +package de.codecentric.boot.admin.server.ui.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.config.AdminServerProperties; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.ReactiveUiConfiguration; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.ReactiveUiConfiguration.AdminUiWebfluxConfig; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.ServletUiConfiguration; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration.ServletUiConfiguration.AdminUiWebMvcConfig; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.Cache; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.Palette; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.PollTimer; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.UiTheme; +import de.codecentric.boot.admin.server.ui.extensions.UiExtensions; +import de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig; +import de.codecentric.boot.admin.server.ui.web.UiController; +import de.codecentric.boot.admin.server.ui.web.UiController.Settings; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties; +import org.springframework.boot.io.ApplicationResourceLoader; +import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.http.CacheControl; +import org.springframework.mock.web.MockServletContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.web.reactive.config.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; +import org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver; +import org.thymeleaf.templatemode.TemplateMode; + +@ContextConfiguration(classes = { AdminUiWebMvcConfig.class, AdminServerUiProperties.class, AdminServerProperties.class, + AdminUiWebfluxConfig.class, WebFluxProperties.class, AdminServerUiAutoConfiguration.class }) +@ExtendWith(SpringExtension.class) +class AdminServerUiAutoConfigurationDiffblueTest { + + @Autowired + private AdminServerProperties adminServerProperties; + + @Autowired + private AdminServerUiProperties adminServerUiProperties; + + @Autowired + private AdminUiWebMvcConfig adminUiWebMvcConfig; + + @Autowired + private AdminUiWebfluxConfig adminUiWebfluxConfig; + + @Autowired + private ApplicationContext applicationContext; + + @Autowired + private WebFluxProperties webFluxProperties; + + /** + * Test {@link AdminServerUiAutoConfiguration#homeUiController(UiExtensions)}. + *

    + *
  • Given {@code Object}.
  • + *
  • Then return UiSettings Brand is {@code Brand}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerUiAutoConfiguration#homeUiController(UiExtensions)} + */ + @Test + @DisplayName("Test homeUiController(UiExtensions); given 'java.lang.Object'; then return UiSettings Brand is 'Brand'") + @Tag("MaintainedByDiffblue") + void testHomeUiController_givenJavaLangObject_thenReturnUiSettingsBrandIsBrand() throws IOException { + // Arrange + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + + AdminServerUiProperties adminUi = new AdminServerUiProperties(); + adminUi.setAdditionalRouteExcludes(new ArrayList<>()); + adminUi.setAvailableLanguages(new ArrayList<>()); + adminUi.setBrand("Brand"); + adminUi.setCache(new Cache()); + adminUi.setCacheTemplates(true); + adminUi.setEnableToasts(true); + adminUi.setExtensionResourceLocations(new String[] { "Extension Resource Locations" }); + adminUi.setExternalViews(new ArrayList<>()); + adminUi.setFavicon("Favicon"); + adminUi.setFaviconDanger("Favicon Danger"); + adminUi.setHideInstanceUrl(true); + adminUi.setLoginIcon("Login Icon"); + adminUi.setPollTimer(pollTimer); + adminUi.setPublicUrl("https://example.org/example"); + adminUi.setRememberMeEnabled(true); + adminUi.setResourceLocations(new String[] { "Resource Locations" }); + adminUi.setTemplateLocation("Template Location"); + adminUi.setTheme(theme); + adminUi.setTitle("Dr"); + adminUi.setViewSettings(new ArrayList<>()); + AdminServerProperties serverProperties = new AdminServerProperties(); + Class forNameResult = Object.class; + + // Act + UiController actualHomeUiControllerResult = new AdminServerUiAutoConfiguration(adminUi, serverProperties, + new AnnotationConfigApplicationContext(forNameResult)) + .homeUiController(UiExtensions.EMPTY); + + // Assert + Settings uiSettings = actualHomeUiControllerResult.getUiSettings(); + assertEquals("Brand", uiSettings.getBrand()); + assertEquals("Dr", uiSettings.getTitle()); + assertEquals("Favicon Danger", uiSettings.getFaviconDanger()); + assertEquals("Favicon", uiSettings.getFavicon()); + assertEquals("Login Icon", uiSettings.getLoginIcon()); + assertEquals("index", actualHomeUiControllerResult.index()); + assertEquals("login", actualHomeUiControllerResult.login()); + assertEquals(6, uiSettings.getRoutes().size()); + assertFalse(uiSettings.isNotificationFilterEnabled()); + assertTrue(uiSettings.getEnableToasts()); + assertTrue(uiSettings.getHideInstanceUrl()); + assertTrue(uiSettings.isRememberMeEnabled()); + assertTrue(actualHomeUiControllerResult.getCssExtensions().isEmpty()); + assertTrue(actualHomeUiControllerResult.getJsExtensions().isEmpty()); + assertTrue(uiSettings.getAvailableLanguages().isEmpty()); + assertTrue(uiSettings.getExternalViews().isEmpty()); + assertTrue(uiSettings.getViewSettings().isEmpty()); + assertSame(pollTimer, uiSettings.getPollTimer()); + assertSame(theme, uiSettings.getTheme()); + } + + /** + * Test {@link AdminServerUiAutoConfiguration#adminTemplateResolver()}. + *

+ * Method under test: {@link AdminServerUiAutoConfiguration#adminTemplateResolver()} + */ + @Test + @DisplayName("Test adminTemplateResolver()") + @Tag("MaintainedByDiffblue") + void testAdminTemplateResolver() { + // Arrange + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + + AdminServerUiProperties adminUi = new AdminServerUiProperties(); + adminUi.setAdditionalRouteExcludes(new ArrayList<>()); + adminUi.setAvailableLanguages(new ArrayList<>()); + adminUi.setBrand("Brand"); + adminUi.setCache(new Cache()); + adminUi.setCacheTemplates(true); + adminUi.setEnableToasts(true); + adminUi.setExtensionResourceLocations(new String[] { "Extension Resource Locations" }); + adminUi.setExternalViews(new ArrayList<>()); + adminUi.setFavicon("Favicon"); + adminUi.setFaviconDanger("Favicon Danger"); + adminUi.setHideInstanceUrl(true); + adminUi.setLoginIcon("Login Icon"); + adminUi.setPollTimer(pollTimer); + adminUi.setPublicUrl("https://example.org/example"); + adminUi.setRememberMeEnabled(true); + adminUi.setResourceLocations(new String[] { "Resource Locations" }); + adminUi.setTemplateLocation("Template Location"); + adminUi.setTheme(theme); + adminUi.setTitle("Dr"); + adminUi.setViewSettings(new ArrayList<>()); + AdminServerProperties serverProperties = new AdminServerProperties(); + + // Act + SpringResourceTemplateResolver actualAdminTemplateResolverResult = new AdminServerUiAutoConfiguration(adminUi, + serverProperties, new AnnotationConfigReactiveWebApplicationContext()) + .adminTemplateResolver(); + + // Assert + assertEquals(".html", actualAdminTemplateResolverResult.getSuffix()); + assertEquals("Template Location", actualAdminTemplateResolverResult.getPrefix()); + assertEquals("UTF-8", actualAdminTemplateResolverResult.getCharacterEncoding()); + assertEquals("org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver", + actualAdminTemplateResolverResult.getName()); + assertNull(actualAdminTemplateResolverResult.getCacheTTLMs()); + assertEquals(10, actualAdminTemplateResolverResult.getOrder().intValue()); + assertEquals(TemplateMode.HTML, actualAdminTemplateResolverResult.getTemplateMode()); + assertFalse(actualAdminTemplateResolverResult.getForceSuffix()); + assertFalse(actualAdminTemplateResolverResult.getForceTemplateMode()); + assertFalse(actualAdminTemplateResolverResult.getUseDecoupledLogic()); + assertTrue(actualAdminTemplateResolverResult.getTemplateAliases().isEmpty()); + Set cSSTemplateModePatterns = actualAdminTemplateResolverResult.getCSSTemplateModePatterns(); + assertTrue(cSSTemplateModePatterns.isEmpty()); + assertTrue(actualAdminTemplateResolverResult.isCacheable()); + assertTrue(actualAdminTemplateResolverResult.getCheckExistence()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getCacheablePatterns()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getHtmlTemplateModePatterns()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getJavaScriptTemplateModePatterns()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getNonCacheablePatterns()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getRawTemplateModePatterns()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getTextTemplateModePatterns()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getXmlTemplateModePatterns()); + assertSame(cSSTemplateModePatterns, actualAdminTemplateResolverResult.getResolvablePatterns()); + } + + /** + * Test {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)}. + *

    + *
  • Then return {@code /https://example.org/example}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)} + */ + @Test + @DisplayName("Test normalizeHomepageUrl(String); then return '/https://example.org/example'") + @Tag("MaintainedByDiffblue") + void testNormalizeHomepageUrl_thenReturnHttpsExampleOrgExample() { + // Arrange, Act and Assert + assertEquals("/https://example.org/example", + AdminServerUiAutoConfiguration.normalizeHomepageUrl("https://example.org/example")); + } + + /** + * Test {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)} + */ + @Test + @DisplayName("Test normalizeHomepageUrl(String); when 'null'; then return 'null'") + @Tag("MaintainedByDiffblue") + void testNormalizeHomepageUrl_whenNull_thenReturnNull() { + // Arrange, Act and Assert + assertNull(AdminServerUiAutoConfiguration.normalizeHomepageUrl(null)); + } + + /** + * Test {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)}. + *

    + *
  • When {@code ///}.
  • + *
  • Then return {@code /}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)} + */ + @Test + @DisplayName("Test normalizeHomepageUrl(String); when '///'; then return '/'") + @Tag("MaintainedByDiffblue") + void testNormalizeHomepageUrl_whenSlashSlashSlash_thenReturnSlash() { + // Arrange, Act and Assert + assertEquals("/", AdminServerUiAutoConfiguration.normalizeHomepageUrl("///")); + } + + /** + * Test {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)}. + *

    + *
  • When {@code //}.
  • + *
  • Then return {@code /}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)} + */ + @Test + @DisplayName("Test normalizeHomepageUrl(String); when '//'; then return '/'") + @Tag("MaintainedByDiffblue") + void testNormalizeHomepageUrl_whenSlashSlash_thenReturnSlash() { + // Arrange, Act and Assert + assertEquals("/", AdminServerUiAutoConfiguration.normalizeHomepageUrl("//")); + } + + /** + * Test {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)}. + *

    + *
  • When {@code /}.
  • + *
  • Then return {@code /}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerUiAutoConfiguration#normalizeHomepageUrl(String)} + */ + @Test + @DisplayName("Test normalizeHomepageUrl(String); when '/'; then return '/'") + @Tag("MaintainedByDiffblue") + void testNormalizeHomepageUrl_whenSlash_thenReturnSlash() { + // Arrange, Act and Assert + assertEquals("/", AdminServerUiAutoConfiguration.normalizeHomepageUrl("/")); + } + + /** + * Test ReactiveUiConfiguration_AdminUiWebfluxConfig + * {@link AdminUiWebfluxConfig#addResourceHandlers(ResourceHandlerRegistry)}. + *

+ * Method under test: + * {@link AdminUiWebfluxConfig#addResourceHandlers(ResourceHandlerRegistry)} + */ + @Test + @DisplayName("Test ReactiveUiConfiguration_AdminUiWebfluxConfig addResourceHandlers(ResourceHandlerRegistry)") + @Tag("MaintainedByDiffblue") + void testReactiveUiConfiguration_AdminUiWebfluxConfigAddResourceHandlers() { + // Arrange + Cache cache = mock(Cache.class); + when(cache.toCacheControl()).thenReturn(CacheControl.empty()); + + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + + AdminServerUiProperties adminUi = new AdminServerUiProperties(); + adminUi.setAdditionalRouteExcludes(new ArrayList<>()); + adminUi.setAvailableLanguages(new ArrayList<>()); + adminUi.setBrand("Brand"); + adminUi.setCache(cache); + adminUi.setCacheTemplates(true); + adminUi.setEnableToasts(true); + adminUi.setExtensionResourceLocations(new String[] { "Extension Resource Locations" }); + adminUi.setExternalViews(new ArrayList<>()); + adminUi.setFavicon("Favicon"); + adminUi.setFaviconDanger("Favicon Danger"); + adminUi.setHideInstanceUrl(true); + adminUi.setLoginIcon("Login Icon"); + adminUi.setPollTimer(pollTimer); + adminUi.setPublicUrl("https://example.org/example"); + adminUi.setRememberMeEnabled(true); + adminUi.setResourceLocations(new String[] { "Resource Locations" }); + adminUi.setTemplateLocation("Template Location"); + adminUi.setTheme(theme); + adminUi.setTitle("Dr"); + adminUi.setViewSettings(new ArrayList<>()); + + WebFluxProperties webFluxProperties = new WebFluxProperties(); + webFluxProperties.setBasePath("Base Path"); + webFluxProperties.setStaticPathPattern("Static Path Pattern"); + webFluxProperties.setWebjarsPathPattern("Webjars Path Pattern"); + AdminServerProperties adminServer = new AdminServerProperties(); + AdminUiWebfluxConfig adminUiWebfluxConfig = new AdminUiWebfluxConfig(adminUi, adminServer, webFluxProperties, + new AnnotationConfigReactiveWebApplicationContext()); + + // Act + adminUiWebfluxConfig.addResourceHandlers(new ResourceHandlerRegistry(new ApplicationResourceLoader())); + + // Assert + verify(cache, atLeast(1)).toCacheControl(); + } + + /** + * Test ReactiveUiConfiguration_AdminUiWebfluxConfig + * {@link AdminUiWebfluxConfig#homepageForwardingFilterConfig()}. + *

+ * Method under test: {@link AdminUiWebfluxConfig#homepageForwardingFilterConfig()} + */ + @Test + @DisplayName("Test ReactiveUiConfiguration_AdminUiWebfluxConfig homepageForwardingFilterConfig()") + @Tag("MaintainedByDiffblue") + void testReactiveUiConfiguration_AdminUiWebfluxConfigHomepageForwardingFilterConfig() throws IOException { + // Arrange and Act + HomepageForwardingFilterConfig actualHomepageForwardingFilterConfigResult = adminUiWebfluxConfig + .homepageForwardingFilterConfig(); + + // Assert + List routesIncludes = actualHomepageForwardingFilterConfigResult.getRoutesIncludes(); + assertEquals(7, routesIncludes.size()); + assertEquals("", routesIncludes.get(6)); + assertEquals("/", actualHomepageForwardingFilterConfigResult.getHomepage()); + assertEquals("/about/**", routesIncludes.get(0)); + assertEquals("/applications/**", routesIncludes.get(1)); + List routesExcludes = actualHomepageForwardingFilterConfigResult.getRoutesExcludes(); + assertEquals(2, routesExcludes.size()); + assertEquals("/extensions/**", routesExcludes.get(0)); + assertEquals("/external/**", routesIncludes.get(5)); + assertEquals("/instances/**", routesIncludes.get(2)); + assertEquals("/instances/*/actuator/**", routesExcludes.get(1)); + assertEquals("/wallboard/**", routesIncludes.get(4)); + } + + /** + * Test ReactiveUiConfiguration_AdminUiWebfluxConfig + * {@link AdminUiWebfluxConfig#homepageForwardingFilterConfig()}. + *

+ * Method under test: {@link AdminUiWebfluxConfig#homepageForwardingFilterConfig()} + */ + @Test + @DisplayName("Test ReactiveUiConfiguration_AdminUiWebfluxConfig homepageForwardingFilterConfig()") + @Tag("MaintainedByDiffblue") + void testReactiveUiConfiguration_AdminUiWebfluxConfigHomepageForwardingFilterConfig2() throws IOException { + // Arrange + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + + AdminServerUiProperties adminUi = new AdminServerUiProperties(); + adminUi.setAdditionalRouteExcludes(new ArrayList<>()); + adminUi.setAvailableLanguages(new ArrayList<>()); + adminUi.setBrand("Brand"); + adminUi.setCache(new Cache()); + adminUi.setCacheTemplates(true); + adminUi.setEnableToasts(true); + adminUi.setExtensionResourceLocations(new String[] { "classpath:" }); + adminUi.setExternalViews(new ArrayList<>()); + adminUi.setFavicon("Favicon"); + adminUi.setFaviconDanger("Favicon Danger"); + adminUi.setHideInstanceUrl(true); + adminUi.setLoginIcon("Login Icon"); + adminUi.setPollTimer(pollTimer); + adminUi.setPublicUrl("https://example.org/example"); + adminUi.setRememberMeEnabled(true); + adminUi.setResourceLocations(new String[] { "Resource Locations" }); + adminUi.setTemplateLocation("Template Location"); + adminUi.setTheme(theme); + adminUi.setTitle("Dr"); + adminUi.setViewSettings(new ArrayList<>()); + + WebFluxProperties webFluxProperties = new WebFluxProperties(); + webFluxProperties.setBasePath("Base Path"); + webFluxProperties.setStaticPathPattern("Static Path Pattern"); + webFluxProperties.setWebjarsPathPattern("Webjars Path Pattern"); + AdminServerProperties adminServer = new AdminServerProperties(); + + // Act + HomepageForwardingFilterConfig actualHomepageForwardingFilterConfigResult = new AdminUiWebfluxConfig(adminUi, + adminServer, webFluxProperties, new AnnotationConfigReactiveWebApplicationContext()) + .homepageForwardingFilterConfig(); + + // Assert + assertEquals("/Base Path", actualHomepageForwardingFilterConfigResult.getHomepage()); + List routesIncludes = actualHomepageForwardingFilterConfigResult.getRoutesIncludes(); + assertEquals(8, routesIncludes.size()); + assertEquals("/Base Path/about/**", routesIncludes.get(0)); + assertEquals("/Base Path/applications/**", routesIncludes.get(1)); + assertEquals("/Base Path/custom/**", routesIncludes.get(6)); + List routesExcludes = actualHomepageForwardingFilterConfigResult.getRoutesExcludes(); + assertEquals(2, routesExcludes.size()); + assertEquals("/Base Path/extensions/**", routesExcludes.get(0)); + assertEquals("/Base Path/external/**", routesIncludes.get(5)); + assertEquals("/Base Path/instances/**", routesIncludes.get(2)); + assertEquals("/Base Path/instances/*/actuator/**", routesExcludes.get(1)); + } + + /** + * Test ServletUiConfiguration_AdminUiWebMvcConfig + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#addResourceHandlers(ResourceHandlerRegistry)}. + *

+ * Method under test: + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry)} + */ + @Test + @DisplayName("Test ServletUiConfiguration_AdminUiWebMvcConfig addResourceHandlers(ResourceHandlerRegistry)") + @Tag("MaintainedByDiffblue") + void testServletUiConfiguration_AdminUiWebMvcConfigAddResourceHandlers() { + // Arrange + Cache cache = mock(Cache.class); + when(cache.toCacheControl()).thenReturn(CacheControl.empty()); + + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + + AdminServerUiProperties adminUi = new AdminServerUiProperties(); + adminUi.setAdditionalRouteExcludes(new ArrayList<>()); + adminUi.setAvailableLanguages(new ArrayList<>()); + adminUi.setBrand("Brand"); + adminUi.setCache(cache); + adminUi.setCacheTemplates(true); + adminUi.setEnableToasts(true); + adminUi.setExtensionResourceLocations(new String[] { "Extension Resource Locations" }); + adminUi.setExternalViews(new ArrayList<>()); + adminUi.setFavicon("Favicon"); + adminUi.setFaviconDanger("Favicon Danger"); + adminUi.setHideInstanceUrl(true); + adminUi.setLoginIcon("Login Icon"); + adminUi.setPollTimer(pollTimer); + adminUi.setPublicUrl("https://example.org/example"); + adminUi.setRememberMeEnabled(true); + adminUi.setResourceLocations(new String[] { "Resource Locations" }); + adminUi.setTemplateLocation("Template Location"); + adminUi.setTheme(theme); + adminUi.setTitle("Dr"); + adminUi.setViewSettings(new ArrayList<>()); + AdminServerProperties adminServer = new AdminServerProperties(); + AdminUiWebMvcConfig adminUiWebMvcConfig = new AdminUiWebMvcConfig(adminUi, adminServer, + new AnnotationConfigReactiveWebApplicationContext()); + AnnotationConfigReactiveWebApplicationContext applicationContext = new AnnotationConfigReactiveWebApplicationContext(); + + // Act + adminUiWebMvcConfig.addResourceHandlers( + new org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry(applicationContext, + new MockServletContext())); + + // Assert + verify(cache, atLeast(1)).toCacheControl(); + } + + /** + * Test ServletUiConfiguration_AdminUiWebMvcConfig + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#configurePathMatch(PathMatchConfigurer)}. + *

+ * Method under test: + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#configurePathMatch(PathMatchConfigurer)} + */ + @Test + @DisplayName("Test ServletUiConfiguration_AdminUiWebMvcConfig configurePathMatch(PathMatchConfigurer)") + @Tag("MaintainedByDiffblue") + void testServletUiConfiguration_AdminUiWebMvcConfigConfigurePathMatch() { + // Arrange + PathMatchConfigurer configurer = new PathMatchConfigurer(); + + // Act + adminUiWebMvcConfig.configurePathMatch(configurer); + + // Assert + assertTrue(configurer.isUseTrailingSlashMatch()); + } + + /** + * Test ServletUiConfiguration_AdminUiWebMvcConfig + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#homepageForwardingFilterConfig()}. + *

+ * Method under test: + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#homepageForwardingFilterConfig()} + */ + @Test + @DisplayName("Test ServletUiConfiguration_AdminUiWebMvcConfig homepageForwardingFilterConfig()") + @Tag("MaintainedByDiffblue") + void testServletUiConfiguration_AdminUiWebMvcConfigHomepageForwardingFilterConfig() throws IOException { + // Arrange and Act + HomepageForwardingFilterConfig actualHomepageForwardingFilterConfigResult = adminUiWebMvcConfig + .homepageForwardingFilterConfig(); + + // Assert + assertEquals("/", actualHomepageForwardingFilterConfigResult.getHomepage()); + List routesIncludes = actualHomepageForwardingFilterConfigResult.getRoutesIncludes(); + assertEquals(7, routesIncludes.size()); + assertEquals("/", routesIncludes.get(6)); + assertEquals("/about/**", routesIncludes.get(0)); + assertEquals("/applications/**", routesIncludes.get(1)); + List routesExcludes = actualHomepageForwardingFilterConfigResult.getRoutesExcludes(); + assertEquals(2, routesExcludes.size()); + assertEquals("/extensions/**", routesExcludes.get(0)); + assertEquals("/external/**", routesIncludes.get(5)); + assertEquals("/instances/**", routesIncludes.get(2)); + assertEquals("/instances/*/actuator/**", routesExcludes.get(1)); + assertEquals("/wallboard/**", routesIncludes.get(4)); + } + + /** + * Test ServletUiConfiguration_AdminUiWebMvcConfig + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#homepageForwardingFilterConfig()}. + *

+ * Method under test: + * {@link ServletUiConfiguration.AdminUiWebMvcConfig#homepageForwardingFilterConfig()} + */ + @Test + @DisplayName("Test ServletUiConfiguration_AdminUiWebMvcConfig homepageForwardingFilterConfig()") + @Tag("MaintainedByDiffblue") + void testServletUiConfiguration_AdminUiWebMvcConfigHomepageForwardingFilterConfig2() throws IOException { + // Arrange + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + + AdminServerUiProperties adminUi = new AdminServerUiProperties(); + adminUi.setAdditionalRouteExcludes(new ArrayList<>()); + adminUi.setAvailableLanguages(new ArrayList<>()); + adminUi.setBrand("Brand"); + adminUi.setCache(new Cache()); + adminUi.setCacheTemplates(true); + adminUi.setEnableToasts(true); + adminUi.setExtensionResourceLocations(new String[] { "classpath:" }); + adminUi.setExternalViews(new ArrayList<>()); + adminUi.setFavicon("Favicon"); + adminUi.setFaviconDanger("Favicon Danger"); + adminUi.setHideInstanceUrl(true); + adminUi.setLoginIcon("Login Icon"); + adminUi.setPollTimer(pollTimer); + adminUi.setPublicUrl("https://example.org/example"); + adminUi.setRememberMeEnabled(true); + adminUi.setResourceLocations(new String[] { "Resource Locations" }); + adminUi.setTemplateLocation("Template Location"); + adminUi.setTheme(theme); + adminUi.setTitle("Dr"); + adminUi.setViewSettings(new ArrayList<>()); + AdminServerProperties adminServer = new AdminServerProperties(); + + // Act + HomepageForwardingFilterConfig actualHomepageForwardingFilterConfigResult = new AdminUiWebMvcConfig(adminUi, + adminServer, new AnnotationConfigReactiveWebApplicationContext()) + .homepageForwardingFilterConfig(); + + // Assert + assertEquals("/", actualHomepageForwardingFilterConfigResult.getHomepage()); + List routesIncludes = actualHomepageForwardingFilterConfigResult.getRoutesIncludes(); + assertEquals(8, routesIncludes.size()); + assertEquals("/", routesIncludes.get(7)); + assertEquals("/about/**", routesIncludes.get(0)); + assertEquals("/applications/**", routesIncludes.get(1)); + assertEquals("/custom/**", routesIncludes.get(6)); + List routesExcludes = actualHomepageForwardingFilterConfigResult.getRoutesExcludes(); + assertEquals(2, routesExcludes.size()); + assertEquals("/extensions/**", routesExcludes.get(0)); + assertEquals("/external/**", routesIncludes.get(5)); + assertEquals("/instances/**", routesIncludes.get(2)); + assertEquals("/instances/*/actuator/**", routesExcludes.get(1)); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiPropertiesDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiPropertiesDiffblueTest.java new file mode 100644 index 00000000000..b1fd66e7383 --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiPropertiesDiffblueTest.java @@ -0,0 +1,141 @@ +package de.codecentric.boot.admin.server.ui.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.Cache; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.Palette; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +class AdminServerUiPropertiesDiffblueTest { + + /** + * Test Cache {@link Cache#toCacheControl()}. + *

    + *
  • Given {@link Cache} (default constructor) MaxAge is {@code null}.
  • + *
  • Then return HeaderValue is {@code null}.
  • + *
+ *

+ * Method under test: {@link Cache#toCacheControl()} + */ + @Test + @DisplayName("Test Cache toCacheControl(); given Cache (default constructor) MaxAge is 'null'; then return HeaderValue is 'null'") + @Tag("MaintainedByDiffblue") + void testCacheToCacheControl_givenCacheMaxAgeIsNull_thenReturnHeaderValueIsNull() { + // Arrange + Cache cache = new Cache(); + cache.setMaxAge(null); + + // Act and Assert + assertNull(cache.toCacheControl().getHeaderValue()); + } + + /** + * Test Cache {@link Cache#toCacheControl()}. + *

    + *
  • Given {@link Cache} (default constructor) NoCache is {@code true}.
  • + *
  • Then return HeaderValue is {@code no-cache}.
  • + *
+ *

+ * Method under test: {@link Cache#toCacheControl()} + */ + @Test + @DisplayName("Test Cache toCacheControl(); given Cache (default constructor) NoCache is 'true'; then return HeaderValue is 'no-cache'") + @Tag("MaintainedByDiffblue") + void testCacheToCacheControl_givenCacheNoCacheIsTrue_thenReturnHeaderValueIsNoCache() { + // Arrange + Cache cache = new Cache(); + cache.setNoCache(true); + + // Act and Assert + assertEquals("no-cache", cache.toCacheControl().getHeaderValue()); + } + + /** + * Test Cache {@link Cache#toCacheControl()}. + *

    + *
  • Given {@link Cache} (default constructor) NoStore is {@code true}.
  • + *
  • Then return HeaderValue is {@code no-store}.
  • + *
+ *

+ * Method under test: {@link Cache#toCacheControl()} + */ + @Test + @DisplayName("Test Cache toCacheControl(); given Cache (default constructor) NoStore is 'true'; then return HeaderValue is 'no-store'") + @Tag("MaintainedByDiffblue") + void testCacheToCacheControl_givenCacheNoStoreIsTrue_thenReturnHeaderValueIsNoStore() { + // Arrange + Cache cache = new Cache(); + cache.setNoStore(true); + + // Act and Assert + assertEquals("no-store", cache.toCacheControl().getHeaderValue()); + } + + /** + * Test Cache {@link Cache#toCacheControl()}. + *

    + *
  • Given {@link Cache} (default constructor).
  • + *
  • Then return HeaderValue is {@code max-age=3600}.
  • + *
+ *

+ * Method under test: {@link Cache#toCacheControl()} + */ + @Test + @DisplayName("Test Cache toCacheControl(); given Cache (default constructor); then return HeaderValue is 'max-age=3600'") + @Tag("MaintainedByDiffblue") + void testCacheToCacheControl_givenCache_thenReturnHeaderValueIsMaxAge3600() { + // Arrange, Act and Assert + assertEquals("max-age=3600", new Cache().toCacheControl().getHeaderValue()); + } + + /** + * Test Palette getters and setters. + *

+ * Methods under test: + *

    + *
  • default or parameterless constructor of {@link Palette} + *
  • {@link Palette#set100(String)} + *
  • {@link Palette#set200(String)} + *
  • {@link Palette#set300(String)} + *
  • {@link Palette#set400(String)} + *
  • {@link Palette#set500(String)} + *
  • {@link Palette#set50(String)} + *
  • {@link Palette#set600(String)} + *
  • {@link Palette#set700(String)} + *
  • {@link Palette#set800(String)} + *
  • {@link Palette#set900(String)} + *
+ */ + @Test + @DisplayName("Test Palette getters and setters") + @Tag("MaintainedByDiffblue") + void testPaletteGettersAndSetters() { + // Arrange and Act + Palette actualPalette = new Palette(); + actualPalette.set100("Shade100"); + actualPalette.set200("Shade200"); + actualPalette.set300("Shade300"); + actualPalette.set400("Shade400"); + actualPalette.set500("Shade500"); + actualPalette.set50("Shade50"); + actualPalette.set600("Shade600"); + actualPalette.set700("Shade700"); + actualPalette.set800("Shade800"); + actualPalette.set900("Shade900"); + + // Assert + assertEquals("Shade100", actualPalette.getShade100()); + assertEquals("Shade200", actualPalette.getShade200()); + assertEquals("Shade300", actualPalette.getShade300()); + assertEquals("Shade400", actualPalette.getShade400()); + assertEquals("Shade50", actualPalette.getShade50()); + assertEquals("Shade500", actualPalette.getShade500()); + assertEquals("Shade600", actualPalette.getShade600()); + assertEquals("Shade700", actualPalette.getShade700()); + assertEquals("Shade800", actualPalette.getShade800()); + assertEquals("Shade900", actualPalette.getShade900()); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/CssColorUtilsDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/CssColorUtilsDiffblueTest.java new file mode 100644 index 00000000000..ab5ff8ad89e --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/CssColorUtilsDiffblueTest.java @@ -0,0 +1,54 @@ +package de.codecentric.boot.admin.server.ui.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { CssColorUtils.class }) +@ExtendWith(SpringExtension.class) +class CssColorUtilsDiffblueTest { + + @Autowired + private CssColorUtils cssColorUtils; + + /** + * Test {@link CssColorUtils#hexToRgb(String)}. + *
    + *
  • When {@code #999999}.
  • + *
  • Then return {@code 153, 153, 153}.
  • + *
+ *

+ * Method under test: {@link CssColorUtils#hexToRgb(String)} + */ + @Test + @DisplayName("Test hexToRgb(String); when '#999999'; then return '153, 153, 153'") + @Tag("MaintainedByDiffblue") + void testHexToRgb_when999999_thenReturn153153153() { + // Arrange, Act and Assert + assertEquals("153, 153, 153", cssColorUtils.hexToRgb("#999999")); + } + + /** + * Test {@link CssColorUtils#hexToRgb(String)}. + *

    + *
  • When {@code 0123456789ABCDEF}.
  • + *
  • Then throw {@link IllegalArgumentException}.
  • + *
+ *

+ * Method under test: {@link CssColorUtils#hexToRgb(String)} + */ + @Test + @DisplayName("Test hexToRgb(String); when '0123456789ABCDEF'; then throw IllegalArgumentException") + @Tag("MaintainedByDiffblue") + void testHexToRgb_when0123456789abcdef_thenThrowIllegalArgumentException() { + // Arrange, Act and Assert + assertThrows(IllegalArgumentException.class, () -> cssColorUtils.hexToRgb("0123456789ABCDEF")); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ServerRuntimeHintsDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ServerRuntimeHintsDiffblueTest.java new file mode 100644 index 00000000000..225b0c3d01c --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ServerRuntimeHintsDiffblueTest.java @@ -0,0 +1,52 @@ +package de.codecentric.boot.admin.server.ui.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.management.loading.MLet; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.aot.hint.JavaSerializationHint; +import org.springframework.aot.hint.RuntimeHints; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { ServerRuntimeHints.class }) +@ExtendWith(SpringExtension.class) +class ServerRuntimeHintsDiffblueTest { + + @Autowired + private ServerRuntimeHints serverRuntimeHints; + + /** + * Test {@link ServerRuntimeHints#registerHints(RuntimeHints, ClassLoader)}. + *

+ * Method under test: + * {@link ServerRuntimeHints#registerHints(RuntimeHints, ClassLoader)} + */ + @Test + @DisplayName("Test registerHints(RuntimeHints, ClassLoader)") + @Tag("MaintainedByDiffblue") + void testRegisterHints() { + // Arrange + RuntimeHints hints = new RuntimeHints(); + + // Act + serverRuntimeHints.registerHints(hints, new MLet()); + + // Assert + Stream javaSerializationHintsResult = hints.serialization().javaSerializationHints(); + List collectResult = javaSerializationHintsResult.limit(5).collect(Collectors.toList()); + assertEquals(5, collectResult.size()); + assertNull(collectResult.get(0).getReachableType()); + assertNull(collectResult.get(1).getReachableType()); + assertNull(collectResult.get(3).getReachableType()); + assertNull(collectResult.get(4).getReachableType()); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiExtensionsDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiExtensionsDiffblueTest.java new file mode 100644 index 00000000000..a91a1e35fa1 --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiExtensionsDiffblueTest.java @@ -0,0 +1,257 @@ +package de.codecentric.boot.admin.server.ui.extensions; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ContextConfiguration(classes = { UiExtensions.class }) +@DisabledInAotMode +@ExtendWith(SpringExtension.class) +class UiExtensionsDiffblueTest { + + @Autowired + private List list; + + @MockitoBean + private UiExtension uiExtension; + + @Autowired + private UiExtensions uiExtensions; + + /** + * Test {@link UiExtensions#UiExtensions(List)}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
  • Then return CssExtensions Empty.
  • + *
+ *

+ * Method under test: {@link UiExtensions#UiExtensions(List)} + */ + @Test + @DisplayName("Test new UiExtensions(List); when ArrayList(); then return CssExtensions Empty") + @Tag("MaintainedByDiffblue") + void testNewUiExtensions_whenArrayList_thenReturnCssExtensionsEmpty() { + // Arrange and Act + UiExtensions actualUiExtensions = new UiExtensions(new ArrayList<>()); + + // Assert + assertFalse(actualUiExtensions.iterator().hasNext()); + assertTrue(actualUiExtensions.getCssExtensions().isEmpty()); + assertTrue(actualUiExtensions.getExtensions().isEmpty()); + assertTrue(actualUiExtensions.getJsExtensions().isEmpty()); + } + + /** + * Test {@link UiExtensions#iterator()}. + *

+ * Method under test: {@link UiExtensions#iterator()} + */ + @Test + @DisplayName("Test iterator()") + @Tag("MaintainedByDiffblue") + void testIterator() { + // Arrange, Act and Assert + assertFalse(UiExtensions.EMPTY.iterator().hasNext()); + } + + /** + * Test {@link UiExtensions#getCssExtensions()}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@link UiExtension}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getCssExtensions()} + */ + @Test + @DisplayName("Test getCssExtensions(); given ArrayList() add UiExtension; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetCssExtensions_givenArrayListAddUiExtension_thenReturnEmpty() { + // Arrange + when(uiExtension.getResourcePath()).thenReturn("Resource Path"); + + ArrayList extensions = new ArrayList<>(); + extensions.add(uiExtension); + extensions.add(uiExtension); + + // Act + List actualCssExtensions = new UiExtensions(extensions).getCssExtensions(); + + // Assert + verify(uiExtension, atLeast(1)).getResourcePath(); + assertTrue(actualCssExtensions.isEmpty()); + } + + /** + * Test {@link UiExtensions#getCssExtensions()}. + *

    + *
  • Given {@link UiExtension} {@link UiExtension#getResourcePath()} return + * {@code Resource Path}.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getCssExtensions()} + */ + @Test + @DisplayName("Test getCssExtensions(); given UiExtension getResourcePath() return 'Resource Path'") + @Tag("MaintainedByDiffblue") + void testGetCssExtensions_givenUiExtensionGetResourcePathReturnResourcePath() { + // Arrange + when(uiExtension.getResourcePath()).thenReturn("Resource Path"); + + // Act + List actualCssExtensions = uiExtensions.getCssExtensions(); + + // Assert + verify(uiExtension).getResourcePath(); + assertTrue(actualCssExtensions.isEmpty()); + } + + /** + * Test {@link UiExtensions#getCssExtensions()}. + *

    + *
  • Given {@link UiExtension}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getCssExtensions()} + */ + @Test + @DisplayName("Test getCssExtensions(); given UiExtension; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetCssExtensions_givenUiExtension_thenReturnEmpty() { + // Arrange, Act and Assert + assertTrue(UiExtensions.EMPTY.getCssExtensions().isEmpty()); + } + + /** + * Test {@link UiExtensions#getCssExtensions()}. + *

    + *
  • Then return size is one.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getCssExtensions()} + */ + @Test + @DisplayName("Test getCssExtensions(); then return size is one") + @Tag("MaintainedByDiffblue") + void testGetCssExtensions_thenReturnSizeIsOne() { + // Arrange + when(uiExtension.getResourcePath()).thenReturn(".css"); + + // Act + List actualCssExtensions = uiExtensions.getCssExtensions(); + + // Assert + verify(uiExtension).getResourcePath(); + assertEquals(1, actualCssExtensions.size()); + } + + /** + * Test {@link UiExtensions#getJsExtensions()}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@link UiExtension}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getJsExtensions()} + */ + @Test + @DisplayName("Test getJsExtensions(); given ArrayList() add UiExtension; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetJsExtensions_givenArrayListAddUiExtension_thenReturnEmpty() { + // Arrange + when(uiExtension.getResourcePath()).thenReturn("Resource Path"); + + ArrayList extensions = new ArrayList<>(); + extensions.add(uiExtension); + extensions.add(uiExtension); + + // Act + List actualJsExtensions = new UiExtensions(extensions).getJsExtensions(); + + // Assert + verify(uiExtension, atLeast(1)).getResourcePath(); + assertTrue(actualJsExtensions.isEmpty()); + } + + /** + * Test {@link UiExtensions#getJsExtensions()}. + *

    + *
  • Given {@link UiExtension} {@link UiExtension#getResourcePath()} return + * {@code .js}.
  • + *
  • Then return size is one.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getJsExtensions()} + */ + @Test + @DisplayName("Test getJsExtensions(); given UiExtension getResourcePath() return '.js'; then return size is one") + @Tag("MaintainedByDiffblue") + void testGetJsExtensions_givenUiExtensionGetResourcePathReturnJs_thenReturnSizeIsOne() { + // Arrange + when(uiExtension.getResourcePath()).thenReturn(".js"); + + // Act + List actualJsExtensions = uiExtensions.getJsExtensions(); + + // Assert + verify(uiExtension).getResourcePath(); + assertEquals(1, actualJsExtensions.size()); + } + + /** + * Test {@link UiExtensions#getJsExtensions()}. + *

    + *
  • Given {@link UiExtension} {@link UiExtension#getResourcePath()} return + * {@code Resource Path}.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getJsExtensions()} + */ + @Test + @DisplayName("Test getJsExtensions(); given UiExtension getResourcePath() return 'Resource Path'") + @Tag("MaintainedByDiffblue") + void testGetJsExtensions_givenUiExtensionGetResourcePathReturnResourcePath() { + // Arrange + when(uiExtension.getResourcePath()).thenReturn("Resource Path"); + + // Act + List actualJsExtensions = uiExtensions.getJsExtensions(); + + // Assert + verify(uiExtension).getResourcePath(); + assertTrue(actualJsExtensions.isEmpty()); + } + + /** + * Test {@link UiExtensions#getJsExtensions()}. + *

    + *
  • Given {@link UiExtension}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link UiExtensions#getJsExtensions()} + */ + @Test + @DisplayName("Test getJsExtensions(); given UiExtension; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetJsExtensions_givenUiExtension_thenReturnEmpty() { + // Arrange, Act and Assert + assertTrue(UiExtensions.EMPTY.getJsExtensions().isEmpty()); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiExtensionsScannerDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiExtensionsScannerDiffblueTest.java new file mode 100644 index 00000000000..72d90b5cfc0 --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiExtensionsScannerDiffblueTest.java @@ -0,0 +1,32 @@ +package de.codecentric.boot.admin.server.ui.extensions; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; + +class UiExtensionsScannerDiffblueTest { + + /** + * Test {@link UiExtensionsScanner#scan(String[])}. + *

    + *
  • Then return {@link UiExtensions#EMPTY}.
  • + *
+ *

+ * Method under test: {@link UiExtensionsScanner#scan(String[])} + */ + @Test + @DisplayName("Test scan(String[]); then return EMPTY") + @Tag("MaintainedByDiffblue") + void testScan_thenReturnEmpty() throws IOException { + // Arrange and Act + UiExtensions actualScanResult = new UiExtensionsScanner(new PathMatchingResourcePatternResolver()) + .scan("Locations"); + + // Assert + assertEquals(actualScanResult.EMPTY, actualScanResult); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiRoutesScannerDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiRoutesScannerDiffblueTest.java new file mode 100644 index 00000000000..69d55451ede --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/extensions/UiRoutesScannerDiffblueTest.java @@ -0,0 +1,28 @@ +package de.codecentric.boot.admin.server.ui.extensions; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; + +class UiRoutesScannerDiffblueTest { + + /** + * Test {@link UiRoutesScanner#scan(String[])}. + *

    + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link UiRoutesScanner#scan(String[])} + */ + @Test + @DisplayName("Test scan(String[]); then return Empty") + @Tag("MaintainedByDiffblue") + void testScan_thenReturnEmpty() throws IOException { + // Arrange, Act and Assert + assertTrue(new UiRoutesScanner(new PathMatchingResourcePatternResolver()).scan("Locations").isEmpty()); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/HomepageForwardingMatcherDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/HomepageForwardingMatcherDiffblueTest.java new file mode 100644 index 00000000000..95e760ac155 --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/HomepageForwardingMatcherDiffblueTest.java @@ -0,0 +1,244 @@ +package de.codecentric.boot.admin.server.ui.web; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class HomepageForwardingMatcherDiffblueTest { + + /** + * Test + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)}. + *

    + *
  • Given {@code 42}.
  • + *
  • Then {@link ArrayList#ArrayList()} size is two.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)} + */ + @Test + @DisplayName("Test new HomepageForwardingMatcher(List, List, Function, Function, Function); given '42'; then ArrayList() size is two") + @Tag("MaintainedByDiffblue") + void testNewHomepageForwardingMatcher_given42_thenArrayListSizeIsTwo() { + // Arrange + ArrayList includeRoutes = new ArrayList<>(); + includeRoutes.add("42"); + includeRoutes.add("foo"); + ArrayList excludeRoutes = new ArrayList<>(); + Function methodAccessor = mock(Function.class); + when(methodAccessor.apply(Mockito.any())).thenReturn("Apply"); + + // Act + HomepageForwardingMatcher actualHomepageForwardingMatcher = new HomepageForwardingMatcher<>( + includeRoutes, excludeRoutes, methodAccessor, mock(Function.class), mock(Function.class)); + boolean actualTestResult = actualHomepageForwardingMatcher.test("Request"); + + // Assert + verify(methodAccessor).apply(isA(Object.class)); + assertEquals(2, includeRoutes.size()); + assertEquals("42", includeRoutes.get(0)); + assertEquals("foo", includeRoutes.get(1)); + assertFalse(actualTestResult); + } + + /** + * Test + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)}. + *
    + *
  • Given {@code 42}.
  • + *
  • When {@link ArrayList#ArrayList()} add {@code 42}.
  • + *
  • Then {@link ArrayList#ArrayList()} Empty.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)} + */ + @Test + @DisplayName("Test new HomepageForwardingMatcher(List, List, Function, Function, Function); given '42'; when ArrayList() add '42'; then ArrayList() Empty") + @Tag("MaintainedByDiffblue") + void testNewHomepageForwardingMatcher_given42_whenArrayListAdd42_thenArrayListEmpty() { + // Arrange + ArrayList includeRoutes = new ArrayList<>(); + + ArrayList excludeRoutes = new ArrayList<>(); + excludeRoutes.add("42"); + excludeRoutes.add("foo"); + Function methodAccessor = mock(Function.class); + when(methodAccessor.apply(Mockito.any())).thenReturn("Apply"); + + // Act + HomepageForwardingMatcher actualHomepageForwardingMatcher = new HomepageForwardingMatcher<>( + includeRoutes, excludeRoutes, methodAccessor, mock(Function.class), mock(Function.class)); + boolean actualTestResult = actualHomepageForwardingMatcher.test("Request"); + + // Assert + verify(methodAccessor).apply(isA(Object.class)); + assertFalse(actualTestResult); + assertTrue(includeRoutes.isEmpty()); + } + + /** + * Test + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)}. + *
    + *
  • Given {@code Apply}.
  • + *
  • Then {@link ArrayList#ArrayList()} Empty.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)} + */ + @Test + @DisplayName("Test new HomepageForwardingMatcher(List, List, Function, Function, Function); given 'Apply'; then ArrayList() Empty") + @Tag("MaintainedByDiffblue") + void testNewHomepageForwardingMatcher_givenApply_thenArrayListEmpty() { + // Arrange + ArrayList includeRoutes = new ArrayList<>(); + ArrayList excludeRoutes = new ArrayList<>(); + Function methodAccessor = mock(Function.class); + when(methodAccessor.apply(Mockito.any())).thenReturn("Apply"); + + // Act + HomepageForwardingMatcher actualHomepageForwardingMatcher = new HomepageForwardingMatcher<>( + includeRoutes, excludeRoutes, methodAccessor, mock(Function.class), mock(Function.class)); + boolean actualTestResult = actualHomepageForwardingMatcher.test("Request"); + + // Assert + verify(methodAccessor).apply(isA(Object.class)); + assertFalse(actualTestResult); + assertTrue(includeRoutes.isEmpty()); + } + + /** + * Test + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)}. + *
    + *
  • Given {@code foo}.
  • + *
  • Then {@link ArrayList#ArrayList()} size is one.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)} + */ + @Test + @DisplayName("Test new HomepageForwardingMatcher(List, List, Function, Function, Function); given 'foo'; then ArrayList() size is one") + @Tag("MaintainedByDiffblue") + void testNewHomepageForwardingMatcher_givenFoo_thenArrayListSizeIsOne() { + // Arrange + ArrayList includeRoutes = new ArrayList<>(); + includeRoutes.add("foo"); + ArrayList excludeRoutes = new ArrayList<>(); + Function methodAccessor = mock(Function.class); + when(methodAccessor.apply(Mockito.any())).thenReturn("Apply"); + + // Act + HomepageForwardingMatcher actualHomepageForwardingMatcher = new HomepageForwardingMatcher<>( + includeRoutes, excludeRoutes, methodAccessor, mock(Function.class), mock(Function.class)); + boolean actualTestResult = actualHomepageForwardingMatcher.test("Request"); + + // Assert + verify(methodAccessor).apply(isA(Object.class)); + assertEquals(1, includeRoutes.size()); + assertEquals("foo", includeRoutes.get(0)); + assertFalse(actualTestResult); + } + + /** + * Test + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)}. + *
    + *
  • Given {@code foo}.
  • + *
  • When {@link ArrayList#ArrayList()} add {@code foo}.
  • + *
  • Then {@link ArrayList#ArrayList()} Empty.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)} + */ + @Test + @DisplayName("Test new HomepageForwardingMatcher(List, List, Function, Function, Function); given 'foo'; when ArrayList() add 'foo'; then ArrayList() Empty") + @Tag("MaintainedByDiffblue") + void testNewHomepageForwardingMatcher_givenFoo_whenArrayListAddFoo_thenArrayListEmpty() { + // Arrange + ArrayList includeRoutes = new ArrayList<>(); + + ArrayList excludeRoutes = new ArrayList<>(); + excludeRoutes.add("foo"); + Function methodAccessor = mock(Function.class); + when(methodAccessor.apply(Mockito.any())).thenReturn("Apply"); + + // Act + HomepageForwardingMatcher actualHomepageForwardingMatcher = new HomepageForwardingMatcher<>( + includeRoutes, excludeRoutes, methodAccessor, mock(Function.class), mock(Function.class)); + boolean actualTestResult = actualHomepageForwardingMatcher.test("Request"); + + // Assert + verify(methodAccessor).apply(isA(Object.class)); + assertFalse(actualTestResult); + assertTrue(includeRoutes.isEmpty()); + } + + /** + * Test + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)}. + *
    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
  • Then {@link ArrayList#ArrayList()} Empty.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingMatcher#HomepageForwardingMatcher(List, List, Function, Function, Function)} + */ + @Test + @DisplayName("Test new HomepageForwardingMatcher(List, List, Function, Function, Function); when ArrayList(); then ArrayList() Empty") + @Tag("MaintainedByDiffblue") + void testNewHomepageForwardingMatcher_whenArrayList_thenArrayListEmpty() { + // Arrange + ArrayList includeRoutes = new ArrayList<>(); + + // Act + HomepageForwardingMatcher actualHomepageForwardingMatcher = new HomepageForwardingMatcher<>( + includeRoutes, new ArrayList<>(), mock(Function.class), mock(Function.class), mock(Function.class)); + + // Assert + assertFalse(actualHomepageForwardingMatcher.test("Request")); + assertTrue(includeRoutes.isEmpty()); + } + + /** + * Test {@link HomepageForwardingMatcher#test(Object)}. + *

+ * Method under test: {@link HomepageForwardingMatcher#test(Object)} + */ + @Test + @DisplayName("Test test(Object)") + @Tag("MaintainedByDiffblue") + void testTest() { + // Arrange + Function methodAccessor = mock(Function.class); + when(methodAccessor.apply(Mockito.any())).thenReturn("Apply"); + ArrayList includeRoutes = new ArrayList<>(); + HomepageForwardingMatcher homepageForwardingMatcher = new HomepageForwardingMatcher<>(includeRoutes, + new ArrayList<>(), methodAccessor, mock(Function.class), mock(Function.class)); + + // Act + boolean actualTestResult = homepageForwardingMatcher.test("Request"); + + // Assert + verify(methodAccessor).apply(isA(Object.class)); + assertFalse(actualTestResult); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/UiControllerDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/UiControllerDiffblueTest.java new file mode 100644 index 00000000000..3d4f68d545f --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/UiControllerDiffblueTest.java @@ -0,0 +1,418 @@ +package de.codecentric.boot.admin.server.ui.web; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.sun.security.auth.UserPrincipal; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.Palette; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.PollTimer; +import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.UiTheme; +import de.codecentric.boot.admin.server.ui.extensions.UiExtension; +import de.codecentric.boot.admin.server.ui.extensions.UiExtensions; +import de.codecentric.boot.admin.server.ui.web.UiController.ExternalView; +import de.codecentric.boot.admin.server.ui.web.UiController.Settings; +import de.codecentric.boot.admin.server.ui.web.UiController.Settings.SettingsBuilder; +import de.codecentric.boot.admin.server.ui.web.UiController.ViewSettings; +import java.security.Principal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.web.util.UriComponentsBuilder; + +@ContextConfiguration(classes = { UiController.class, String.class }) +@DisabledInAotMode +@ExtendWith(SpringExtension.class) +class UiControllerDiffblueTest { + + @MockitoBean + private Settings settings; + + @Autowired + private UiController uiController; + + @MockitoBean + private UiExtensions uiExtensions; + + /** + * Test ExternalView + * {@link ExternalView#ExternalView(String, String, Integer, boolean, List)}. + *
    + *
  • Then return Children is {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link ExternalView#ExternalView(String, String, Integer, boolean, List)} + */ + @Test + @DisplayName("Test ExternalView new ExternalView(String, String, Integer, boolean, List); then return Children is ArrayList()") + @Tag("MaintainedByDiffblue") + void testExternalViewNewExternalView_thenReturnChildrenIsArrayList() { + // Arrange + ArrayList children = new ArrayList<>(); + children.add(new ExternalView("'label' must not be empty", "https://example.org/example", 1, true, + new ArrayList<>())); + + // Act and Assert + assertSame(children, new ExternalView("Label", "https://example.org/example", 1, true, children).getChildren()); + } + + /** + * Test ExternalView + * {@link ExternalView#ExternalView(String, String, Integer, boolean, List)}. + *

    + *
  • Then return Children size is two.
  • + *
+ *

+ * Method under test: + * {@link ExternalView#ExternalView(String, String, Integer, boolean, List)} + */ + @Test + @DisplayName("Test ExternalView new ExternalView(String, String, Integer, boolean, List); then return Children size is two") + @Tag("MaintainedByDiffblue") + void testExternalViewNewExternalView_thenReturnChildrenSizeIsTwo() { + // Arrange + ArrayList children = new ArrayList<>(); + children.add(new ExternalView("'label' must not be empty", "https://example.org/example", 1, true, + new ArrayList<>())); + ExternalView externalView = new ExternalView("'label' must not be empty", "https://example.org/example", 1, + true, new ArrayList<>()); + + children.add(externalView); + + // Act and Assert + List children2 = new ExternalView("Label", "https://example.org/example", 1, true, children) + .getChildren(); + assertEquals(2, children2.size()); + assertSame(externalView, children2.get(1)); + } + + /** + * Test ExternalView + * {@link ExternalView#ExternalView(String, String, Integer, boolean, List)}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
  • Then return {@code Label}.
  • + *
+ *

+ * Method under test: + * {@link ExternalView#ExternalView(String, String, Integer, boolean, List)} + */ + @Test + @DisplayName("Test ExternalView new ExternalView(String, String, Integer, boolean, List); when ArrayList(); then return 'Label'") + @Tag("MaintainedByDiffblue") + void testExternalViewNewExternalView_whenArrayList_thenReturnLabel() { + // Arrange and Act + ExternalView actualExternalView = new ExternalView("Label", "https://example.org/example", 1, true, + new ArrayList<>()); + + // Assert + assertEquals("Label", actualExternalView.getLabel()); + assertEquals("https://example.org/example", actualExternalView.getUrl()); + assertEquals(1, actualExternalView.getOrder().intValue()); + assertTrue(actualExternalView.isIframe()); + assertTrue(actualExternalView.getChildren().isEmpty()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link UiController#UiController(String, UiExtensions, Settings)} + *
  • {@link UiController#getUiSettings()} + *
+ */ + @Test + @DisplayName("Test getters and setters") + @Tag("MaintainedByDiffblue") + void testGettersAndSetters() { + // Arrange + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + SettingsBuilder builderResult = Settings.builder(); + SettingsBuilder enableToastsResult = builderResult.availableLanguages(new ArrayList<>()) + .brand("Brand") + .enableToasts(true); + SettingsBuilder rememberMeEnabledResult = enableToastsResult.externalViews(new ArrayList<>()) + .favicon("Favicon") + .faviconDanger("Favicon Danger") + .hideInstanceUrl(true) + .loginIcon("Login Icon") + .notificationFilterEnabled(true) + .pollTimer(pollTimer) + .rememberMeEnabled(true); + SettingsBuilder routesResult = rememberMeEnabledResult.routes(new ArrayList<>()); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + SettingsBuilder titleResult = routesResult.theme(theme).title("Dr"); + Settings uiSettings = titleResult.viewSettings(new ArrayList<>()).build(); + + // Act and Assert + assertSame(uiSettings, + new UiController("https://example.org/example", UiExtensions.EMPTY, uiSettings).getUiSettings()); + } + + /** + * Test {@link UiController#getBaseUrl(UriComponentsBuilder)}. + *
    + *
  • Given {@link PollTimer} (default constructor) Cache is one.
  • + *
  • Then return {@code https://example.org/example/}.
  • + *
+ *

+ * Method under test: {@link UiController#getBaseUrl(UriComponentsBuilder)} + */ + @Test + @DisplayName("Test getBaseUrl(UriComponentsBuilder); given PollTimer (default constructor) Cache is one; then return 'https://example.org/example/'") + @Tag("MaintainedByDiffblue") + void testGetBaseUrl_givenPollTimerCacheIsOne_thenReturnHttpsExampleOrgExample() { + // Arrange + PollTimer pollTimer = new PollTimer(); + pollTimer.setCache(1); + pollTimer.setDatasource(1); + pollTimer.setGc(1); + pollTimer.setLogfile(1); + pollTimer.setMemory(1); + pollTimer.setProcess(1); + pollTimer.setThreads(1); + SettingsBuilder builderResult = Settings.builder(); + SettingsBuilder enableToastsResult = builderResult.availableLanguages(new ArrayList<>()) + .brand("Brand") + .enableToasts(true); + SettingsBuilder rememberMeEnabledResult = enableToastsResult.externalViews(new ArrayList<>()) + .favicon("Favicon") + .faviconDanger("Favicon Danger") + .hideInstanceUrl(true) + .loginIcon("Login Icon") + .notificationFilterEnabled(true) + .pollTimer(pollTimer) + .rememberMeEnabled(true); + SettingsBuilder routesResult = rememberMeEnabledResult.routes(new ArrayList<>()); + + Palette palette = new Palette(); + palette.set100("Shade100"); + palette.set200("Shade200"); + palette.set300("Shade300"); + palette.set400("Shade400"); + palette.set50("Shade50"); + palette.set500("Shade500"); + palette.set600("Shade600"); + palette.set700("Shade700"); + palette.set800("Shade800"); + palette.set900("Shade900"); + + UiTheme theme = new UiTheme(); + theme.setBackgroundEnabled(true); + theme.setColor("Color"); + theme.setPalette(palette); + SettingsBuilder titleResult = routesResult.theme(theme).title("Dr"); + Settings uiSettings = titleResult.viewSettings(new ArrayList<>()).build(); + UiController uiController = new UiController("https://example.org/example", UiExtensions.EMPTY, uiSettings); + + // Act and Assert + assertEquals("https://example.org/example/", uiController.getBaseUrl(UriComponentsBuilder.newInstance())); + } + + /** + * Test {@link UiController#getBaseUrl(UriComponentsBuilder)}. + *

    + *
  • Given {@link UiExtensions}.
  • + *
  • When newInstance.
  • + *
  • Then return {@code /}.
  • + *
+ *

+ * Method under test: {@link UiController#getBaseUrl(UriComponentsBuilder)} + */ + @Test + @DisplayName("Test getBaseUrl(UriComponentsBuilder); given UiExtensions; when newInstance; then return '/'") + @Tag("MaintainedByDiffblue") + void testGetBaseUrl_givenUiExtensions_whenNewInstance_thenReturnSlash() { + // Arrange, Act and Assert + assertEquals("/", uiController.getBaseUrl(UriComponentsBuilder.newInstance())); + } + + /** + * Test {@link UiController#getCssExtensions()}. + *

+ * Method under test: {@link UiController#getCssExtensions()} + */ + @Test + @DisplayName("Test getCssExtensions()") + @Tag("MaintainedByDiffblue") + void testGetCssExtensions() { + // Arrange + when(uiExtensions.getCssExtensions()).thenReturn(new ArrayList<>()); + + // Act + List actualCssExtensions = uiController.getCssExtensions(); + + // Assert + verify(uiExtensions).getCssExtensions(); + assertTrue(actualCssExtensions.isEmpty()); + } + + /** + * Test {@link UiController#getJsExtensions()}. + *

+ * Method under test: {@link UiController#getJsExtensions()} + */ + @Test + @DisplayName("Test getJsExtensions()") + @Tag("MaintainedByDiffblue") + void testGetJsExtensions() { + // Arrange + when(uiExtensions.getJsExtensions()).thenReturn(new ArrayList<>()); + + // Act + List actualJsExtensions = uiController.getJsExtensions(); + + // Assert + verify(uiExtensions).getJsExtensions(); + assertTrue(actualJsExtensions.isEmpty()); + } + + /** + * Test {@link UiController#getUser(Principal)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link UiController#getUser(Principal)} + */ + @Test + @DisplayName("Test getUser(Principal); when 'null'; then return Empty") + @Tag("MaintainedByDiffblue") + void testGetUser_whenNull_thenReturnEmpty() { + // Arrange, Act and Assert + assertTrue(uiController.getUser(null).isEmpty()); + } + + /** + * Test {@link UiController#getUser(Principal)}. + *

    + *
  • When {@link UserPrincipal#UserPrincipal(String)} with name is + * {@code principal}.
  • + *
  • Then return size is one.
  • + *
+ *

+ * Method under test: {@link UiController#getUser(Principal)} + */ + @Test + @DisplayName("Test getUser(Principal); when UserPrincipal(String) with name is 'principal'; then return size is one") + @Tag("MaintainedByDiffblue") + void testGetUser_whenUserPrincipalWithNameIsPrincipal_thenReturnSizeIsOne() { + // Arrange and Act + Map actualUser = uiController.getUser(new UserPrincipal("principal")); + + // Assert + assertEquals(1, actualUser.size()); + assertEquals("principal", actualUser.get("name")); + } + + /** + * Test {@link UiController#index()}. + *

+ * Method under test: {@link UiController#index()} + */ + @Test + @DisplayName("Test index()") + @Tag("MaintainedByDiffblue") + void testIndex() { + // Arrange, Act and Assert + assertEquals("index", uiController.index()); + } + + /** + * Test {@link UiController#sbaSettings()}. + *

+ * Method under test: {@link UiController#sbaSettings()} + */ + @Test + @DisplayName("Test sbaSettings()") + @Tag("MaintainedByDiffblue") + void testSbaSettings() { + // Arrange, Act and Assert + assertEquals("sba-settings.js", uiController.sbaSettings()); + } + + /** + * Test {@link UiController#variablesCss()}. + *

+ * Method under test: {@link UiController#variablesCss()} + */ + @Test + @DisplayName("Test variablesCss()") + @Tag("MaintainedByDiffblue") + void testVariablesCss() { + // Arrange, Act and Assert + assertEquals("variables.css", uiController.variablesCss()); + } + + /** + * Test {@link UiController#login()}. + *

+ * Method under test: {@link UiController#login()} + */ + @Test + @DisplayName("Test login()") + @Tag("MaintainedByDiffblue") + void testLogin() { + // Arrange, Act and Assert + assertEquals("login", uiController.login()); + } + + /** + * Test ViewSettings {@link ViewSettings#ViewSettings(String, boolean)}. + *

    + *
  • When {@code Name}.
  • + *
  • Then return {@code Name}.
  • + *
+ *

+ * Method under test: {@link ViewSettings#ViewSettings(String, boolean)} + */ + @Test + @DisplayName("Test ViewSettings new ViewSettings(String, boolean); when 'Name'; then return 'Name'") + @Tag("MaintainedByDiffblue") + void testViewSettingsNewViewSettings_whenName_thenReturnName() { + // Arrange and Act + ViewSettings actualViewSettings = new ViewSettings("Name", true); + + // Assert + assertEquals("Name", actualViewSettings.getName()); + assertTrue(actualViewSettings.isEnabled()); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/reactive/HomepageForwardingFilterDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/reactive/HomepageForwardingFilterDiffblueTest.java new file mode 100644 index 00000000000..5253eb62f1b --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/reactive/HomepageForwardingFilterDiffblueTest.java @@ -0,0 +1,64 @@ +package de.codecentric.boot.admin.server.ui.web.reactive; + +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig; +import java.util.ArrayList; +import java.util.function.Function; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.springframework.http.HttpMethod; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.http.server.reactive.ServerHttpRequestDecorator; +import org.springframework.web.server.ServerWebExchange; +import org.springframework.web.server.ServerWebExchangeDecorator; +import org.springframework.web.server.WebFilterChain; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +class HomepageForwardingFilterDiffblueTest { + + /** + * Test {@link HomepageForwardingFilter#filter(ServerWebExchange, WebFilterChain)}. + *

+ * Method under test: + * {@link HomepageForwardingFilter#filter(ServerWebExchange, WebFilterChain)} + */ + @Test + @DisplayName("Test filter(ServerWebExchange, WebFilterChain)") + @Tag("MaintainedByDiffblue") + void testFilter() { + // Arrange + ArrayList routesIncludes = new ArrayList<>(); + HomepageForwardingFilter homepageForwardingFilter = new HomepageForwardingFilter( + new HomepageForwardingFilterConfig("Homepage", routesIncludes, new ArrayList<>())); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + ServerWebExchangeDecorator exchange = mock(ServerWebExchangeDecorator.class); + when(exchange.getRequest()).thenReturn(new ServerHttpRequestDecorator(delegate)); + doNothing().when(exchange).addUrlTransformer(Mockito.>any()); + exchange.addUrlTransformer(mock(Function.class)); + WebFilterChain chain = mock(WebFilterChain.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + when(chain.filter(Mockito.any())).thenReturn(channelSendOperator); + + // Act + Mono actualFilterResult = homepageForwardingFilter.filter(exchange, chain); + + // Assert + verify(delegate).getMethod(); + verify(exchange).addUrlTransformer(isA(Function.class)); + verify(exchange).getRequest(); + verify(chain).filter(isA(ServerWebExchange.class)); + assertSame(channelSendOperator, actualFilterResult); + } + +} diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/servlet/HomepageForwardingFilterDiffblueTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/servlet/HomepageForwardingFilterDiffblueTest.java new file mode 100644 index 00000000000..5a8b05b00a9 --- /dev/null +++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/servlet/HomepageForwardingFilterDiffblueTest.java @@ -0,0 +1,117 @@ +package de.codecentric.boot.admin.server.ui.web.servlet; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import de.codecentric.boot.admin.server.ui.web.HomepageForwardingFilterConfig; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import org.apache.catalina.connector.Response; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.springframework.mock.web.MockHttpServletRequest; + +class HomepageForwardingFilterDiffblueTest { + + /** + * Test + * {@link HomepageForwardingFilter#doFilter(ServletRequest, ServletResponse, FilterChain)}. + *
    + *
  • Given {@link IOException#IOException(String)} with {@code foo}.
  • + *
  • Then throw {@link IOException}.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingFilter#doFilter(ServletRequest, ServletResponse, FilterChain)} + */ + @Test + @DisplayName("Test doFilter(ServletRequest, ServletResponse, FilterChain); given IOException(String) with 'foo'; then throw IOException") + @Tag("MaintainedByDiffblue") + void testDoFilter_givenIOExceptionWithFoo_thenThrowIOException() throws ServletException, IOException { + // Arrange + ArrayList routesIncludes = new ArrayList<>(); + HomepageForwardingFilter homepageForwardingFilter = new HomepageForwardingFilter( + new HomepageForwardingFilterConfig("Homepage", routesIncludes, new ArrayList<>())); + MockHttpServletRequest request = new MockHttpServletRequest(); + Response response = new Response(); + FilterChain chain = mock(FilterChain.class); + doThrow(new IOException("foo")).when(chain) + .doFilter(Mockito.any(), Mockito.any()); + + // Act and Assert + assertThrows(IOException.class, () -> homepageForwardingFilter.doFilter(request, response, chain)); + verify(chain).doFilter(isA(ServletRequest.class), isA(ServletResponse.class)); + } + + /** + * Test + * {@link HomepageForwardingFilter#doFilter(ServletRequest, ServletResponse, FilterChain)}. + *

    + *
  • When {@link MockHttpServletRequest#MockHttpServletRequest()}.
  • + *
  • Then calls {@link FilterChain#doFilter(ServletRequest, ServletResponse)}.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingFilter#doFilter(ServletRequest, ServletResponse, FilterChain)} + */ + @Test + @DisplayName("Test doFilter(ServletRequest, ServletResponse, FilterChain); when MockHttpServletRequest(); then calls doFilter(ServletRequest, ServletResponse)") + @Tag("MaintainedByDiffblue") + void testDoFilter_whenMockHttpServletRequest_thenCallsDoFilter() throws ServletException, IOException { + // Arrange + ArrayList routesIncludes = new ArrayList<>(); + HomepageForwardingFilter homepageForwardingFilter = new HomepageForwardingFilter( + new HomepageForwardingFilterConfig("Homepage", routesIncludes, new ArrayList<>())); + MockHttpServletRequest request = new MockHttpServletRequest(); + Response response = new Response(); + FilterChain chain = mock(FilterChain.class); + doNothing().when(chain).doFilter(Mockito.any(), Mockito.any()); + + // Act + homepageForwardingFilter.doFilter(request, response, chain); + + // Assert + verify(chain).doFilter(isA(ServletRequest.class), isA(ServletResponse.class)); + } + + /** + * Test + * {@link HomepageForwardingFilter#doFilter(ServletRequest, ServletResponse, FilterChain)}. + *

    + *
  • When {@link ServletRequest}.
  • + *
  • Then calls {@link FilterChain#doFilter(ServletRequest, ServletResponse)}.
  • + *
+ *

+ * Method under test: + * {@link HomepageForwardingFilter#doFilter(ServletRequest, ServletResponse, FilterChain)} + */ + @Test + @DisplayName("Test doFilter(ServletRequest, ServletResponse, FilterChain); when ServletRequest; then calls doFilter(ServletRequest, ServletResponse)") + @Tag("MaintainedByDiffblue") + void testDoFilter_whenServletRequest_thenCallsDoFilter() throws ServletException, IOException { + // Arrange + ArrayList routesIncludes = new ArrayList<>(); + HomepageForwardingFilter homepageForwardingFilter = new HomepageForwardingFilter( + new HomepageForwardingFilterConfig("Homepage", routesIncludes, new ArrayList<>())); + ServletRequest request = mock(ServletRequest.class); + Response response = new Response(); + FilterChain chain = mock(FilterChain.class); + doNothing().when(chain).doFilter(Mockito.any(), Mockito.any()); + + // Act + homepageForwardingFilter.doFilter(request, response, chain); + + // Assert + verify(chain).doFilter(isA(ServletRequest.class), isA(ServletResponse.class)); + } + +} diff --git a/spring-boot-admin-server/.diffblue/reports/diffblue-tests-jacoco-report.xml b/spring-boot-admin-server/.diffblue/reports/diffblue-tests-jacoco-report.xml new file mode 100644 index 00000000000..0159a3e263b --- /dev/null +++ b/spring-boot-admin-server/.diffblue/reports/diffblue-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-server/.diffblue/reports/manual-tests-jacoco-report.xml b/spring-boot-admin-server/.diffblue/reports/manual-tests-jacoco-report.xml new file mode 100644 index 00000000000..5688fb9a42f --- /dev/null +++ b/spring-boot-admin-server/.diffblue/reports/manual-tests-jacoco-report.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spring-boot-admin-server/.diffblue/reports/report.json b/spring-boot-admin-server/.diffblue/reports/report.json new file mode 100644 index 00000000000..1804e5d8d8c --- /dev/null +++ b/spring-boot-admin-server/.diffblue/reports/report.json @@ -0,0 +1,17077 @@ +{ + "meta" : { + "reportVersion" : "2.7" + }, + "run" : { + "version" : "2025.06.02-fd4f1ca-licensed", + "creationTimestamp" : "2025-06-20T13:03:30.183919337Z", + "command" : "dcover coverage-reports ", + "totalTime" : 470.031, + "environmentDetectionTime" : 82.144, + "indexingTime" : 0.0, + "entryPointsTime" : 0.0, + "generationTime" : 0.0, + "timeToFirstTest" : 470.031, + "timeToLastTest" : 470.031, + "indexQueryTime" : 0.0, + "verificationTime" : 0.0, + "validationTime" : 0.0 + }, + "codes" : { + "T000" : "Method eligible for test creation", + "T001" : "Trivial getter", + "T002" : "Trivial setter", + "T003" : "Private method", + "T004" : "In anonymous inner class", + "T005" : "Trivial constructor", + "T008" : "Private and never called", + "T010" : "Abstract or interface method", + "T012" : "Synthetic method", + "T020" : "Other trivial method", + "T023" : "Testability unknown" + }, + "summary" : { + "classesCount" : 188, + "methodsCount" : 1384, + "cumulativeDiffblueTestCount" : 722, + "cumulativeManualTestCount" : 378, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "skeletonTestCount" : 0, + "totalPhysicalLineCount" : 7342, + "perMethodTestability" : { + "T000" : 449, + "T001" : 71, + "T002" : 75, + "T003" : 91, + "T004" : 7, + "T005" : 67, + "T008" : 2, + "T010" : 54, + "T012" : 526, + "T020" : 2, + "T023" : 40 + }, + "perMethodOutcome" : { + "T000" : 449, + "T001" : 71, + "T002" : 75, + "T003" : 91, + "T004" : 7, + "T005" : 67, + "T008" : 2, + "T010" : 54, + "T012" : 526, + "T020" : 2, + "T023" : 40 + } + }, + "classes" : { + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration" : { + "methodsCount" : 15, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 12, + "T005" : 1, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 12, + "T005" : 1, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerCloudFoundryAutoConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration$NotifierTriggerConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$CookieStoreConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$HttpHeadersProviderConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 9, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 9, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 11, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 11, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerMarkerConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerMarkerConfiguration$Marker" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1 + }, + "perMethodOutcome" : { + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T003" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$CompositeNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$CompositeNotifierConfiguration$NoSingleNotifierCandidateCondition" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1 + }, + "perMethodOutcome" : { + "T000" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$CompositeNotifierConfiguration$NoSingleNotifierCandidateCondition$HasSingleNotifierInstance" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1 + }, + "perMethodOutcome" : { + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$DingTalkNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$DiscordNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$FeiShuNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$FilteringNotifierWebConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$HipchatNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$LetsChatNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MailNotifierConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MicrosoftTeamsNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$NotifierTriggerConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$OpsGenieNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$PagerdutyNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$RocketChatNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$SlackNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$TelegramNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$WebexNotifierConfiguration" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties" : { + "methodsCount" : 20, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 18 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 18 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties" : { + "methodsCount" : 13, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 13 + }, + "perMethodOutcome" : { + "T012" : 13 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties" : { + "methodsCount" : 25, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 25 + }, + "perMethodOutcome" : { + "T012" : 25 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ReactiveRestApiConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ServletRestApiConfiguration" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.config.SpringBootAdminServerEnabledCondition" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 1 + } + }, + "de.codecentric.boot.admin.server.domain.entities.Application" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1, + "T005" : 1, + "T012" : 10 + }, + "perMethodOutcome" : { + "T003" : 1, + "T005" : 1, + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 8 + }, + "perMethodOutcome" : { + "T012" : 8 + } + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository" : { + "methodsCount" : 16, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 7, + "T012" : 8, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 7, + "T012" : 8, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.domain.entities.Instance" : { + "methodsCount" : 32, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 11, + "T001" : 1, + "T003" : 7, + "T012" : 13 + }, + "perMethodOutcome" : { + "T000" : 11, + "T001" : 1, + "T003" : 7, + "T012" : 13 + } + }, + "de.codecentric.boot.admin.server.domain.entities.InstanceRepository" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 6 + }, + "perMethodOutcome" : { + "T010" : 6 + } + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository" : { + "methodsCount" : 15, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T012" : 6, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T012" : 6, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 4 + } + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 5 + } + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent" : { + "methodsCount" : 9, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1, + "T012" : 8 + }, + "perMethodOutcome" : { + "T010" : 1, + "T012" : 8 + } + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 5 + } + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 5 + } + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 5 + } + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T001" : 1, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T001" : 1, + "T012" : 4 + } + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion" : { + "methodsCount" : 9, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T001" : 2, + "T003" : 1, + "T012" : 3 + }, + "perMethodOutcome" : { + "T000" : 3, + "T001" : 2, + "T003" : 1, + "T012" : 3 + } + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 1, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 1, + "T012" : 5 + } + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints" : { + "methodsCount" : 13, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T003" : 1, + "T012" : 3, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T003" : 1, + "T012" : 3, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints$UnmodifiableIterator" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 2, + "T008" : 1 + }, + "perMethodOutcome" : { + "T003" : 2, + "T008" : 1 + } + }, + "de.codecentric.boot.admin.server.domain.values.Info" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T001" : 1, + "T003" : 1, + "T012" : 3, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T001" : 1, + "T003" : 1, + "T012" : 3, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T001" : 1, + "T003" : 1, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T001" : 1, + "T003" : 1, + "T012" : 4 + } + }, + "de.codecentric.boot.admin.server.domain.values.Registration" : { + "methodsCount" : 15, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 2, + "T005" : 2, + "T012" : 10 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 2, + "T005" : 2, + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder" : { + "methodsCount" : 11, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 11 + }, + "perMethodOutcome" : { + "T012" : 11 + } + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo" : { + "methodsCount" : 22, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 16, + "T003" : 1, + "T012" : 4, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 16, + "T003" : 1, + "T012" : 4, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.domain.values.Tags" : { + "methodsCount" : 17, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T001" : 1, + "T003" : 2, + "T012" : 9, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T001" : 1, + "T003" : 2, + "T012" : 9, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore" : { + "methodsCount" : 16, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T003" : 2, + "T010" : 1, + "T012" : 7, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T003" : 2, + "T010" : 1, + "T012" : 7, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore$1" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 2, + "T012" : 1 + }, + "perMethodOutcome" : { + "T004" : 2, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.eventstore.InMemoryEventStore" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T012" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T012" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventStore" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 3 + }, + "perMethodOutcome" : { + "T010" : 3 + } + }, + "de.codecentric.boot.admin.server.eventstore.OptimisticLockingException" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1 + }, + "perMethodOutcome" : { + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T003" : 1, + "T010" : 2, + "T012" : 3 + }, + "perMethodOutcome" : { + "T000" : 4, + "T003" : 1, + "T010" : 2, + "T012" : 3 + } + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 6, + "T010" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 6, + "T010" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.CompositeNotifier" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier" : { + "methodsCount" : 14, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T001" : 2, + "T002" : 3, + "T003" : 3, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T001" : 2, + "T002" : 3, + "T003" : 3, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier" : { + "methodsCount" : 16, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 6, + "T001" : 4, + "T002" : 5, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 6, + "T001" : 4, + "T002" : 5, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier" : { + "methodsCount" : 22, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T001" : 5, + "T002" : 6, + "T003" : 5, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T001" : 5, + "T002" : 6, + "T003" : 5, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T023" : 1 + }, + "perMethodOutcome" : { + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$Card" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T001" : 2, + "T002" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T001" : 2, + "T002" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$MessageType" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1, + "T012" : 3, + "T023" : 1 + }, + "perMethodOutcome" : { + "T003" : 1, + "T012" : 3, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.HazelcastNotificationTrigger" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier" : { + "methodsCount" : 19, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T001" : 5, + "T002" : 5, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T001" : 5, + "T002" : 5, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier" : { + "methodsCount" : 17, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 6, + "T001" : 4, + "T002" : 5, + "T003" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 6, + "T001" : 4, + "T002" : 5, + "T003" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.LoggingNotifier" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.MailNotifier" : { + "methodsCount" : 17, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T001" : 4, + "T002" : 4, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T001" : 4, + "T002" : 4, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier" : { + "methodsCount" : 30, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 17, + "T001" : 5, + "T002" : 6, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 17, + "T001" : 5, + "T002" : 6, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message" : { + "methodsCount" : 11, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 11 + }, + "perMethodOutcome" : { + "T012" : 11 + } + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 10 + }, + "perMethodOutcome" : { + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section$SectionBuilder" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 6 + }, + "perMethodOutcome" : { + "T012" : 6 + } + }, + "de.codecentric.boot.admin.server.notify.NotificationTrigger" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T012" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T012" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.Notifier" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties" : { + "methodsCount" : 13, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 13 + }, + "perMethodOutcome" : { + "T012" : 13 + } + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier" : { + "methodsCount" : 26, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 9, + "T001" : 7, + "T002" : 8, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 9, + "T001" : 7, + "T002" : 8, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier" : { + "methodsCount" : 18, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 7, + "T001" : 4, + "T002" : 5, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 7, + "T001" : 4, + "T002" : 5, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier" : { + "methodsCount" : 19, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T002" : 2, + "T012" : 8, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T002" : 2, + "T012" : 8, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier$Reminder" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T001" : 2, + "T002" : 1, + "T008" : 1 + }, + "perMethodOutcome" : { + "T001" : 2, + "T002" : 1, + "T008" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier" : { + "methodsCount" : 17, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T001" : 5, + "T002" : 5, + "T003" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T001" : 5, + "T002" : 5, + "T003" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier" : { + "methodsCount" : 17, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 7, + "T001" : 4, + "T002" : 5, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 7, + "T001" : 4, + "T002" : 5, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier" : { + "methodsCount" : 18, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T001" : 5, + "T002" : 6, + "T003" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T001" : 5, + "T002" : 6, + "T003" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier" : { + "methodsCount" : 15, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T001" : 4, + "T002" : 4, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T001" : 4, + "T002" : 4, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.filter.AbstractNotificationFilter" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.filter.ApplicationNameNotificationFilter" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T001" : 1, + "T020" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T001" : 1, + "T020" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.filter.ExpiringNotificationFilter" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T010" : 2 + }, + "perMethodOutcome" : { + "T000" : 3, + "T010" : 2 + } + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 6, + "T002" : 1, + "T003" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 6, + "T002" : 1, + "T003" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.filter.InstanceIdNotificationFilter" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T001" : 1, + "T020" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T001" : 1, + "T020" : 1 + } + }, + "de.codecentric.boot.admin.server.notify.filter.NotificationFilter" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 2 + }, + "perMethodOutcome" : { + "T010" : 2 + } + }, + "de.codecentric.boot.admin.server.notify.filter.web.NotificationFilterController" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T010" : 2, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 3, + "T010" : 2, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.services.ApiMediaTypeHandler" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry" : { + "methodsCount" : 20, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 9, + "T005" : 1, + "T012" : 10 + }, + "perMethodOutcome" : { + "T000" : 9, + "T005" : 1, + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.services.CloudFoundryInstanceIdGenerator" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.services.EndpointDetectionTrigger" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T012" : 2, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T012" : 2, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.EndpointDetector" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 1, + "T005" : 1, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 1, + "T005" : 1, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 1, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 1, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 7, + "T012" : 4, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 7, + "T012" : 4, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.InfoUpdater" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T005" : 1, + "T012" : 4, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 1, + "T012" : 4, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.InfoUpdater$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.server.services.InstanceFilter" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.services.InstanceIdGenerator" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 5, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.services.IntervalCheck" : { + "methodsCount" : 15, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T005" : 1, + "T012" : 9, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 1, + "T012" : 9, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 7, + "T012" : 4, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 7, + "T012" : 4, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.StatusUpdater" : { + "methodsCount" : 14, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 6, + "T002" : 1, + "T003" : 1, + "T012" : 5, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 6, + "T002" : 1, + "T003" : 1, + "T012" : 5, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.StatusUpdater$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.ChainingStrategy" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2 + }, + "perMethodOutcome" : { + "T000" : 2 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.EndpointDetectionStrategy" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T012" : 6, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T012" : 6, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1, + "T012" : 7 + }, + "perMethodOutcome" : { + "T003" : 1, + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T003" : 1, + "T012" : 7 + }, + "perMethodOutcome" : { + "T003" : 1, + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy" : { + "methodsCount" : 13, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 4, + "T005" : 1, + "T012" : 7, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 4, + "T005" : 1, + "T012" : 7, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 1, + "T012" : 6 + }, + "perMethodOutcome" : { + "T005" : 1, + "T012" : 6 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.AdminServerModule" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1 + }, + "perMethodOutcome" : { + "T000" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.BuildVersionMixin" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 2 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.EndpointMixin" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.EndpointsMixin" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InfoMixin" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 2 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceDeregisteredEventMixin" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceEndpointsDetectedEventMixin" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceEventMixin" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceIdMixin" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 2 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceInfoChangedEventMixin" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceRegisteredEventMixin" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceRegistrationUpdatedEventMixin" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceStatusChangedEventMixin" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationBeanSerializerModifier" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationDeserializer" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 2, + "T012" : 4 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 2, + "T012" : 4 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.StatusInfoMixin" : { + "methodsCount" : 6, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 5 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 5 + } + }, + "de.codecentric.boot.admin.server.utils.jackson.TagsMixin" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T010" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T010" : 2 + } + }, + "de.codecentric.boot.admin.server.web.ApplicationsController" : { + "methodsCount" : 11, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T003" : 1, + "T005" : 1, + "T012" : 3, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T003" : 1, + "T005" : 1, + "T012" : 3, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.web.HttpHeaderFilter" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 1, + "T012" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 1, + "T012" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy" : { + "methodsCount" : 13, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 2, + "T012" : 7, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 2, + "T012" : 7, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 10 + }, + "perMethodOutcome" : { + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 10 + }, + "perMethodOutcome" : { + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 7 + }, + "perMethodOutcome" : { + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.web.InstancesController" : { + "methodsCount" : 18, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 8, + "T003" : 1, + "T005" : 1, + "T012" : 7, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 8, + "T003" : 1, + "T005" : 1, + "T012" : 7, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.web.PathUtils" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 2, + "T005" : 1, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 2, + "T005" : 1, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials" : { + "methodsCount" : 10, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T012" : 10 + }, + "perMethodOutcome" : { + "T012" : 10 + } + }, + "de.codecentric.boot.admin.server.web.client.CloudFoundryHttpHeaderProvider" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.CompositeHttpHeadersProvider" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T005" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 1, + "T005" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.HttpHeadersProvider" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunction" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions" : { + "methodsCount" : 36, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 9, + "T003" : 6, + "T012" : 20, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 9, + "T003" : 6, + "T012" : 20, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient" : { + "methodsCount" : 14, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 2, + "T005" : 3, + "T012" : 7 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 2, + "T005" : 3, + "T012" : 7 + } + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 5, + "T002" : 1, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 5, + "T002" : 1, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClientCustomizer" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverter" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T005" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T005" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters" : { + "methodsCount" : 52, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 12, + "T003" : 16, + "T012" : 23, + "T023" : 1 + }, + "perMethodOutcome" : { + "T000" : 12, + "T003" : 16, + "T012" : 23, + "T023" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters$1" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters$2" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters$3" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T004" : 1 + }, + "perMethodOutcome" : { + "T004" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.RefreshInstancesEvent" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1 + }, + "perMethodOutcome" : { + "T000" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.cookies.CookieStoreCleanupTrigger" : { + "methodsCount" : 4, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 2, + "T003" : 1, + "T012" : 1 + }, + "perMethodOutcome" : { + "T000" : 2, + "T003" : 1, + "T012" : 1 + } + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore" : { + "methodsCount" : 12, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 7, + "T012" : 5 + }, + "perMethodOutcome" : { + "T000" : 7, + "T012" : 5 + } + }, + "de.codecentric.boot.admin.server.web.client.cookies.PerInstanceCookieStore" : { + "methodsCount" : 3, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 3 + }, + "perMethodOutcome" : { + "T010" : 3 + } + }, + "de.codecentric.boot.admin.server.web.client.exception.InstanceWebClientException" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 2 + }, + "perMethodOutcome" : { + "T005" : 2 + } + }, + "de.codecentric.boot.admin.server.web.client.exception.ResolveEndpointException" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 2 + }, + "perMethodOutcome" : { + "T005" : 2 + } + }, + "de.codecentric.boot.admin.server.web.client.exception.ResolveInstanceException" : { + "methodsCount" : 2, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T005" : 2 + }, + "perMethodOutcome" : { + "T005" : 2 + } + }, + "de.codecentric.boot.admin.server.web.client.reactive.CompositeReactiveHttpHeadersProvider" : { + "methodsCount" : 5, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 1, + "T003" : 1, + "T005" : 1, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 1, + "T003" : 1, + "T005" : 1, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.web.client.reactive.ReactiveHttpHeadersProvider" : { + "methodsCount" : 1, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T010" : 1 + }, + "perMethodOutcome" : { + "T010" : 1 + } + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 2, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 2, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController" : { + "methodsCount" : 7, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 2, + "T012" : 2 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 2, + "T012" : 2 + } + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping" : { + "methodsCount" : 8, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 2, + "T012" : 3 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 2, + "T012" : 3 + } + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController" : { + "methodsCount" : 9, + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : { + "T000" : 3, + "T003" : 3, + "T012" : 3 + }, + "perMethodOutcome" : { + "T000" : 3, + "T003" : 3, + "T012" : 3 + } + } + }, + "methods" : { + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 69, + 70, + 71 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.applicationRegistry:(Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/eventstore/InstanceEventPublisher;)Lde/codecentric/boot/admin/server/services/ApplicationRegistry;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.endpointDetectionTrigger:(Lde/codecentric/boot/admin/server/services/EndpointDetector;Lorg/reactivestreams/Publisher;)Lde/codecentric/boot/admin/server/services/EndpointDetectionTrigger;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 139 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.endpointDetector:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)Lde/codecentric/boot/admin/server/services/EndpointDetector;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 128, + 129, + 131, + 132 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.eventStore:()Lde/codecentric/boot/admin/server/eventstore/InMemoryEventStore;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 160 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.infoUpdateTrigger:(Lde/codecentric/boot/admin/server/services/InfoUpdater;Lorg/reactivestreams/Publisher;)Lde/codecentric/boot/admin/server/services/InfoUpdateTrigger;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 152, + 153, + 154, + 152 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.infoUpdater:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)Lde/codecentric/boot/admin/server/services/InfoUpdater;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 146 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.instanceFilter:()Lde/codecentric/boot/admin/server/services/InstanceFilter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.instanceIdGenerator:()Lde/codecentric/boot/admin/server/services/InstanceIdGenerator;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 96 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.instanceRegistry:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/services/InstanceIdGenerator;Lde/codecentric/boot/admin/server/services/InstanceFilter;)Lde/codecentric/boot/admin/server/services/InstanceRegistry;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.instanceRepository:(Lde/codecentric/boot/admin/server/eventstore/InstanceEventStore;)Lde/codecentric/boot/admin/server/domain/entities/SnapshottingInstanceRepository;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 166 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.lambda$instanceFilter$0:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.statusUpdateTrigger:(Lde/codecentric/boot/admin/server/services/StatusUpdater;Lorg/reactivestreams/Publisher;)Lde/codecentric/boot/admin/server/services/StatusUpdateTrigger;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 109, + 111, + 112, + 114, + 115, + 120, + 121, + 120 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration.statusUpdater:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)Lde/codecentric/boot/admin/server/services/StatusUpdater;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 103 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerCloudFoundryAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerCloudFoundryAutoConfiguration.cloudFoundryHttpHeaderProvider:()Lde/codecentric/boot/admin/server/web/client/CloudFoundryHttpHeaderProvider;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerCloudFoundryAutoConfiguration.instanceIdGenerator:()Lde/codecentric/boot/admin/server/services/InstanceIdGenerator;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration$NotifierTriggerConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 69, + 71 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration$NotifierTriggerConfiguration.notificationTrigger:(Lcom/hazelcast/core/HazelcastInstance;Lde/codecentric/boot/admin/server/notify/Notifier;Lorg/reactivestreams/Publisher;)Lde/codecentric/boot/admin/server/notify/NotificationTrigger;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 78, + 79, + 78 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 51, + 57 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration.eventStore:(Lcom/hazelcast/core/HazelcastInstance;)Lde/codecentric/boot/admin/server/eventstore/HazelcastEventStore;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 63, + 64 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$CookieStoreConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 252 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$CookieStoreConfiguration.cookieStore:()Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 261 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$CookieStoreConfiguration.cookieStoreCleanupTrigger:(Lorg/reactivestreams/Publisher;Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;)Lde/codecentric/boot/admin/server/web/client/cookies/CookieStoreCleanupTrigger;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 276 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$HttpHeadersProviderConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 162 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$HttpHeadersProviderConfiguration.basicAuthHttpHeadersProvider:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)Lde/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProvider;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 167, + 169, + 170, + 171, + 170, + 174 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.addHeadersInstanceExchangeFilter:(Ljava/util/List;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 88 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.addReactiveHeadersInstanceExchangeFilter:(Ljava/util/List;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 97, + 98, + 97 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.cookieHandlingInstanceExchangeFilter:(Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 136 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.legacyEndpointConverterInstanceExchangeFilter:(Ljava/util/List;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.logfileAcceptWorkaround:()Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 128 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.retryInstanceExchangeFilter:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 144, + 145 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.rewriteEndpointUrlInstanceExchangeFilter:()Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 105 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.setDefaultAcceptHeaderInstanceExchangeFilter:()Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration$DefaultInstanceExchangeFiltersConfiguration.timeoutInstanceExchangeFilter:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 153, + 154 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration.filterInstanceWebClientCustomizer:(Ljava/util/List;)Lde/codecentric/boot/admin/server/web/client/InstanceWebClientCustomizer;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration.lambda$filterInstanceWebClientCustomizer$0:(Ljava/util/List;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$InstanceExchangeFiltersConfiguration.lambda$filterInstanceWebClientCustomizer$1:(Ljava/util/List;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 76 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 181 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.beansLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 228 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.configpropsLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 234 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.envLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 198 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.flywayLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 222 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.healthLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 186 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.httptraceLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 204 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.infoLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 192 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.liquibaseLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 216 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.mappingsLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 240 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.startupLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 246 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration$LegaycEndpointConvertersConfiguration.threaddumpLegacyEndpointConverter:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 210 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration.:(Lorg/springframework/beans/factory/ObjectProvider;Lorg/springframework/web/reactive/function/client/WebClient$Builder;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 56, + 57, + 58, + 59 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration.instanceWebClientBuilder:()Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration.lambda$new$0:(Lde/codecentric/boot/admin/server/web/client/InstanceWebClientCustomizer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerMarkerConfiguration$Marker.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerMarkerConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerMarkerConfiguration.adminServerMarker:()Lde/codecentric/boot/admin/server/config/AdminServerMarkerConfiguration$Marker;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 27 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$CompositeNotifierConfiguration$NoSingleNotifierCandidateCondition$HasSingleNotifierInstance.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 136 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$CompositeNotifierConfiguration$NoSingleNotifierCandidateCondition.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 132, + 133 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$CompositeNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 120 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$CompositeNotifierConfiguration.compositeNotifier:(Ljava/util/List;)Lde/codecentric/boot/admin/server/notify/CompositeNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 126 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$DingTalkNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$DingTalkNotifierConfiguration.dingTalkNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/DingTalkNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 331 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$DiscordNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$DiscordNotifierConfiguration.discordNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/DiscordNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 315 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$FeiShuNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 356 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$FeiShuNotifierConfiguration.feiShuNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/FeiShuNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 362 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$FilteringNotifierWebConfiguration.:(Lde/codecentric/boot/admin/server/notify/filter/FilteringNotifier;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 151, + 152, + 153 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$FilteringNotifierWebConfiguration.notificationFilterController:()Lde/codecentric/boot/admin/server/notify/filter/web/NotificationFilterController;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$HipchatNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 199 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$HipchatNotifierConfiguration.hipchatNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/HipchatNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 205 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$LetsChatNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 229 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$LetsChatNotifierConfiguration.letsChatNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/LetsChatNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 236 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MailNotifierConfiguration.:(Lorg/springframework/context/ApplicationContext;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 170, + 171, + 172 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MailNotifierConfiguration.mailNotifier:(Lorg/springframework/mail/javamail/JavaMailSender;Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/thymeleaf/TemplateEngine;)Lde/codecentric/boot/admin/server/notify/MailNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 179 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MailNotifierConfiguration.mailNotifierTemplateEngine:()Lorg/thymeleaf/TemplateEngine;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 184, + 185, + 186, + 188, + 189, + 190 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MicrosoftTeamsNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 277 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$MicrosoftTeamsNotifierConfiguration.microsoftTeamsNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 284 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$NotifierTriggerConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 106 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$NotifierTriggerConfiguration.notificationTrigger:(Lde/codecentric/boot/admin/server/notify/Notifier;Lorg/reactivestreams/Publisher;)Lde/codecentric/boot/admin/server/notify/NotificationTrigger;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 111 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$OpsGenieNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 261 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$OpsGenieNotifierConfiguration.opsgenieNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/OpsGenieNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 268 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$PagerdutyNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 245 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$PagerdutyNotifierConfiguration.pagerdutyNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/PagerdutyNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 252 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$RocketChatNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 340 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$RocketChatNotifierConfiguration.rocketChatNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/RocketChatNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 347 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$SlackNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 214 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$SlackNotifierConfiguration.slackNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/SlackNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 220 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$TelegramNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 293 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$TelegramNotifierConfiguration.telegramNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/TelegramNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 300 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$WebexNotifierConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 371 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration$WebexNotifierConfiguration.webexNotifier:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lde/codecentric/boot/admin/server/notify/WebexNotifier;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 377 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.createNotifierRestTemplate:(Lde/codecentric/boot/admin/server/notify/NotifierProxyProperties;)Lorg/springframework/web/client/RestTemplate;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 83, + 84, + 85, + 86, + 88, + 89, + 90, + 91, + 93, + 94, + 95, + 98, + 100 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159, + 167, + 175, + 183, + 188 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.getDefaultPassword:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 183 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.getDefaultUserName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 175 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.getServiceMap:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 188 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.isEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 167 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.setDefaultPassword:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.setDefaultUserName:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.setEnabled:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.setServiceMap:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceAuthProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 159 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 192, + 198 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 192 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 192 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties.getIgnoredHeaders:()Ljava/util/Set;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 198 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 192 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties.setIgnoredHeaders:(Ljava/util/Set;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 192 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$InstanceProxyProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 192 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90, + 96, + 97, + 103, + 104, + 110, + 111, + 116, + 117, + 123, + 124, + 130, + 131, + 137, + 142, + 148, + 149, + 154 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getDefaultRetries:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getDefaultTimeout:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 149 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getInfoInterval:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 117 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getInfoLifetime:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 131 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getInfoMaxBackoff:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 124 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getRetries:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getStatusInterval:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 97 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getStatusLifetime:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 104 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getStatusMaxBackoff:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 111 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.getTimeout:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 155 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setDefaultRetries:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setDefaultTimeout:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setInfoInterval:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setInfoLifetime:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setInfoMaxBackoff:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setRetries:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setStatusInterval:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setStatusLifetime:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setStatusMaxBackoff:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.setTimeout:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$MonitorProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80, + 86 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties.isEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 86 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties.setEnabled:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties$ServerProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34, + 42, + 44, + 46, + 48, + 50, + 55, + 64 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.getContextPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.getInstanceAuth:()Lde/codecentric/boot/admin/server/config/AdminServerProperties$InstanceAuthProperties;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 48 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.getInstanceProxy:()Lde/codecentric/boot/admin/server/config/AdminServerProperties$InstanceProxyProperties;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 50 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.getMetadataKeysToSanitize:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 55 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.getMonitor:()Lde/codecentric/boot/admin/server/config/AdminServerProperties$MonitorProperties;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.getProbedEndpoints:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 64 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.getServer:()Lde/codecentric/boot/admin/server/config/AdminServerProperties$ServerProperties;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.path:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 77 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.setContextPath:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69, + 70 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.setInstanceAuth:(Lde/codecentric/boot/admin/server/config/AdminServerProperties$InstanceAuthProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.setInstanceProxy:(Lde/codecentric/boot/admin/server/config/AdminServerProperties$InstanceProxyProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.setMetadataKeysToSanitize:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.setMonitor:(Lde/codecentric/boot/admin/server/config/AdminServerProperties$MonitorProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.setProbedEndpoints:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.setServer:(Lde/codecentric/boot/admin/server/config/AdminServerProperties$ServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ReactiveRestApiConfiguration.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 71, + 72, + 73 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ReactiveRestApiConfiguration.adminHandlerMapping:(Lorg/springframework/web/reactive/accept/RequestedContentTypeResolver;)Lorg/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 88, + 89, + 90, + 91, + 92 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ReactiveRestApiConfiguration.instancesProxyController:(Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)Lde/codecentric/boot/admin/server/web/reactive/InstancesProxyController;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80, + 81, + 82, + 79 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ServletRestApiConfiguration.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 104, + 105, + 106 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ServletRestApiConfiguration.adminHandlerMapping:(Lorg/springframework/web/accept/ContentNegotiationManager;)Lorg/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 121, + 122, + 123, + 124, + 125 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration$ServletRestApiConfiguration.instancesProxyController:(Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)Lde/codecentric/boot/admin/server/web/servlet/InstancesProxyController;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 112, + 113, + 114, + 115, + 112 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration.:(Lde/codecentric/boot/admin/server/config/AdminServerProperties;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 43, + 44, + 45 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration.adminJacksonModule:()Lcom/fasterxml/jackson/databind/module/SimpleModule;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 49 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration.applicationsController:(Lde/codecentric/boot/admin/server/services/ApplicationRegistry;Lorg/springframework/context/ApplicationEventPublisher;)Lde/codecentric/boot/admin/server/web/ApplicationsController;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 62 + ] + }, + "de.codecentric.boot.admin.server.config.AdminServerWebConfiguration.instancesController:(Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/eventstore/InstanceEventStore;)Lde/codecentric/boot/admin/server/web/InstancesController;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55 + ] + }, + "de.codecentric.boot.admin.server.config.SpringBootAdminServerEnabledCondition.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.config.SpringBootAdminServerEnabledCondition.getClientProperties:(Lorg/springframework/context/annotation/ConditionContext;)Lde/codecentric/boot/admin/server/config/AdminServerProperties;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 45, + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.config.SpringBootAdminServerEnabledCondition.getMatchOutcome:(Lorg/springframework/context/annotation/ConditionContext;Lorg/springframework/core/type/AnnotatedTypeMetadata;)Lorg/springframework/boot/autoconfigure/condition/ConditionOutcome;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 34, + 36, + 37, + 38, + 37, + 41 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.build:()Lde/codecentric/boot/admin/server/domain/entities/Application;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.buildVersion:(Lde/codecentric/boot/admin/server/domain/values/BuildVersion;)Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.instances:(Ljava/util/List;)Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.name:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.status:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.statusTimestamp:(Ljava/time/Instant;)Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application$Builder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.:(Ljava/lang/String;Lde/codecentric/boot/admin/server/domain/values/BuildVersion;Ljava/lang/String;Ljava/time/Instant;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 56, + 59 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.builder:()Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.create:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 62 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.getBuildVersion:()Lde/codecentric/boot/admin/server/domain/values/BuildVersion;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.getInstances:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.getName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.getStatus:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.getStatusTimestamp:()Ljava/time/Instant;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 40 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.toBuilder:()Lde/codecentric/boot/admin/server/domain/entities/Application$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Application.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.:(Lde/codecentric/boot/admin/server/eventstore/InstanceEventStore;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 47, + 43, + 44, + 45, + 48, + 49 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.compute:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/util/function/BiFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 78, + 79, + 80, + 81, + 82, + 78 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.computeIfPresent:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/util/function/BiFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 88, + 89, + 90, + 91, + 88 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.find:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 66, + 67, + 68, + 65 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.findAll:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 58, + 59, + 60, + 58 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.findByName:(Ljava/lang/String;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 73 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$compute$5:(Ljava/util/function/BiFunction;Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 79 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$compute$6:(Ljava/util/function/BiFunction;Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$computeIfPresent$7:(Ljava/util/function/BiFunction;Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$find$2:(Ljava/util/List;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 67 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$find$3:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/util/List;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 68 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$findAll$1:(Lreactor/core/publisher/GroupedFlux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$findByName$4:(Ljava/lang/String;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 73 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.lambda$new$0:(Lreactor/util/retry/Retry$RetrySignal;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository.save:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 53 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 86, + 87, + 86, + 88 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLde/codecentric/boot/admin/server/domain/values/Registration;ZLde/codecentric/boot/admin/server/domain/values/StatusInfo;Ljava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Info;Lde/codecentric/boot/admin/server/domain/values/Endpoints;Lde/codecentric/boot/admin/server/domain/values/BuildVersion;Lde/codecentric/boot/admin/server/domain/values/Tags;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.appendToEvents:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Z)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 252, + 253, + 255, + 256, + 257, + 258 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.apply:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 192 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.apply:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Z)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 196, + 197, + 198, + 201, + 203, + 204, + 205, + 206, + 207, + 205, + 211, + 212, + 213, + 215, + 216, + 213, + 219, + 220, + 221, + 222, + 221, + 225, + 226, + 227, + 231, + 232, + 233, + 234, + 235, + 236, + 234, + 239, + 240, + 241, + 240, + 244 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.apply:(Ljava/util/Collection;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 183, + 184, + 185, + 186, + 187, + 188 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.clearUnsavedEvents:()Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 178, + 179, + 178 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.create:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 112, + 113 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.deregister:()Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 130, + 131, + 133 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 57 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getBuildVersion:()Lde/codecentric/boot/admin/server/domain/values/BuildVersion;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 81 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getEndpoints:()Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getId:()Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 61 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getInfo:()Lde/codecentric/boot/admin/server/domain/values/Info;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 74 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getRegistration:()Lde/codecentric/boot/admin/server/domain/values/Registration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 167, + 168, + 170 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getStatusInfo:()Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 70 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getStatusTimestamp:()Ljava/time/Instant;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 72 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getTags:()Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getUnsavedEvents:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 174 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.getVersion:()J" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 63 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 57 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.isRegistered:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 163 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.lambda$apply$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 199 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.lambda$updateTags$1:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 269 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.nextVersion:()J" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 248 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.register:(Lde/codecentric/boot/admin/server/domain/values/Registration;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 117, + 118, + 119, + 122, + 123, + 126 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.updateBuildVersion:([Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/BuildVersion;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 264 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.updateTags:([Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 269 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.withEndpoints:(Lde/codecentric/boot/admin/server/domain/values/Endpoints;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 153, + 154, + 155, + 156, + 157, + 159 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.withInfo:(Lde/codecentric/boot/admin/server/domain/values/Info;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 137, + 138, + 139, + 141 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.Instance.withStatusInfo:(Lde/codecentric/boot/admin/server/domain/values/StatusInfo;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 145, + 146, + 147, + 149 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.InstanceRepository.compute:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/util/function/BiFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.domain.entities.InstanceRepository.computeIfPresent:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/util/function/BiFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.domain.entities.InstanceRepository.find:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.domain.entities.InstanceRepository.findAll:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.domain.entities.InstanceRepository.findByName:(Ljava/lang/String;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.domain.entities.InstanceRepository.save:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.:(Lde/codecentric/boot/admin/server/eventstore/InstanceEventStore;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55, + 45, + 47, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.find:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 66 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.findAll:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 61 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.lambda$find$0:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 71 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.lambda$find$1:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 67, + 68, + 71 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.lambda$rehydrateSnapshot$3:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 96, + 97, + 100 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.lambda$rehydrateSnapshot$4:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.lambda$save$2:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/eventstore/OptimisticLockingException;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 79 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.lambda$updateSnapshot$5:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lde/codecentric/boot/admin/server/domain/entities/Instance;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 108, + 109, + 110, + 112 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.rehydrateSnapshot:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.save:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.start:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 83, + 84 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.stop:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 87, + 88, + 89, + 91 + ] + }, + "de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository.updateSnapshot:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107, + 117, + 115, + 116, + 118 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;J)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 42, + 43 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLde/codecentric/boot/admin/server/domain/values/Endpoints;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Endpoints;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent.getEndpoints:()Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/lang/String;Ljava/time/Instant;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.getInstance:()Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.getTimestamp:()Ljava/time/Instant;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 40 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.getType:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.getVersion:()J" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceEvent.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLde/codecentric/boot/admin/server/domain/values/Info;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Info;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent.getInfo:()Lde/codecentric/boot/admin/server/domain/values/Info;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLde/codecentric/boot/admin/server/domain/values/Registration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Registration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent.getRegistration:()Lde/codecentric/boot/admin/server/domain/values/Registration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLde/codecentric/boot/admin/server/domain/values/Registration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Registration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 46, + 47, + 48 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent.getRegistration:()Lde/codecentric/boot/admin/server/domain/values/Registration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLde/codecentric/boot/admin/server/domain/values/StatusInfo;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/StatusInfo;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent.getStatusInfo:()Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 50 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 33, + 34, + 35, + 38, + 40 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.compareTo:(Lde/codecentric/boot/admin/server/domain/values/BuildVersion;)I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 83, + 84, + 85, + 87, + 89, + 90, + 93, + 95, + 96, + 106, + 96, + 98, + 100, + 101, + 106, + 101, + 103, + 104, + 106, + 104, + 106, + 83, + 106, + 83, + 107 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.compareTo:(Ljava/lang/Object;)I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.from:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/BuildVersion;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 48, + 49, + 52, + 53, + 54, + 55, + 56, + 60, + 61, + 62, + 65, + 66, + 67, + 69 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.getValue:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 73 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.domain.values.BuildVersion.valueOf:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/BuildVersion;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint.:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 58, + 59, + 60, + 61, + 62, + 63 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint.getId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint.getUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 56 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint.of:(Ljava/lang/String;Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Endpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 66 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoint.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 23 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints$UnmodifiableIterator.:(Ljava/util/Iterator;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T008", + "perMethodOutcome" : "T008", + "lineNumbers" : [ + 93, + 94, + 95 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints$UnmodifiableIterator.hasNext:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 99 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints$UnmodifiableIterator.next:()Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 104 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.:(Ljava/util/Collection;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 41, + 42, + 43, + 46, + 48 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.empty:()Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 64 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.get:(Ljava/lang/String;)Ljava/util/Optional;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 51 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.isPresent:(Ljava/lang/String;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.iterator:()Ljava/util/Iterator;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.of:(Ljava/util/Collection;)Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 72, + 73, + 75 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.single:(Ljava/lang/String;Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 68 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.stream:()Ljava/util/stream/Stream;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 86 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 34 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Endpoints.withEndpoint:(Ljava/lang/String;Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80, + 81, + 82 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Info.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.domain.values.Info.:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 38, + 39, + 40, + 43, + 45 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Info.empty:()Lde/codecentric/boot/admin/server/domain/values/Info;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Info.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Info.from:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/Info;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 48, + 49, + 51 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Info.getValues:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 59 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Info.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Info.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 31, + 32, + 33, + 34 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.compareTo:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.compareTo:(Ljava/lang/Object;)I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.getValue:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 26 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.of:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37 + ] + }, + "de.codecentric.boot.admin.server.domain.values.InstanceId.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.build:()Lde/codecentric/boot/admin/server/domain/values/Registration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.clearMetadata:()Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.healthUrl:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.managementUrl:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.metadata:(Ljava/lang/String;Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.metadata:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.name:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.serviceUrl:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.source:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration$Builder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 56, + 57, + 58, + 59, + 60, + 62, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.builder:()Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.checkUrl:(Ljava/lang/String;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 92, + 93, + 95, + 96 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.copyOf:(Lde/codecentric/boot/admin/server/domain/values/Registration;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.create:(Ljava/lang/String;Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 74 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.getHealthUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 45 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.getManagementUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.getMetadata:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 82 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.getName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 40 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.getServiceUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 48 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.getSource:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 50 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.toBuilder:()Lde/codecentric/boot/admin/server/domain/values/Registration$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Registration.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 37 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.:(Ljava/lang/String;Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 58, + 59, + 60, + 61, + 62 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.from:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 126, + 132, + 133, + 135, + 136, + 139 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.getDetails:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 101 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.getStatus:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.isDown:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 113 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.isOffline:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 109 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.isUnknown:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 117 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.isUp:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 105 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.ofDown:()Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 81 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.ofDown:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 93 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.ofOffline:()Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 85 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.ofOffline:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 97 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.ofUnknown:()Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 73 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.ofUp:()Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 77 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.ofUp:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.severity:()Ljava/util/Comparator;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.valueOf:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.domain.values.StatusInfo.valueOf:(Ljava/lang/String;Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.domain.values.Tags.:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 40, + 41, + 42, + 45, + 47 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.append:(Lde/codecentric/boot/admin/server/domain/values/Tags;)Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 54, + 55, + 56 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.empty:()Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 32 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.from:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 64 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.from:(Ljava/util/Map;Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69, + 70, + 73, + 74, + 75, + 76, + 79, + 80, + 81, + 82, + 83, + 84, + 80, + 87, + 88, + 89, + 90, + 87 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.getValues:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 50 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 32 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.lambda$from$0:(Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 82 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.lambda$from$1:(Ljava/lang/String;Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.lambda$from$2:(Ljava/lang/String;Ljava/util/Map$Entry;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 84 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.lambda$from$3:(Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.lambda$from$4:(Ljava/util/Map$Entry;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.lambda$toLinkedHashMap$5:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 96 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.toLinkedHashMap:(Ljava/util/function/Function;Ljava/util/function/Function;)Ljava/util/stream/Collector;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 95 + ] + }, + "de.codecentric.boot.admin.server.domain.values.Tags.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.:(ILjava/util/concurrent/ConcurrentMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 55, + 56, + 57, + 58 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.append:(Ljava/util/List;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 74 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.compact:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 119, + 120, + 121, + 122, + 123 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.createOptimisticLockException:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;J)Lde/codecentric/boot/admin/server/eventstore/OptimisticLockingException;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 126, + 127, + 126 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.doAppend:(Ljava/util/List;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 84, + 85, + 88, + 89, + 90, + 93, + 96, + 97, + 98, + 101, + 102, + 104, + 105, + 106, + 109, + 110, + 111, + 114, + 115 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.find:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.findAll:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 62 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.getLastVersion:(Ljava/util/List;)J" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 131 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.lambda$append$2:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 76, + 77 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.lambda$compact$5:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 119 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.lambda$compact$6:(Ljava/util/Map;Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.lambda$doAppend$3:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.lambda$doAppend$4:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.lambda$find$1:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore.lambda$findAll$0:()Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 62, + 63, + 64, + 62 + ] + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore$1.:(Lde/codecentric/boot/admin/server/eventstore/HazelcastEventStore;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore$1.entryUpdated:(Lcom/hazelcast/core/EntryEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore$1.lambda$entryUpdated$0:(JLde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore.:(ILcom/hazelcast/map/IMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 47, + 59 + ] + }, + "de.codecentric.boot.admin.server.eventstore.HazelcastEventStore.:(Lcom/hazelcast/map/IMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InMemoryEventStore.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 34, + 35 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InMemoryEventStore.:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InMemoryEventStore.append:(Ljava/util/List;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InMemoryEventStore.lambda$append$0:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 38, + 42, + 43, + 44 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher.lambda$new$0:(Lreactor/core/publisher/SignalType;Lreactor/core/publisher/Sinks$EmitResult;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38, + 39, + 38 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher.lambda$publish$1:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 48, + 49, + 50 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher.publish:(Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 47, + 51 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher.subscribe:(Lorg/reactivestreams/Subscriber;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 55, + 56 + ] + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventStore.append:(Ljava/util/List;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventStore.find:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.eventstore.InstanceEventStore.findAll:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.eventstore.OptimisticLockingException.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 22, + 23 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 41, + 39, + 42, + 43 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.getLogger:()Lorg/slf4j/Logger;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 65 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.isEnabled:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 73 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.lambda$notify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 52 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.lambda$notify$1:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 53 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.lambda$notify$2:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.notify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 47, + 48, + 51, + 52, + 53, + 54, + 55, + 51 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.setEnabled:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69, + 70 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractEventNotifier.shouldNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 59 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 48, + 39, + 45, + 49 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.getIgnoreChanges:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.getLastStatus:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 70 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.lambda$notify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 53 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.notify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 53 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.setIgnoreChanges:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 83, + 84, + 85, + 86 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.shouldNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 62, + 66 + ] + }, + "de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier.updateLastStatus:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 74, + 75, + 77, + 78, + 80 + ] + }, + "de.codecentric.boot.admin.server.notify.CompositeNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.CompositeNotifier.:(Ljava/lang/Iterable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38, + 39, + 40, + 41 + ] + }, + "de.codecentric.boot.admin.server.notify.CompositeNotifier.lambda$notify$0:(Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.notify.CompositeNotifier.lambda$notify$1:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/notify/Notifier;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 45 + ] + }, + "de.codecentric.boot.admin.server.notify.CompositeNotifier.notify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 48, + 45 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 72, + 54, + 73, + 74, + 75 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.buildUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 84, + 85 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.createMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89, + 90, + 92, + 93, + 94, + 96, + 97, + 98 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80, + 79 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.getMessage:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 149 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.getSecret:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 141 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.getSign:(Ljava/lang/Long;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 115, + 116, + 117, + 118, + 119, + 121, + 122, + 124 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.getText:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.getWebhookUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 132 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 153, + 154 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 128, + 129 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.setSecret:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 145, + 146 + ] + }, + "de.codecentric.boot.admin.server.notify.DingTalkNotifier.setWebhookUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 136, + 137 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 82, + 51, + 67, + 83, + 84, + 85 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.createContent:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.createDiscordNotification:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 97, + 98, + 99, + 101, + 102, + 104, + 105, + 108, + 109, + 110, + 111 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89, + 90, + 92 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.getAvatarUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 155 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.getMessage:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 163 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.getUsername:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 146 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.getWebhookUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 129 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.isTts:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 93 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.setAvatarUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 159, + 160 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 167, + 168 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 171, + 172 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.setTts:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 141, + 142 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.setUsername:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 150, + 151 + ] + }, + "de.codecentric.boot.admin.server.notify.DiscordNotifier.setWebhookUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 133, + 134 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$Card.:(Lde/codecentric/boot/admin/server/notify/FeiShuNotifier;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 283, + 288, + 290 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$Card.getThemeColor:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 301 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$Card.getTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 293 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$Card.setThemeColor:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 305, + 306 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$Card.setTitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 297, + 298 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$MessageType.$values:()[Lde/codecentric/boot/admin/server/notify/FeiShuNotifier$MessageType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 277 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$MessageType.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$MessageType.:(Ljava/lang/String;I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 277 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$MessageType.valueOf:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/notify/FeiShuNotifier$MessageType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 277 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier$MessageType.values:()[Lde/codecentric/boot/admin/server/notify/FeiShuNotifier$MessageType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 277 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 100, + 65, + 67, + 82, + 92, + 97, + 101, + 102, + 103 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.createCardContent:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 179, + 180, + 182, + 183, + 184, + 185, + 186, + 187, + 189, + 190, + 191, + 193, + 194, + 195, + 196, + 197, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 208, + 209, + 210, + 211 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.createContent:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 159, + 160, + 161, + 162, + 163, + 164, + 165 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.createNotification:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 133, + 134, + 135, + 136, + 137, + 138, + 140, + 141, + 143, + 144, + 146, + 147, + 150, + 152, + 153, + 154, + 155 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.createTextContent:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 169, + 170, + 171, + 172, + 174, + 175 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107, + 108, + 110 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.generateSign:(Ljava/lang/String;J)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 120, + 121, + 122, + 123, + 124, + 126, + 127, + 129 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.getCard:()Lde/codecentric/boot/admin/server/notify/FeiShuNotifier$Card;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 270 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.getMessage:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 234 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.getMessageType:()Lde/codecentric/boot/admin/server/notify/FeiShuNotifier$MessageType;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 262 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.getSecret:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 254 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.getWebhookUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 226 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.isAtAll:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 246 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 111, + 112, + 111, + 113, + 114, + 113, + 115 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.setAtAll:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 250, + 251 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.setCard:(Lde/codecentric/boot/admin/server/notify/FeiShuNotifier$Card;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 274, + 275 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 238, + 239 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.setMessageType:(Lde/codecentric/boot/admin/server/notify/FeiShuNotifier$MessageType;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 266, + 267 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 242, + 243 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.setSecret:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 258, + 259 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.setWebhookUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 230, + 231 + ] + }, + "de.codecentric.boot.admin.server.notify.FeiShuNotifier.toJsonString:(Ljava/lang/Object;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 216, + 217, + 219, + 220, + 222 + ] + }, + "de.codecentric.boot.admin.server.notify.HazelcastNotificationTrigger.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.HazelcastNotificationTrigger.:(Lde/codecentric/boot/admin/server/notify/Notifier;Lorg/reactivestreams/Publisher;Ljava/util/concurrent/ConcurrentMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37, + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.notify.HazelcastNotificationTrigger.sendNotifications:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 44, + 45, + 46, + 47, + 50, + 51, + 52, + 53, + 57, + 58, + 59, + 62 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 84, + 51, + 76, + 85, + 86, + 87 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.buildUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 96, + 97, + 99 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.createHipChatNotification:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 103, + 104, + 105, + 106, + 107, + 109, + 110, + 111 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 91 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.getAuthToken:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 152 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.getColor:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 132, + 133, + 134, + 133, + 137 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.getDescription:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 177 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.getMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.getNotify:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 115 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.getRoomId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 161 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.getUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 143 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.isNotify:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 169 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 92 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.setAuthToken:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 156, + 157 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.setDescription:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 181, + 182 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.setNotify:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 173, + 174 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 185, + 186 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.setRoomId:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 165, + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.HipchatNotifier.setUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 147, + 148 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 85, + 52, + 77, + 86, + 87, + 88 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.createMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 111, + 112, + 113 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.createUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 104, + 105, + 107 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 92, + 93, + 96, + 97, + 98, + 99 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.getMessage:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 169 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.getRoom:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 152 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.getText:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.getToken:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 161 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.getUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 135 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.getUsername:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 143 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 99, + 100, + 99 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 173, + 174 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 130, + 131 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.setRoom:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 156, + 157 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.setToken:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 165, + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.setUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 139, + 140 + ] + }, + "de.codecentric.boot.admin.server.notify.LetsChatNotifier.setUsername:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 147, + 148 + ] + }, + "de.codecentric.boot.admin.server.notify.LoggingNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.LoggingNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.notify.LoggingNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.notify.LoggingNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 44, + 45, + 46, + 45, + 49, + 50, + 49, + 52 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.:(Lorg/springframework/mail/javamail/JavaMailSender;Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/thymeleaf/TemplateEngine;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 82, + 53, + 58, + 63, + 68, + 79, + 83, + 84, + 85 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getAdditionalProperties:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 163 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getBaseUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 155 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getBody:(Lorg/thymeleaf/context/Context;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 114 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getCc:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 130 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getFrom:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 138 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getSubject:(Lorg/thymeleaf/context/Context;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 118 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getTemplate:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 146 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.getTo:()[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90, + 91, + 92, + 93, + 94, + 95, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 109, + 107, + 108, + 110 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.setAdditionalProperties:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 167, + 168 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.setBaseUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 159, + 160 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.setCc:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 134, + 135 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.setFrom:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 142, + 143 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.setTemplate:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 150, + 151 + ] + }, + "de.codecentric.boot.admin.server.notify.MailNotifier.setTo:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 126, + 127 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact.:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 336 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 336 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 336 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact.getName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 339 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact.getValue:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 342 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 336 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Fact.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 336 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder.build:()Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder.sections:(Ljava/util/List;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message$MessageBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder.summary:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message$MessageBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder.themeColor:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message$MessageBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder.title:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message$MessageBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message$MessageBuilder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.$default$sections:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.builder:()Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message$MessageBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 309 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 308 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 308 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.getSections:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 319 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.getSummary:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 312 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.getThemeColor:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 314 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.getTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 316 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 308 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Message.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 308 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section$SectionBuilder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section$SectionBuilder.activitySubtitle:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Section$SectionBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section$SectionBuilder.activityTitle:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Section$SectionBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section$SectionBuilder.build:()Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Section;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section$SectionBuilder.facts:(Ljava/util/List;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Section$SectionBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section$SectionBuilder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.$default$facts:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.:(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.builder:()Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Section$SectionBuilder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 323 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 323 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.getActivitySubtitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 329 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.getActivityTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 327 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.getFacts:()Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 332 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 323 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier$Section.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 323 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 131, + 75, + 113, + 118, + 123, + 128, + 132, + 133, + 134, + 136, + 138, + 140 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.createEvaluationContext:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/expression/EvaluationContext;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 219, + 220, + 221, + 222, + 223, + 224, + 225, + 226, + 223 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.createMessage:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/String;Ljava/lang/String;Lorg/springframework/expression/EvaluationContext;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 193, + 194, + 195, + 196, + 197, + 198, + 200, + 201, + 202, + 203, + 204, + 206, + 207, + 208, + 209, + 210, + 211, + 206 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 145, + 146, + 147, + 149, + 150, + 152, + 153, + 156, + 159, + 160, + 162, + 163, + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.evaluateExpression:(Lorg/springframework/expression/EvaluationContext;Lorg/springframework/expression/Expression;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 215 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getDeRegisteredTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 273 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getDeregisterActivitySubtitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 247 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getDeregisteredMessage:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/expression/EvaluationContext;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 177, + 178 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getMessageSummary:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 297 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getRegisterActivitySubtitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 256 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getRegisteredMessage:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/expression/EvaluationContext;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 182, + 183 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getRegisteredTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 281 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getStatusActivitySubtitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 265 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getStatusChangedMessage:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/expression/EvaluationContext;)Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 187, + 188 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getStatusChangedTitle:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 289 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getThemeColor:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 239 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.getWebhookUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 231 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier$Message;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setDeRegisteredTitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 277, + 278 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setDeregisterActivitySubtitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 251, + 253 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setMessageSummary:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 301, + 302 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setRegisterActivitySubtitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 260, + 262 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setRegisteredTitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 285, + 286 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 305, + 306 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setStatusActivitySubtitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 269, + 270 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setStatusChangedTitle:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 293, + 294 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setThemeColor:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 243, + 244 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.setWebhookUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 235, + 236 + ] + }, + "de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.shouldNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 172, + 173, + 172 + ] + }, + "de.codecentric.boot.admin.server.notify.NotificationTrigger.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.NotificationTrigger.:(Lde/codecentric/boot/admin/server/notify/Notifier;Lorg/reactivestreams/Publisher;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 35, + 36, + 37 + ] + }, + "de.codecentric.boot.admin.server.notify.NotificationTrigger.handle:(Lreactor/core/publisher/Flux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41 + ] + }, + "de.codecentric.boot.admin.server.notify.NotificationTrigger.lambda$sendNotifications$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.notify.NotificationTrigger.lambda$sendNotifications$1:(Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.notify.NotificationTrigger.sendNotifications:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 46, + 47, + 45 + ] + }, + "de.codecentric.boot.admin.server.notify.Notifier.notify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.getHost:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 28 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.getPassword:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.getPort:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.getUsername:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.setHost:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.setPassword:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.setPort:(I)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.setUsername:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.NotifierProxyProperties.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 21 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107, + 54, + 61, + 108, + 109, + 110 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.buildUrl:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 119, + 120, + 121, + 123 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.createRequest:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 127, + 129, + 130, + 132, + 133, + 136, + 137, + 139, + 140, + 141, + 142, + 143, + 145, + 146, + 148, + 149, + 152, + 153, + 154, + 155, + 156, + 159, + 160, + 161, + 162 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 114 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.generateAlias:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getActions:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 211 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getApiKey:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 190 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getDescription:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 183, + 184, + 185, + 183 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getEntity:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 238 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getMessage:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 202 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 171, + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 179 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getSource:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 220 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getTags:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 229 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 255 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.getUser:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 247 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 114, + 115, + 114 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setActions:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 215, + 216 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setApiKey:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 194, + 195 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setDescription:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 198, + 199 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setEntity:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 242, + 243 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 206, + 207 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setSource:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 224, + 225 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setTags:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 233, + 234 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 259, + 260 + ] + }, + "de.codecentric.boot.admin.server.notify.OpsGenieNotifier.setUser:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 251, + 252 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 85, + 52, + 59, + 86, + 87, + 88 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.createPagerdutyEvent:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 97, + 98, + 99, + 100, + 102, + 103, + 105, + 106, + 107, + 110, + 111, + 112, + 114, + 115, + 118, + 119, + 120, + 121, + 122, + 126 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 92, + 93, + 92 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.getClient:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 161 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.getClientUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 170 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.getDescription:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 187 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.getDescription:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.getDetails:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 143, + 144, + 145, + 146, + 148 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.getServiceKey:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 179 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.getUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 152 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 93 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.setClient:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 165, + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.setClientUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 174, + 175 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.setDescription:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 191, + 192 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 195, + 196 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.setServiceKey:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 183, + 184 + ] + }, + "de.codecentric.boot.admin.server.notify.PagerdutyNotifier.setUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 156, + 157 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier$Reminder.:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T008", + "perMethodOutcome" : "T008", + "lineNumbers" : [ + 158, + 159, + 160, + 161 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier$Reminder.getEvent:()Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 172 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier$Reminder.getLastNotification:()Ljava/time/Instant;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 168 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier$Reminder.setLastNotification:(Ljava/time/Instant;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 164, + 165 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.:(Lde/codecentric/boot/admin/server/notify/Notifier;Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69, + 52, + 56, + 58, + 60, + 70, + 71, + 72 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 76, + 83, + 76 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lreactor/core/publisher/SignalType;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 77, + 78, + 80, + 81, + 83 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$doNotify$1:(Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$sendReminders$5:(Ljava/time/Instant;Lde/codecentric/boot/admin/server/notify/RemindingNotifier$Reminder;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 113 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$sendReminders$6:(Lde/codecentric/boot/admin/server/notify/RemindingNotifier$Reminder;Ljava/time/Instant;Ljava/lang/Void;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 115 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$sendReminders$7:(Ljava/time/Instant;Lde/codecentric/boot/admin/server/notify/RemindingNotifier$Reminder;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 114, + 115, + 114 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$start$2:(Lorg/reactivestreams/Subscription;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$start$3:(Ljava/lang/Long;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 91 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.lambda$start$4:(Lreactor/util/retry/Retry$RetrySignal;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 93 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.sendReminders:()Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 110, + 112, + 113, + 114, + 116, + 112 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.setCheckReminderInverval:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 149, + 150 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.setReminderPeriod:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 139, + 140 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.setReminderStatuses:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 143, + 144, + 145, + 146 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.shouldEndReminder:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 128, + 129, + 131, + 132, + 133, + 132, + 135 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.shouldStartReminder:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 120, + 121, + 122, + 121, + 124 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.start:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 92, + 94, + 95 + ] + }, + "de.codecentric.boot.admin.server.notify.RemindingNotifier.stop:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 98, + 99, + 100, + 101, + 103, + 104, + 105, + 107 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 83, + 50, + 84, + 85, + 86 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.createMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 106, + 107, + 108, + 109, + 110, + 111 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 90, + 91, + 92, + 93, + 94 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.getMessage:()Lorg/springframework/expression/Expression;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 169 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.getRoomId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 143 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.getText:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.getToken:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 152 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.getUri:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 99, + 100, + 102 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.getUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 134 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.getUserId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 161 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 94, + 95, + 94 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 173, + 174 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 129, + 130 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.setRoomId:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 147, + 148 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.setToken:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 156, + 157 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.setUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 138, + 139 + ] + }, + "de.codecentric.boot.admin.server.notify.RocketChatNotifier.setUserId:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 165, + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 86, + 52, + 77, + 87, + 88, + 89 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.createMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 105, + 106, + 107, + 108, + 110, + 111, + 114, + 115, + 116, + 117, + 118, + 120, + 121, + 122 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 93, + 94, + 96, + 97, + 96 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.getChannel:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 160 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.getColor:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 140, + 141, + 142, + 141, + 145 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.getIcon:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 169 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.getMessage:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 186 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.getText:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 136 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.getUsername:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 178 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.getWebhookUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 151 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 97 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.setChannel:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 164, + 165 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.setIcon:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 173, + 174 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 190, + 191 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 101, + 102 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.setUsername:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 182, + 183 + ] + }, + "de.codecentric.boot.admin.server.notify.SlackNotifier.setWebhookUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 155, + 156 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 43, + 50, + 69, + 74, + 80, + 81, + 82 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.buildUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 91 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.createMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 96, + 97, + 98, + 99, + 100, + 101 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 86, + 87, + 86 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.getApiUrl:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 123 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.getAuthToken:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 141 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.getChatId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 132 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.getParseMode:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.getText:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 115 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.isDisableNotify:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 149 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 87 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.setApiUrl:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 127, + 128 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.setAuthToken:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 145, + 146 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.setChatId:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 136, + 137 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.setDisableNotify:(Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 153, + 154 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 165, + 166 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.setParseMode:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 161, + 162 + ] + }, + "de.codecentric.boot.admin.server.notify.TelegramNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 119, + 120 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 90, + 63, + 77, + 91, + 92, + 93 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.createMessage:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 127, + 128, + 129, + 130 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 105, + 106, + 109, + 110, + 111, + 113, + 115 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.getAuthToken:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 167 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.getMessage:()Lorg/springframework/expression/Expression;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 184 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.getRoomId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 176 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.getText:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 150 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.getUrl:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.lambda$doNotify$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 115, + 116, + 115 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.setAuthToken:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 171, + 172 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.setMessage:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 188, + 189 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.setRestTemplate:(Lorg/springframework/web/client/RestTemplate;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 154, + 155 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.setRoomId:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 180, + 181 + ] + }, + "de.codecentric.boot.admin.server.notify.WebexNotifier.setUrl:(Ljava/net/URI;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 162, + 163 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.AbstractNotificationFilter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.filter.AbstractNotificationFilter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 27, + 28, + 29 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.AbstractNotificationFilter.getId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ApplicationNameNotificationFilter.:(Ljava/lang/String;Ljava/time/Instant;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 31, + 32, + 33 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ApplicationNameNotificationFilter.doFilter:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ApplicationNameNotificationFilter.getApplicationName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 41 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ApplicationNameNotificationFilter.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T020", + "perMethodOutcome" : "T020", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ExpiringNotificationFilter.:(Ljava/time/Instant;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 31, + 32, + 33 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ExpiringNotificationFilter.doFilter:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.notify.filter.ExpiringNotificationFilter.filter:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ExpiringNotificationFilter.getExpiry:()Ljava/time/Instant;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 48 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.ExpiringNotificationFilter.isExpired:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.:(Lde/codecentric/boot/admin/server/notify/Notifier;Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 58, + 49, + 53, + 55, + 59, + 60, + 61 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.addFilter:(Lde/codecentric/boot/admin/server/notify/filter/NotificationFilter;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 100, + 101, + 102 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.cleanUp:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 85, + 86, + 87, + 89, + 90, + 91, + 92, + 93, + 94, + 96, + 97 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.doNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 70 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.filter:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 74, + 75, + 76, + 77, + 78, + 80, + 81 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.getNotificationFilters:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 111 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.removeFilter:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/notify/filter/NotificationFilter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 106, + 107 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.setCleanupInterval:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 115, + 116 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.FilteringNotifier.shouldNotify:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.InstanceIdNotificationFilter.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/time/Instant;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 32, + 33, + 34 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.InstanceIdNotificationFilter.doFilter:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.InstanceIdNotificationFilter.getInstanceId:()Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T001", + "perMethodOutcome" : "T001", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.InstanceIdNotificationFilter.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T020", + "perMethodOutcome" : "T020", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.NotificationFilter.filter:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.notify.filter.NotificationFilter.getId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.notify.filter.web.NotificationFilterController.:(Lde/codecentric/boot/admin/server/notify/filter/FilteringNotifier;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 52, + 53, + 54 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.web.NotificationFilterController.addFilter:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;)Lorg/springframework/http/ResponseEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 66, + 67, + 68, + 71 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.web.NotificationFilterController.createFilter:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/lang/String;Ljava/lang/Long;)Lde/codecentric/boot/admin/server/notify/filter/NotificationFilter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 87, + 88, + 89, + 92 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.web.NotificationFilterController.deleteFilter:(Ljava/lang/String;)Lorg/springframework/http/ResponseEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 77, + 78, + 79, + 82 + ] + }, + "de.codecentric.boot.admin.server.notify.filter.web.NotificationFilterController.getFilters:()Ljava/util/Collection;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 58 + ] + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler.:(Lorg/reactivestreams/Publisher;Ljava/lang/Class;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 46, + 34, + 47, + 48, + 49 + ] + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler.createScheduler:()Lreactor/core/scheduler/Scheduler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 67 + ] + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler.handle:(Lreactor/core/publisher/Flux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler.lambda$start$0:(Lorg/reactivestreams/Subscription;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 56 + ] + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler.lambda$start$1:(Ljava/lang/Throwable;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler.start:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62 + ] + }, + "de.codecentric.boot.admin.server.services.AbstractEventHandler.stop:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 71, + 72, + 73, + 75, + 76, + 77, + 79 + ] + }, + "de.codecentric.boot.admin.server.services.ApiMediaTypeHandler.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 24 + ] + }, + "de.codecentric.boot.admin.server.services.ApiMediaTypeHandler.isApiMediaType:(Lorg/springframework/http/MediaType;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 27, + 28, + 29, + 27 + ] + }, + "de.codecentric.boot.admin.server.services.ApiMediaTypeHandler.lambda$isApiMediaType$0:(Lorg/springframework/http/MediaType;Lorg/springframework/util/MimeType;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.:(Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/eventstore/InstanceEventPublisher;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 55, + 56, + 57, + 58 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.deregister:(Ljava/lang/String;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89, + 90, + 89 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.getApplication:(Ljava/lang/String;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 77, + 78, + 77 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.getApplicationForInstance:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/util/function/Tuple2;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 94, + 95 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.getApplicationStream:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 82, + 83, + 84, + 85, + 82 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.getApplications:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 66, + 67, + 68, + 65 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.getBuildVersion:(Ljava/util/List;)Lde/codecentric/boot/admin/server/domain/values/BuildVersion;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 121, + 122, + 125 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.getMax:(Ljava/time/Instant;Ljava/time/Instant;)Ljava/time/Instant;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.getStatus:(Ljava/util/List;)Lreactor/util/function/Tuple2;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 131, + 132, + 134, + 135, + 136, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 150, + 151, + 152, + 153, + 154, + 150 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$deregister$5:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getApplication$2:(Lde/codecentric/boot/admin/server/domain/entities/Application;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getApplicationStream$3:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getApplicationStream$4:(Lreactor/util/function/Tuple2;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 85 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getApplications$0:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 67 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getApplications$1:(Lreactor/core/publisher/GroupedFlux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 68 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getStatus$7:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 132 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getStatus$8:(Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$getStatus$9:(Ljava/util/Map$Entry;)Lreactor/util/function/Tuple2;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 153 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.lambda$toApplication$6:(Ljava/lang/String;Ljava/util/List;)Lde/codecentric/boot/admin/server/domain/entities/Application;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 101 + ] + }, + "de.codecentric.boot.admin.server.services.ApplicationRegistry.toApplication:(Ljava/lang/String;Lreactor/core/publisher/Flux;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 99 + ] + }, + "de.codecentric.boot.admin.server.services.CloudFoundryInstanceIdGenerator.:(Lde/codecentric/boot/admin/server/services/InstanceIdGenerator;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 34, + 35, + 36 + ] + }, + "de.codecentric.boot.admin.server.services.CloudFoundryInstanceIdGenerator.generateId:(Lde/codecentric/boot/admin/server/domain/values/Registration;)Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 40, + 41, + 43, + 44, + 46 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetectionTrigger.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.EndpointDetectionTrigger.:(Lde/codecentric/boot/admin/server/services/EndpointDetector;Lorg/reactivestreams/Publisher;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 36, + 37, + 38 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetectionTrigger.detectEndpoints:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 49 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetectionTrigger.handle:(Lreactor/core/publisher/Flux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 42, + 43, + 45, + 42 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetectionTrigger.lambda$detectEndpoints$1:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 50, + 51 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetectionTrigger.lambda$handle$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetector.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.EndpointDetector.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/services/endpoints/EndpointDetectionStrategy;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 40, + 41, + 42, + 43 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetector.detectEndpoints:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetector.doDetectEndpoints:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 50, + 51, + 52, + 54, + 55 + ] + }, + "de.codecentric.boot.admin.server.services.EndpointDetector.lambda$detectEndpoints$0:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator.encodeHex:([BII)[C" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 47, + 48, + 49, + 50, + 51, + 48, + 53 + ] + }, + "de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator.generateId:(Lde/codecentric/boot/admin/server/domain/values/Registration;)Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37, + 38, + 39, + 41, + 42 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.:(Lde/codecentric/boot/admin/server/services/InfoUpdater;Lorg/reactivestreams/Publisher;Ljava/time/Duration;Ljava/time/Duration;Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 43, + 44, + 45, + 46 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.handle:(Lreactor/core/publisher/Flux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 50, + 51, + 53, + 50 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.lambda$handle$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 51 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.lambda$handle$1:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 53 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.lambda$updateInfo$2:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58, + 59 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.lambda$updateInfo$3:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lreactor/core/publisher/SignalType;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.setInterval:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 76, + 77 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.setLifetime:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 80, + 81 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.start:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 66, + 67 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.stop:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 71, + 72, + 73 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdateTrigger.updateInfo:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 57, + 60, + 57 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;Lde/codecentric/boot/admin/server/services/ApiMediaTypeHandler;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 56, + 57, + 58, + 59, + 60 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.convertInfo:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/Throwable;)Lde/codecentric/boot/admin/server/domain/values/Info;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 97, + 98 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.convertInfo:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 85, + 86, + 87, + 89, + 90, + 92, + 93 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.doUpdateInfo:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 67, + 68, + 70, + 71, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 75 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.lambda$convertInfo$3:(Lorg/springframework/http/MediaType;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 87, + 88, + 87 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.lambda$doUpdateInfo$1:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.lambda$doUpdateInfo$2:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.lambda$updateInfo$0:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 63 + ] + }, + "de.codecentric.boot.admin.server.services.InfoUpdater.updateInfo:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 63 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceFilter.filter:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.services.InstanceIdGenerator.generateId:(Lde/codecentric/boot/admin/server/domain/values/Registration;)Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/services/InstanceIdGenerator;Lde/codecentric/boot/admin/server/services/InstanceFilter;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 41, + 42, + 43, + 44, + 45 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.deregister:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 96, + 97, + 96 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.getInstance:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 87 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.getInstances:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.getInstances:(Ljava/lang/String;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.lambda$deregister$1:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 96 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.lambda$register$0:(Lde/codecentric/boot/admin/server/domain/values/Registration;Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 57, + 58, + 60 + ] + }, + "de.codecentric.boot.admin.server.services.InstanceRegistry.register:(Lde/codecentric/boot/admin/server/domain/values/Registration;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 53, + 54, + 55, + 56, + 61, + 56 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.:(Ljava/lang/String;Ljava/util/function/Function;Ljava/time/Duration;Ljava/time/Duration;Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 72, + 51, + 73, + 74, + 75, + 76, + 77, + 78 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.checkAllInstances:()Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 100 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.getInterval:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.lambda$checkAllInstances$4:(Ljava/time/Instant;Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 101 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.lambda$start$0:(Lorg/reactivestreams/Subscription;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.lambda$start$1:(Ljava/lang/Long;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 86 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.lambda$start$2:(Lreactor/util/retry/Retry$RetrySignal;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 89 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.lambda$start$3:(Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 90 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.markAsChecked:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 94, + 95 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.setInterval:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 59 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.setMaxBackoff:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 55 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.setMinRetention:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 62 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.start:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 87, + 90, + 91 + ] + }, + "de.codecentric.boot.admin.server.services.IntervalCheck.stop:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 108, + 109, + 110, + 112, + 113, + 114, + 116 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.:(Lde/codecentric/boot/admin/server/services/StatusUpdater;Lorg/reactivestreams/Publisher;Ljava/time/Duration;Ljava/time/Duration;Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 42, + 43, + 44, + 46 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.handle:(Lreactor/core/publisher/Flux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 50, + 51, + 53, + 50 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.lambda$handle$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 51 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.lambda$handle$1:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 53 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.lambda$updateStatus$2:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 60, + 61 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.lambda$updateStatus$3:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lreactor/core/publisher/SignalType;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 63 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.setInterval:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.setLifetime:(Ljava/time/Duration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 83, + 84 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.start:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 68, + 69, + 70 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.stop:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 74, + 75, + 76 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdateTrigger.updateStatus:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 57, + 58, + 59, + 63, + 57 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.:(Lde/codecentric/boot/admin/server/domain/entities/InstanceRepository;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;Lde/codecentric/boot/admin/server/services/ApiMediaTypeHandler;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 51, + 63, + 51 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.convertStatusInfo:(Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 100, + 101, + 102, + 104, + 106, + 107, + 108, + 113, + 108, + 115 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.doUpdateStatus:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 75, + 76, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 80 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.getStatusInfoFromStatus:(Lorg/springframework/http/HttpStatusCode;Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 120, + 121, + 123, + 124, + 125, + 126, + 127, + 130, + 132 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.getTimeoutWithMargin:()Ljava/time/Duration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 96 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.handleError:(Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 136, + 137, + 138, + 139 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.lambda$convertStatusInfo$2:(Lorg/springframework/http/MediaType;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 102, + 103, + 102 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.lambda$convertStatusInfo$3:(Lorg/springframework/web/reactive/function/client/ClientResponse;Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 109, + 110, + 112 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.lambda$doUpdateStatus$1:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 86 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.lambda$updateStatus$0:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 71 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.logError:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 143, + 144, + 147, + 149 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.timeout:(Ljava/time/Duration;)Lde/codecentric/boot/admin/server/services/StatusUpdater;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 66, + 67 + ] + }, + "de.codecentric.boot.admin.server.services.StatusUpdater.updateStatus:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 71 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ChainingStrategy.:([Lde/codecentric/boot/admin/server/services/endpoints/EndpointDetectionStrategy;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 29, + 30, + 31, + 32, + 33 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ChainingStrategy.detectEndpoints:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37, + 38, + 39, + 38, + 41 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.EndpointDetectionStrategy.detectEndpoints:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.:(Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;Lde/codecentric/boot/admin/server/domain/values/Endpoint;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 124 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 124 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 124 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.getDefinition:()Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.getEndpoint:()Lde/codecentric/boot/admin/server/domain/values/Endpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 129 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 124 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.of:(Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;Ljava/lang/String;)Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$DetectedEndpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 132 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$DetectedEndpoint.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 124 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.create:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 145, + 146, + 147, + 150, + 151, + 150 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.getId:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.getPath:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 142 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy$EndpointDefinition.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.:(Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;[Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 52, + 53, + 54, + 55, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.convert:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;Ljava/net/URI;)Ljava/util/function/Function;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 92 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.convert:(Ljava/util/List;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107, + 108, + 111, + 112, + 113, + 120, + 121 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.detectEndpoint:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 78 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.detectEndpoints:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 61, + 62, + 63, + 66, + 67, + 68, + 69, + 66 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.lambda$convert$2:(Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;Ljava/net/URI;Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 93, + 94, + 95, + 96, + 99, + 100, + 99, + 102 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.lambda$convert$3:(Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$DetectedEndpoint;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.lambda$convert$4:(Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$DetectedEndpoint;)I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 114 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.lambda$convert$5:(Ljava/util/List;)Lde/codecentric/boot/admin/server/domain/values/Endpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 114, + 115, + 116, + 117, + 116, + 119 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.lambda$detectEndpoint$1:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/net/URI;Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83, + 84, + 83, + 85, + 86 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.lambda$detectEndpoints$0:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategy$EndpointDefinition;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 67 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef.:(Ljava/lang/String;Z)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 141, + 142, + 143, + 144 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 133 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 133 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef.getHref:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 136 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 133 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef.isTemplated:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 138 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response$EndpointRef.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 133 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127, + 130 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response.getLinks:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 131 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response.setLinks:(Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.:(Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;Lde/codecentric/boot/admin/server/services/ApiMediaTypeHandler;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 50, + 51, + 52, + 53 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.alignWithManagementUrl:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/lang/String;)Ljava/util/function/Function;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 100 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.convert:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/String;)Ljava/util/function/Function;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 78 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.convertResponse:(Lde/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategy$Response;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 118, + 119, + 120, + 121, + 122, + 123, + 124 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.detectEndpoints:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 57, + 58, + 59, + 60, + 61, + 64, + 65, + 66, + 67, + 68, + 64 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.lambda$alignWithManagementUrl$2:(Lde/codecentric/boot/admin/server/domain/values/Endpoint;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 104 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.lambda$alignWithManagementUrl$3:(Lde/codecentric/boot/admin/server/domain/values/Endpoint;)Lde/codecentric/boot/admin/server/domain/values/Endpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.lambda$alignWithManagementUrl$4:(Ljava/lang/String;Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lde/codecentric/boot/admin/server/domain/values/Endpoints;)Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 101, + 102, + 104, + 105, + 107, + 111, + 112, + 113, + 111 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.lambda$convert$1:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/String;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 79, + 80, + 81, + 80, + 82, + 85, + 86, + 87, + 88, + 86, + 89, + 92, + 93, + 94, + 95, + 93 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.lambda$convertResponse$5:(Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.lambda$convertResponse$6:(Ljava/util/Map$Entry;)Lde/codecentric/boot/admin/server/domain/values/Endpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 122 + ] + }, + "de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.lambda$detectEndpoints$0:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Ljava/lang/String;Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 69, + 70, + 69, + 71, + 73 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.AdminServerModule.:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 56, + 58, + 59, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.BuildVersionMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.BuildVersionMixin.getValue:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.utils.jackson.BuildVersionMixin.valueOf:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/BuildVersion;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.EndpointMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.EndpointMixin.of:(Ljava/lang/String;Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/Endpoint;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.EndpointsMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 32 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.EndpointsMixin.of:(Ljava/util/Collection;)Lde/codecentric/boot/admin/server/domain/values/Endpoints;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InfoMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 32 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InfoMixin.from:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/Info;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InfoMixin.getValues:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceDeregisteredEventMixin.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 36, + 37 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceEndpointsDetectedEventMixin.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Endpoints;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 39, + 40 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceEventMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 44 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceIdMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceIdMixin.getValue:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceIdMixin.of:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceInfoChangedEventMixin.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Info;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceRegisteredEventMixin.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Registration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceRegistrationUpdatedEventMixin.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/Registration;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 39, + 40 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.InstanceStatusChangedEventMixin.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;JLjava/time/Instant;Lde/codecentric/boot/admin/server/domain/values/StatusInfo;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationBeanSerializerModifier.:(Lde/codecentric/boot/admin/server/utils/jackson/SanitizingMapSerializer;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 34, + 35, + 36 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationBeanSerializerModifier.changeProperties:(Lcom/fasterxml/jackson/databind/SerializationConfig;Lcom/fasterxml/jackson/databind/BeanDescription;Ljava/util/List;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41, + 42, + 45, + 46, + 47, + 48 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationBeanSerializerModifier.lambda$changeProperties$0:(Lcom/fasterxml/jackson/databind/ser/BeanPropertyWriter;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationBeanSerializerModifier.lambda$changeProperties$1:(Lcom/fasterxml/jackson/databind/ser/BeanPropertyWriter;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 47 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationDeserializer.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 35, + 36 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationDeserializer.deserialize:(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)Lde/codecentric/boot/admin/server/domain/values/Registration;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 40, + 41, + 43, + 45, + 46, + 47, + 48, + 50, + 51, + 52, + 55, + 56, + 57, + 58, + 59, + 60, + 63, + 65 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.RegistrationDeserializer.firstNonNullAsText:(Lcom/fasterxml/jackson/databind/JsonNode;[Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 69, + 70, + 71, + 69, + 74 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.:([Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 37, + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.createPatterns:([Ljava/lang/String;)[Ljava/util/regex/Pattern;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.lambda$createPatterns$0:(Ljava/lang/String;)Ljava/util/regex/Pattern;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.lambda$createPatterns$1:(I)[Ljava/util/regex/Pattern;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.lambda$sanitize$2:(Ljava/lang/String;Ljava/util/regex/Pattern;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 62 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.sanitize:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 57, + 58, + 61, + 62, + 63 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.serialize:(Ljava/lang/Object;Lcom/fasterxml/jackson/core/JsonGenerator;Lcom/fasterxml/jackson/databind/SerializerProvider;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 29 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.SanitizingMapSerializer.serialize:(Ljava/util/Map;Lcom/fasterxml/jackson/core/JsonGenerator;Lcom/fasterxml/jackson/databind/SerializerProvider;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 48, + 49, + 50, + 51, + 52, + 53 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.StatusInfoMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 33 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.StatusInfoMixin.isDown:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.utils.jackson.StatusInfoMixin.isOffline:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.utils.jackson.StatusInfoMixin.isUnknown:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.utils.jackson.StatusInfoMixin.isUp:()Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.utils.jackson.StatusInfoMixin.valueOf:(Ljava/lang/String;Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/StatusInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 38 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.TagsMixin.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.TagsMixin.from:(Ljava/util/Map;)Lde/codecentric/boot/admin/server/domain/values/Tags;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 35 + ] + }, + "de.codecentric.boot.admin.server.utils.jackson.TagsMixin.getValues:()Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.:(Lde/codecentric/boot/admin/server/services/ApplicationRegistry;Lorg/springframework/context/ApplicationEventPublisher;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 57, + 58, + 59, + 60 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.application:(Ljava/lang/String;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 74 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.applications:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 64 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.applicationsStream:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80, + 81, + 79 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.lambda$applicationsStream$1:(Lde/codecentric/boot/admin/server/domain/entities/Application;)Lorg/springframework/http/codec/ServerSentEvent;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.lambda$static$0:(Ljava/lang/Long;)Lorg/springframework/http/codec/ServerSentEvent;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 51 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.lambda$unregister$2:(Ljava/util/List;)Lorg/springframework/http/ResponseEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 89, + 90, + 89 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.ping:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 95 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.refreshApplications:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 69, + 70 + ] + }, + "de.codecentric.boot.admin.server.web.ApplicationsController.unregister:(Ljava/lang/String;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 86, + 87, + 88, + 89, + 87 + ] + }, + "de.codecentric.boot.admin.server.web.HttpHeaderFilter.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.web.HttpHeaderFilter.:(Ljava/util/Set;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 43, + 44, + 45, + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.web.HttpHeaderFilter.filterHeaders:(Lorg/springframework/http/HttpHeaders;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 50, + 51, + 52, + 53, + 54, + 51, + 55 + ] + }, + "de.codecentric.boot.admin.server.web.HttpHeaderFilter.includeHeader:(Ljava/lang/String;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 59 + ] + }, + "de.codecentric.boot.admin.server.web.HttpHeaderFilter.lambda$filterHeaders$0:(Ljava/util/Map$Entry;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 53 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder.body:(Lorg/springframework/web/reactive/function/BodyInserter;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder.build:()Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder.headers:(Lorg/springframework/http/HttpHeaders;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder.method:(Lorg/springframework/http/HttpMethod;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest$Builder.uri:(Ljava/net/URI;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.:(Ljava/net/URI;Lorg/springframework/http/HttpMethod;Lorg/springframework/http/HttpHeaders;Lorg/springframework/web/reactive/function/BodyInserter;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.builder:()Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.getBody:()Lorg/springframework/web/reactive/function/BodyInserter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 167 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.getHeaders:()Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 165 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.getMethod:()Lorg/springframework/http/HttpMethod;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 163 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.getUri:()Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 161 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$ForwardRequest.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 157 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder.body:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$InstanceResponse$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder.build:()Lde/codecentric/boot/admin/server/web/InstanceWebProxy$InstanceResponse;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder.contentType:(Ljava/lang/String;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$InstanceResponse$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder.instanceId:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$InstanceResponse$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder.status:(I)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$InstanceResponse$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse$Builder.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;ILjava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.builder:()Lde/codecentric/boot/admin/server/web/InstanceWebProxy$InstanceResponse$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 140 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 139 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 139 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.getBody:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 149 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.getContentType:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 153 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.getInstanceId:()Lde/codecentric/boot/admin/server/domain/values/InstanceId;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 143 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.getStatus:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 145 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 139 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy$InstanceResponse.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 139 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.:(Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 68, + 66, + 69, + 70 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.forward:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 100, + 101, + 102, + 103, + 104, + 106, + 107, + 108, + 111, + 115, + 111 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.forward:(Lreactor/core/publisher/Flux;Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 86 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.forward:(Lreactor/core/publisher/Mono;Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 74 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.lambda$forward$0:(Ljava/util/function/Function;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 80 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.lambda$forward$1:(Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;Ljava/util/function/Function;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 75, + 76, + 79 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.lambda$forward$2:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 91 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.lambda$forward$3:(Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 86 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.lambda$forward$4:(Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 104 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.lambda$forward$5:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;Ljava/util/function/Function;Lde/codecentric/boot/admin/server/web/client/exception/ResolveEndpointException;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112, + 113, + 112, + 114 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.lambda$forward$6:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;Ljava/util/function/Function;Ljava/lang/Throwable;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 116, + 117, + 118, + 120, + 121, + 122, + 121, + 123, + 124, + 123, + 126, + 127, + 128, + 127, + 129, + 131 + ] + }, + "de.codecentric.boot.admin.server.web.InstanceWebProxy.requiresBody:(Lorg/springframework/http/HttpMethod;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 136 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.web.InstancesController.:(Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/eventstore/InstanceEventStore;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 65, + 66, + 67, + 68 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.eventStream:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 141 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.events:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 136 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.instance:(Ljava/lang/String;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 114, + 115, + 116, + 117, + 118, + 115 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.instanceStream:(Ljava/lang/String;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 146, + 147, + 148, + 149, + 150, + 146 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.instances:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 103, + 104 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.instances:(Ljava/lang/String;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.lambda$eventStream$3:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lorg/springframework/http/codec/ServerSentEvent;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 141 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.lambda$instanceStream$4:(Ljava/lang/String;Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 147 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.lambda$instanceStream$5:(Lde/codecentric/boot/admin/server/domain/events/InstanceEvent;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 148 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.lambda$instanceStream$6:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/codec/ServerSentEvent;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 149 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.lambda$register$1:(Lorg/springframework/web/util/UriComponentsBuilder;Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lorg/springframework/http/ResponseEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 82, + 83 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.lambda$static$0:(Ljava/lang/Long;)Lorg/springframework/http/codec/ServerSentEvent;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 59 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.lambda$unregister$2:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Lorg/springframework/http/ResponseEntity;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 130 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.ping:()Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 155 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.register:(Lde/codecentric/boot/admin/server/domain/values/Registration;Lorg/springframework/web/util/UriComponentsBuilder;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80, + 81 + ] + }, + "de.codecentric.boot.admin.server.web.InstancesController.unregister:(Ljava/lang/String;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 128, + 129, + 130, + 131, + 129 + ] + }, + "de.codecentric.boot.admin.server.web.PathUtils.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 23, + 24 + ] + }, + "de.codecentric.boot.admin.server.web.PathUtils.normalizePath:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 27, + 28, + 30, + 31, + 32, + 34, + 35, + 37, + 38, + 40 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 113 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.:(Ljava/lang/String;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 114 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.canEqual:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.equals:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.getUserName:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 121 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.getUserPassword:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 127 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.hashCode:()I" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.setUserName:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.setUserPassword:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider$InstanceCredentials.toString:()Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 112 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 60, + 61 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.:(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 53, + 54, + 55, + 56, + 57 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.base64Encode:([B)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 105, + 106, + 108, + 109 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.encode:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 89, + 90 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.getHeaders:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 65, + 66, + 68, + 69, + 70, + 71, + 72, + 73, + 76, + 77, + 81, + 82, + 83, + 85 + ] + }, + "de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.getMetadataValue:(Lde/codecentric/boot/admin/server/domain/entities/Instance;[Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 94, + 95, + 96, + 97, + 98, + 95, + 101 + ] + }, + "de.codecentric.boot.admin.server.web.client.CloudFoundryHttpHeaderProvider.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 30 + ] + }, + "de.codecentric.boot.admin.server.web.client.CloudFoundryHttpHeaderProvider.getHeaders:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 34, + 35, + 37, + 38, + 39, + 40, + 43 + ] + }, + "de.codecentric.boot.admin.server.web.client.CompositeHttpHeadersProvider.:(Ljava/util/Collection;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 29, + 30, + 31 + ] + }, + "de.codecentric.boot.admin.server.web.client.CompositeHttpHeadersProvider.getHeaders:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 35, + 36, + 37 + ] + }, + "de.codecentric.boot.admin.server.web.client.CompositeHttpHeadersProvider.lambda$getHeaders$0:(Lorg/springframework/http/HttpHeaders;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/web/client/HttpHeadersProvider;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 36 + ] + }, + "de.codecentric.boot.admin.server.web.client.HttpHeadersProvider.getHeaders:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunction.filter:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 64, + 65 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.addHeaders:(Lde/codecentric/boot/admin/server/web/client/HttpHeadersProvider;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 68 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.addHeadersReactive:(Lde/codecentric/boot/admin/server/web/client/reactive/ReactiveHttpHeadersProvider;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 77 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.convertLegacyEndpoints:(Ljava/util/List;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 133 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.convertLegacyResponse:(Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lorg/springframework/web/reactive/function/client/ClientResponse;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 163, + 167, + 163 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.enrichRequestWithStoredCookies:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lorg/springframework/web/reactive/function/client/ClientRequest;Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;)Lorg/springframework/web/reactive/function/client/ClientRequest;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 239, + 240, + 241, + 242, + 245, + 246 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.handleCookies:(Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 226 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.isLegacyResponse:(Lorg/springframework/web/reactive/function/client/ClientResponse;)Ljava/lang/Boolean;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 156, + 157, + 158, + 159, + 156 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$addHeaders$0:(Lde/codecentric/boot/admin/server/web/client/HttpHeadersProvider;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 70 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$addHeaders$1:(Lde/codecentric/boot/admin/server/web/client/HttpHeadersProvider;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 69, + 70, + 71, + 72 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$addHeadersReactive$2:(Lorg/springframework/http/HttpHeaders;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 79 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$addHeadersReactive$3:(Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;Lorg/springframework/http/HttpHeaders;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 78, + 79, + 80, + 82 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$addHeadersReactive$4:(Lorg/springframework/web/reactive/function/client/ExchangeFunction;Lorg/springframework/web/reactive/function/client/ClientRequest;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 83 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$addHeadersReactive$5:(Lde/codecentric/boot/admin/server/web/client/reactive/ReactiveHttpHeadersProvider;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 77, + 83, + 77 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$convertLegacyEndpoints$7:(Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lorg/springframework/web/reactive/function/client/ClientResponse;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 144, + 145, + 147 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$convertLegacyEndpoints$8:(Ljava/util/List;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 134, + 136, + 137, + 138, + 141, + 142, + 143, + 150, + 151 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$convertLegacyResponse$10:(Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 164, + 165, + 164, + 166, + 167 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$enrichRequestWithStoredCookies$19:(Lorg/springframework/util/MultiValueMap;Lorg/springframework/util/MultiValueMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 246 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$handleCookies$17:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lorg/springframework/web/reactive/function/client/ClientResponse;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 230 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$handleCookies$18:(Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 228, + 229, + 230, + 229, + 233 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$isLegacyResponse$9:(Lorg/springframework/http/MediaType;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 158 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$logfileAcceptWorkaround$15:(Ljava/util/List;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 213 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$logfileAcceptWorkaround$16:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 209, + 210, + 211, + 212, + 213, + 215 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$retry$13:(Ljava/util/Map;ILde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 186, + 187, + 188, + 189, + 191 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$rewriteEndpointUrl$6:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 88, + 89, + 90, + 91, + 92, + 93, + 95, + 98, + 99, + 100, + 103, + 104, + 106, + 107, + 110, + 111, + 112, + 111, + 113, + 114, + 115, + 116, + 117 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$setDefaultAcceptHeader$11:(Ljava/util/List;Lorg/springframework/http/HttpHeaders;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 178 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$setDefaultAcceptHeader$12:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 180 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.lambda$timeout$14:(Ljava/util/Map;Ljava/time/Duration;Lde/codecentric/boot/admin/server/domain/entities/Instance;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 198, + 199, + 200, + 201 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.logfileAcceptWorkaround:()Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 208 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.retry:(ILjava/util/Map;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 185 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.rewriteEndpointUrl:()Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 87 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.rewriteUrl:(Lorg/springframework/web/util/UriComponents;Ljava/lang/String;)Ljava/net/URI;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 125 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.setDefaultAcceptHeader:()Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 171 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.storeCookiesFromResponse:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ClientResponse;Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;)Lorg/springframework/web/reactive/function/client/ClientResponse;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 251, + 252, + 255, + 257 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunctions.timeout:(Ljava/time/Duration;Ljava/util/Map;)Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 197 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 79, + 80 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder.:(Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 86, + 74, + 87, + 88, + 89 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder.:(Lorg/springframework/web/reactive/function/client/WebClient$Builder;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 82, + 74, + 83, + 84 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder.build:()Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 111, + 112, + 113, + 114 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder.filter:(Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;)Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 92, + 93 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder.filters:(Ljava/util/function/Consumer;)Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 97, + 98 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient$Builder.webClient:(Lorg/springframework/web/reactive/function/client/WebClient$Builder;)Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T002", + "perMethodOutcome" : "T002", + "lineNumbers" : [ + 102, + 103 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.:(Lorg/springframework/web/reactive/function/client/WebClient;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 37, + 38, + 39 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.builder:()Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 50 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.builder:(Lorg/springframework/web/reactive/function/client/WebClient$Builder;)Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 54 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.instance:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/web/reactive/function/client/WebClient;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 46 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.instance:(Lreactor/core/publisher/Mono;)Lorg/springframework/web/reactive/function/client/WebClient;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.lambda$instance$0:(Lreactor/core/publisher/Mono;Ljava/util/List;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 42 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.lambda$setInstance$1:(Lorg/springframework/web/reactive/function/client/ClientRequest;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lorg/springframework/web/reactive/function/client/ClientRequest;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 59 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.lambda$setInstance$2:()Ljava/lang/Throwable;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.lambda$setInstance$3:(Lreactor/core/publisher/Mono;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 58, + 59, + 60, + 61, + 58 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.lambda$toExchangeFilterFunction$4:(Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 68 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.lambda$toExchangeFilterFunction$5:(Lorg/springframework/web/reactive/function/client/ExchangeFunction;Lorg/springframework/web/reactive/function/client/ClientRequest;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 69 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.lambda$toExchangeFilterFunction$6:(Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;Lorg/springframework/web/reactive/function/client/ClientRequest;Lorg/springframework/web/reactive/function/client/ExchangeFunction;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 69, + 65, + 66, + 67, + 68, + 69 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.setInstance:(Lreactor/core/publisher/Mono;)Lorg/springframework/web/reactive/function/client/ExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 58 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClient.toExchangeFilterFunction:(Lde/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction;)Lorg/springframework/web/reactive/function/client/ExchangeFilterFunction;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 65 + ] + }, + "de.codecentric.boot.admin.server.web.client.InstanceWebClientCustomizer.customize:(Lde/codecentric/boot/admin/server/web/client/InstanceWebClient$Builder;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverter.:(Ljava/lang/String;Ljava/util/function/Function;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 33, + 34, + 35, + 36 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverter.canConvert:(Ljava/lang/Object;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 39 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverter.convert:(Lreactor/core/publisher/Flux;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 43 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters$1.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 60 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters$2.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 63 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters$3.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T004", + "perMethodOutcome" : "T004", + "lineNumbers" : [ + 66 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T023", + "perMethodOutcome" : "T023" + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 84, + 85 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.beans:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 122, + 123, + 122 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.configprops:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 127, + 128, + 127 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertBeans:(Ljava/util/List;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 374, + 394, + 396 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertConfigprops:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 400, + 406, + 407, + 408, + 409, + 412, + 413 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertEnv:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 244, + 245, + 247, + 263, + 265 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertFlyway:(Ljava/util/List;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 356, + 357, + 358, + 360 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertFlywayMigrations:(Ljava/util/List;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 364, + 370, + 364 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertHealth:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 221, + 222, + 224, + 235, + 236, + 239 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertHttptrace:(Ljava/util/List;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 269, + 270, + 269 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertHttptrace:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 275, + 276, + 277, + 278, + 279, + 280, + 281, + 282, + 284, + 286, + 287, + 288, + 289, + 290, + 291, + 292, + 295, + 296, + 297, + 298, + 301, + 302, + 303, + 304, + 308, + 309, + 310, + 313 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertLiquibase:(Ljava/util/List;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 322, + 323, + 324, + 327 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertLiquibaseChangesets:(Ljava/util/List;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 331, + 351, + 331 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertMappingConditions:(Ljava/lang/String;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 451, + 453, + 455, + 457, + 459, + 460, + 461, + 462, + 463, + 464, + 465, + 467, + 500 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertMappingHandlerMethod:(Ljava/lang/String;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 146, + 148, + 149, + 151, + 154, + 157, + 160, + 163, + 173, + 182, + 184, + 186, + 188, + 182, + 191, + 200, + 202, + 203, + 204, + 205, + 206 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertMappings:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 417, + 435, + 437, + 441, + 440, + 439, + 438, + 437 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertThreaddump:(Ljava/util/List;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 317 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.convertUsing:(Lorg/springframework/core/ParameterizedTypeReference;Lorg/springframework/core/ParameterizedTypeReference;Ljava/util/function/Function;)Ljava/util/function/Function;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 213 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.env:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 93, + 94, + 93 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.flyway:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 113, + 114, + 113 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.getInstant:(Ljava/lang/Object;)Ljava/time/Instant;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 506, + 507, + 509, + 510, + 515, + 513, + 514, + 516 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.health:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 88, + 89, + 88 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.httptrace:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 98, + 99, + 98 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.info:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 118 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertBeans$17:(Ljava/util/Map;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 387 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertBeans$18:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 375, + 376, + 381, + 382, + 385, + 386, + 387, + 389, + 390, + 391, + 392, + 393 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertBeans$19:(Ljava/util/Map;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 394 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertEnv$7:(Ljava/util/Map;Ljava/lang/String;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 255 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertEnv$8:(Ljava/util/Map;Ljava/util/List;Ljava/lang/String;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 248, + 249, + 251, + 252, + 254, + 255, + 257, + 258, + 259, + 260, + 262 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertFlyway$14:(Ljava/util/Map;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 358 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertFlyway$15:(Ljava/util/Map;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 358, + 359, + 358 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertFlywayMigrations$16:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 365, + 366, + 367, + 369 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertHealth$6:(Ljava/util/Map;Ljava/util/Map;Ljava/lang/String;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 225, + 226, + 228, + 229, + 232, + 234 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertHttptrace$10:(Ljava/util/Map;Ljava/lang/String;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 302 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertHttptrace$9:(Ljava/util/Map;Ljava/lang/String;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 291 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertLiquibase$11:(Ljava/util/Map;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertLiquibase$12:(Ljava/util/Map;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 324, + 325, + 324 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertLiquibaseChangesets$13:(Ljava/util/Map;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 332, + 333, + 334, + 335, + 336, + 337, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 345, + 347, + 348, + 347, + 349, + 350 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertMappingConditions$21:(Ljava/lang/Object;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 486 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertMappingConditions$22:(Ljava/util/Map;Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 468, + 472, + 473, + 474, + 478, + 482, + 485, + 486, + 487, + 488, + 497, + 498 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertMappingHandlerMethod$2:(Ljava/lang/String;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 191, + 193, + 195, + 197, + 191 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertMappings$20:(Ljava/util/Map$Entry;)Ljava/util/Map;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 418, + 420, + 421, + 423, + 424, + 426, + 427, + 428, + 429, + 432, + 434 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertUsing$3:(Ljava/util/function/Function;Ljava/lang/Object;)Ljava/lang/Object;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 214 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertUsing$4:(Lorg/springframework/core/ParameterizedTypeReference;Ljava/lang/Object;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 215, + 216, + 215 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$convertUsing$5:(Lorg/springframework/core/ParameterizedTypeReference;Ljava/util/function/Function;Lorg/springframework/core/ParameterizedTypeReference;Lreactor/core/publisher/Flux;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 213, + 214, + 215, + 213 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$info$0:(Lreactor/core/publisher/Flux;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 118 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.lambda$startup$1:(Lreactor/core/publisher/Flux;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.liquibase:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 108, + 109, + 108 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.mappings:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 132, + 133, + 132 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.startup:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 137 + ] + }, + "de.codecentric.boot.admin.server.web.client.LegacyEndpointConverters.threaddump:()Lde/codecentric/boot/admin/server/web/client/LegacyEndpointConverter;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 103, + 104, + 103 + ] + }, + "de.codecentric.boot.admin.server.web.client.RefreshInstancesEvent.:(Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 24, + 25 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.CookieStoreCleanupTrigger.:(Lorg/reactivestreams/Publisher;Lde/codecentric/boot/admin/server/web/client/cookies/PerInstanceCookieStore;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45, + 47, + 48 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.CookieStoreCleanupTrigger.cleanupCookieStore:(Lde/codecentric/boot/admin/server/domain/events/InstanceDeregisteredEvent;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 59, + 60 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.CookieStoreCleanupTrigger.handle:(Lreactor/core/publisher/Flux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 52 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.CookieStoreCleanupTrigger.lambda$handle$0:(Lde/codecentric/boot/admin/server/domain/events/InstanceDeregisteredEvent;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 53, + 54 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.:()V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 70, + 71 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.:(Ljava/net/CookiePolicy;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 78, + 56, + 79, + 80, + 81 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.cleanupInstance:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 116, + 117 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.createCookieHandler:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Ljava/net/CookieHandler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 132 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.get:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/net/URI;Lorg/springframework/util/MultiValueMap;)Lorg/springframework/util/MultiValueMap;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 87, + 88, + 92, + 93, + 97, + 92, + 99, + 100 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.getCookieHandler:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)Ljava/net/CookieHandler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 128 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.lambda$cleanupInstance$4:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/net/CookieHandler;)Ljava/net/CookieHandler;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 116 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.lambda$get$0:(Ljava/lang/String;)[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 94 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.lambda$get$1:(Lorg/springframework/util/LinkedMultiValueMap;[Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 95 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.lambda$get$2:(Lorg/springframework/util/LinkedMultiValueMap;Lorg/springframework/util/LinkedMultiValueMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 96 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.lambda$get$3:(Ljava/util/List;)Lorg/springframework/util/LinkedMultiValueMap;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 95, + 93, + 94, + 95 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore.put:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/net/URI;Lorg/springframework/util/MultiValueMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 107, + 111, + 109, + 110, + 112 + ] + }, + "de.codecentric.boot.admin.server.web.client.cookies.PerInstanceCookieStore.cleanupInstance:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.client.cookies.PerInstanceCookieStore.get:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/net/URI;Lorg/springframework/util/MultiValueMap;)Lorg/springframework/util/MultiValueMap;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.client.cookies.PerInstanceCookieStore.put:(Lde/codecentric/boot/admin/server/domain/values/InstanceId;Ljava/net/URI;Lorg/springframework/util/MultiValueMap;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.client.exception.InstanceWebClientException.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 22, + 23 + ] + }, + "de.codecentric.boot.admin.server.web.client.exception.InstanceWebClientException.:(Ljava/lang/String;Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 26, + 27 + ] + }, + "de.codecentric.boot.admin.server.web.client.exception.ResolveEndpointException.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 22, + 23 + ] + }, + "de.codecentric.boot.admin.server.web.client.exception.ResolveEndpointException.:(Ljava/lang/String;Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 26, + 27 + ] + }, + "de.codecentric.boot.admin.server.web.client.exception.ResolveInstanceException.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 22, + 23 + ] + }, + "de.codecentric.boot.admin.server.web.client.exception.ResolveInstanceException.:(Ljava/lang/String;Ljava/lang/Throwable;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 26, + 27 + ] + }, + "de.codecentric.boot.admin.server.web.client.reactive.CompositeReactiveHttpHeadersProvider.:(Ljava/util/Collection;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T005", + "perMethodOutcome" : "T005", + "lineNumbers" : [ + 34, + 35, + 36 + ] + }, + "de.codecentric.boot.admin.server.web.client.reactive.CompositeReactiveHttpHeadersProvider.getHeaders:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 40, + 41, + 42, + 44 + ] + }, + "de.codecentric.boot.admin.server.web.client.reactive.CompositeReactiveHttpHeadersProvider.lambda$getHeaders$0:(Lde/codecentric/boot/admin/server/domain/entities/Instance;Lde/codecentric/boot/admin/server/web/client/reactive/ReactiveHttpHeadersProvider;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 41 + ] + }, + "de.codecentric.boot.admin.server.web.client.reactive.CompositeReactiveHttpHeadersProvider.lambda$mergeMonosToHeaders$1:(Lorg/springframework/http/HttpHeaders;Lorg/springframework/http/HttpHeaders;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 49, + 50 + ] + }, + "de.codecentric.boot.admin.server.web.client.reactive.CompositeReactiveHttpHeadersProvider.mergeMonosToHeaders:([Ljava/lang/Object;)Lorg/springframework/http/HttpHeaders;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 48 + ] + }, + "de.codecentric.boot.admin.server.web.client.reactive.ReactiveHttpHeadersProvider.getHeaders:(Lde/codecentric/boot/admin/server/domain/entities/Instance;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T010", + "perMethodOutcome" : "T010" + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 39, + 40, + 41 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping.isHandler:(Ljava/lang/Class;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 45 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping.lambda$withNewPatterns$0:(Lorg/springframework/web/util/pattern/PathPattern;)Lorg/springframework/web/util/pattern/PathPattern;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 66 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping.registerHandlerMethod:(Ljava/lang/Object;Ljava/lang/reflect/Method;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 35 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping.registerHandlerMethod:(Ljava/lang/Object;Ljava/lang/reflect/Method;Lorg/springframework/web/reactive/result/method/RequestMappingInfo;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 50, + 51 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping.withNewPatterns:(Ljava/util/Set;)Ljava/util/List;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 65, + 66, + 67, + 65 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping.withPrefix:(Lorg/springframework/web/reactive/result/method/RequestMappingInfo;)Lorg/springframework/web/reactive/result/method/RequestMappingInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 54, + 55, + 57, + 58, + 59, + 60, + 61, + 59 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController.:(Ljava/lang/String;Ljava/util/Set;Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 70, + 57, + 59, + 71, + 72, + 73, + 74, + 75 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController.createForwardRequest:(Lorg/springframework/http/server/reactive/ServerHttpRequest;Lreactor/core/publisher/Flux;Ljava/lang/String;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 117 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController.endpointProxy:(Ljava/lang/String;Lorg/springframework/http/server/reactive/ServerHttpRequest;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 99, + 105, + 107, + 110 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController.endpointProxy:(Ljava/lang/String;Lorg/springframework/http/server/reactive/ServerHttpRequest;Lorg/springframework/http/server/reactive/ServerHttpResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 81, + 84 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController.getLocalPath:(Ljava/lang/String;Lorg/springframework/http/server/reactive/ServerHttpRequest;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 126, + 127 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController.lambda$endpointProxy$0:(Lorg/springframework/http/server/reactive/ServerHttpResponse;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 86, + 87, + 88, + 89 + ] + }, + "de.codecentric.boot.admin.server.web.reactive.InstancesProxyController.lambda$endpointProxy$1:(Lorg/springframework/core/io/buffer/DataBuffer;)Lorg/springframework/core/io/buffer/DataBuffer;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 100, + 101, + 102, + 103, + 104 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.:(Ljava/lang/String;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 35, + 36, + 37 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.isHandler:(Ljava/lang/Class;)Z" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 41 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.lambda$withNewPatterns$0:(Lorg/springframework/web/util/pattern/PathPattern;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 61 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.lambda$withNewPatterns$1:(I)[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 62 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.registerHandlerMethod:(Ljava/lang/Object;Ljava/lang/reflect/Method;Ljava/lang/Object;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 31 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.registerHandlerMethod:(Ljava/lang/Object;Ljava/lang/reflect/Method;Lorg/springframework/web/servlet/mvc/method/RequestMappingInfo;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 46, + 47 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.withNewPatterns:(Ljava/util/Set;)[Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 60, + 61, + 62, + 60 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.withPrefix:(Lorg/springframework/web/servlet/mvc/method/RequestMappingInfo;)Lorg/springframework/web/servlet/mvc/method/RequestMappingInfo;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 50, + 51, + 54, + 56 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.:(Ljava/lang/String;Ljava/util/Set;Lde/codecentric/boot/admin/server/services/InstanceRegistry;Lde/codecentric/boot/admin/server/web/client/InstanceWebClient;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 77, + 64, + 66, + 78, + 79, + 80, + 81, + 82 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.createForwardRequest:(Lorg/springframework/http/server/ServletServerHttpRequest;Lreactor/core/publisher/Flux;Ljava/lang/String;)Lde/codecentric/boot/admin/server/web/InstanceWebProxy$ForwardRequest;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 150, + 151, + 152, + 153, + 154, + 156, + 157, + 158, + 159, + 160, + 161, + 156 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.endpointProxy:(Ljava/lang/String;Ljakarta/servlet/http/HttpServletRequest;)Lreactor/core/publisher/Flux;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 139, + 140, + 141, + 143, + 145 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.getLocalPath:(Ljava/lang/String;Lorg/springframework/http/server/ServletServerHttpRequest;)Ljava/lang/String;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 165, + 166, + 167, + 168 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.instanceProxy:(Ljava/lang/String;Ljakarta/servlet/http/HttpServletRequest;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T000", + "perMethodOutcome" : "T000", + "lineNumbers" : [ + 93, + 94, + 97, + 98, + 99, + 100, + 103, + 104, + 126, + 129, + 130, + 129, + 130, + 131 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.lambda$instanceProxy$0:(Ljava/io/OutputStream;Lreactor/core/publisher/Flux;)Lorg/reactivestreams/Publisher;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 115 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.lambda$instanceProxy$1:(Ljakarta/servlet/AsyncContext;Lorg/springframework/web/reactive/function/client/ClientResponse;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 105, + 106, + 107, + 108, + 109, + 111, + 112, + 113, + 114, + 115, + 116, + 113, + 118, + 119 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.lambda$writeAndFlush$2:(Ljava/io/OutputStream;Lreactor/core/publisher/MonoSink;)V" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T012", + "perMethodOutcome" : "T012", + "lineNumbers" : [ + 174, + 175, + 179, + 177, + 178, + 180 + ] + }, + "de.codecentric.boot.admin.server.web.servlet.InstancesProxyController.writeAndFlush:(Lreactor/core/publisher/Flux;Ljava/io/OutputStream;)Lreactor/core/publisher/Mono;" : { + "completeTestCount" : 0, + "incompleteTestCount" : 0, + "perMethodTestability" : "T003", + "perMethodOutcome" : "T003", + "lineNumbers" : [ + 172 + ] + } + }, + "validationMetrics" : { } +} \ No newline at end of file diff --git a/spring-boot-admin-server/pom.xml b/spring-boot-admin-server/pom.xml index cb18e50c122..f5da0c2f746 100644 --- a/spring-boot-admin-server/pom.xml +++ b/spring-boot-admin-server/pom.xml @@ -145,5 +145,11 @@ junit-jupiter test + + org.junit.platform + junit-platform-launcher + 1.12.1 + test + diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfigurationDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfigurationDiffblueTest.java new file mode 100644 index 00000000000..b748f4bb06d --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfigurationDiffblueTest.java @@ -0,0 +1,329 @@ +package de.codecentric.boot.admin.server.config; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import de.codecentric.boot.admin.server.domain.entities.Application; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import de.codecentric.boot.admin.server.services.ApiMediaTypeHandler; +import de.codecentric.boot.admin.server.services.EndpointDetector; +import de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator; +import de.codecentric.boot.admin.server.services.InfoUpdater; +import de.codecentric.boot.admin.server.services.InstanceFilter; +import de.codecentric.boot.admin.server.services.InstanceIdGenerator; +import de.codecentric.boot.admin.server.services.InstanceRegistry; +import de.codecentric.boot.admin.server.services.StatusUpdater; +import de.codecentric.boot.admin.server.services.endpoints.EndpointDetectionStrategy; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; +import org.reactivestreams.Publisher; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import reactor.core.publisher.Flux; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@RunWith(MockitoJUnitRunner.class) +public class AdminServerAutoConfigurationDiffblueTest { + + @InjectMocks + private AdminServerAutoConfiguration adminServerAutoConfiguration; + + @InjectMocks + private AdminServerProperties adminServerProperties; + + /** + * Test + * {@link AdminServerAutoConfiguration#instanceRegistry(InstanceRepository, InstanceIdGenerator, InstanceFilter)}. + *

+ * Method under test: + * {@link AdminServerAutoConfiguration#instanceRegistry(InstanceRepository, InstanceIdGenerator, InstanceFilter)} + */ + @Test + public void testInstanceRegistry() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(adminServerAutoConfiguration + .instanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances()); + createResult.expectComplete().verify(); + } + + /** + * Test + * {@link AdminServerAutoConfiguration#applicationRegistry(InstanceRegistry, InstanceEventPublisher)}. + *

+ * Method under test: + * {@link AdminServerAutoConfiguration#applicationRegistry(InstanceRegistry, InstanceEventPublisher)} + */ + @Test + public void testApplicationRegistry() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create( + adminServerAutoConfiguration + .applicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AdminServerAutoConfiguration#instanceIdGenerator()}. + *

+ * Method under test: {@link AdminServerAutoConfiguration#instanceIdGenerator()} + */ + @Test + public void testInstanceIdGenerator() { + // Arrange and Act + InstanceIdGenerator actualInstanceIdGeneratorResult = adminServerAutoConfiguration.instanceIdGenerator(); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + InstanceId actualGenerateIdResult = actualInstanceIdGeneratorResult.generateId(registration); + + // Assert + assertTrue(actualInstanceIdGeneratorResult instanceof HashingInstanceUrlIdGenerator); + assertEquals("504149e8a3fa", actualGenerateIdResult.getValue()); + assertEquals("504149e8a3fa", actualGenerateIdResult.toString()); + } + + /** + * Test + * {@link AdminServerAutoConfiguration#statusUpdater(InstanceRepository, Builder)}. + *

    + *
  • Given {@link Builder} {@link Builder#build()} return {@link WebClient}.
  • + *
  • Then calls {@link InstanceWebClient.Builder#build()}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerAutoConfiguration#statusUpdater(InstanceRepository, InstanceWebClient.Builder)} + */ + @Test + public void testStatusUpdater_givenBuilderBuildReturnWebClient_thenCallsBuild() { + // Arrange + EventsourcingInstanceRepository instanceRepository = new EventsourcingInstanceRepository( + new InMemoryEventStore()); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder).build(); + InstanceWebClient.Builder instanceWebClientBulder = mock(InstanceWebClient.Builder.class); + when(instanceWebClientBulder.build()).thenReturn(buildResult); + + // Act + adminServerAutoConfiguration.statusUpdater(instanceRepository, instanceWebClientBulder); + + // Assert + verify(instanceWebClientBulder).build(); + verify(builder).build(); + } + + /** + * Test + * {@link AdminServerAutoConfiguration#statusUpdateTrigger(StatusUpdater, Publisher)}. + *

+ * Method under test: + * {@link AdminServerAutoConfiguration#statusUpdateTrigger(StatusUpdater, Publisher)} + */ + @Test + public void testStatusUpdateTrigger() { + // Arrange + AdminServerAutoConfiguration adminServerAutoConfiguration = new AdminServerAutoConfiguration( + new AdminServerProperties()); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + Flux events = Flux.fromIterable(new ArrayList<>()); + + // Act + adminServerAutoConfiguration.statusUpdateTrigger(statusUpdater, events); + + // Assert + verify(builder).build(); + } + + /** + * Test + * {@link AdminServerAutoConfiguration#endpointDetector(InstanceRepository, Builder)}. + *

    + *
  • Given {@link Builder} {@link Builder#build()} return {@link WebClient}.
  • + *
  • Then calls {@link InstanceWebClient.Builder#build()}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerAutoConfiguration#endpointDetector(InstanceRepository, InstanceWebClient.Builder)} + */ + @Test + public void testEndpointDetector_givenBuilderBuildReturnWebClient_thenCallsBuild() { + // Arrange + AdminServerAutoConfiguration adminServerAutoConfiguration = new AdminServerAutoConfiguration( + new AdminServerProperties()); + EventsourcingInstanceRepository instanceRepository = new EventsourcingInstanceRepository( + new InMemoryEventStore()); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder).build(); + InstanceWebClient.Builder instanceWebClientBuilder = mock(InstanceWebClient.Builder.class); + when(instanceWebClientBuilder.build()).thenReturn(buildResult); + + // Act + adminServerAutoConfiguration.endpointDetector(instanceRepository, instanceWebClientBuilder); + + // Assert + verify(instanceWebClientBuilder).build(); + verify(builder).build(); + } + + /** + * Test + * {@link AdminServerAutoConfiguration#endpointDetectionTrigger(EndpointDetector, Publisher)}. + *

    + *
  • Given randomUUID.
  • + *
  • Then calls {@link IMap#addEntryListener(MapListener, boolean)}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerAutoConfiguration#endpointDetectionTrigger(EndpointDetector, Publisher)} + */ + @Test + public void testEndpointDetectionTrigger_givenRandomUUID_thenCallsAddEntryListener() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + EndpointDetector endpointDetector = new EndpointDetector( + new EventsourcingInstanceRepository(new HazelcastEventStore(eventLogs)), + mock(EndpointDetectionStrategy.class)); + + Flux events = Flux.fromIterable(new ArrayList<>()); + + // Act + adminServerAutoConfiguration.endpointDetectionTrigger(endpointDetector, events); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + } + + /** + * Test {@link AdminServerAutoConfiguration#infoUpdater(InstanceRepository, Builder)}. + *

    + *
  • Given {@link Builder} {@link Builder#build()} return {@link WebClient}.
  • + *
  • Then calls {@link InstanceWebClient.Builder#build()}.
  • + *
+ *

+ * Method under test: + * {@link AdminServerAutoConfiguration#infoUpdater(InstanceRepository, InstanceWebClient.Builder)} + */ + @Test + public void testInfoUpdater_givenBuilderBuildReturnWebClient_thenCallsBuild() { + // Arrange + EventsourcingInstanceRepository instanceRepository = new EventsourcingInstanceRepository( + new InMemoryEventStore()); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder).build(); + InstanceWebClient.Builder instanceWebClientBuilder = mock(InstanceWebClient.Builder.class); + when(instanceWebClientBuilder.build()).thenReturn(buildResult); + + // Act + adminServerAutoConfiguration.infoUpdater(instanceRepository, instanceWebClientBuilder); + + // Assert + verify(instanceWebClientBuilder).build(); + verify(builder).build(); + } + + /** + * Test + * {@link AdminServerAutoConfiguration#infoUpdateTrigger(InfoUpdater, Publisher)}. + *

+ * Method under test: + * {@link AdminServerAutoConfiguration#infoUpdateTrigger(InfoUpdater, Publisher)} + */ + @Test + public void testInfoUpdateTrigger() { + // Arrange + AdminServerAutoConfiguration adminServerAutoConfiguration = new AdminServerAutoConfiguration( + new AdminServerProperties()); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + InfoUpdater infoUpdater = new InfoUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + Flux events = Flux.fromIterable(new ArrayList<>()); + + // Act + adminServerAutoConfiguration.infoUpdateTrigger(infoUpdater, events); + + // Assert + verify(builder).build(); + } + + /** + * Test {@link AdminServerAutoConfiguration#eventStore()}. + *

+ * Method under test: {@link AdminServerAutoConfiguration#eventStore()} + */ + @Test + public void testEventStore() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(adminServerAutoConfiguration.eventStore().findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AdminServerAutoConfiguration#instanceRepository(InstanceEventStore)}. + *

+ * Method under test: + * {@link AdminServerAutoConfiguration#instanceRepository(InstanceEventStore)} + */ + @Test + public void testInstanceRepository() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange + AdminServerAutoConfiguration adminServerAutoConfiguration = new AdminServerAutoConfiguration( + new AdminServerProperties()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(adminServerAutoConfiguration.instanceRepository(new InMemoryEventStore()).findAll()); + createResult.expectComplete().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerCloudFoundryAutoConfigurationDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerCloudFoundryAutoConfigurationDiffblueTest.java new file mode 100644 index 00000000000..fc98f417e46 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerCloudFoundryAutoConfigurationDiffblueTest.java @@ -0,0 +1,39 @@ +package de.codecentric.boot.admin.server.config; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import de.codecentric.boot.admin.server.services.CloudFoundryInstanceIdGenerator; +import de.codecentric.boot.admin.server.services.InstanceIdGenerator; +import org.junit.Test; + +public class AdminServerCloudFoundryAutoConfigurationDiffblueTest { + + /** + * Test {@link AdminServerCloudFoundryAutoConfiguration#instanceIdGenerator()}. + *

+ * Method under test: + * {@link AdminServerCloudFoundryAutoConfiguration#instanceIdGenerator()} + */ + @Test + public void testInstanceIdGenerator() { + // Arrange and Act + InstanceIdGenerator actualInstanceIdGeneratorResult = new AdminServerCloudFoundryAutoConfiguration() + .instanceIdGenerator(); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + InstanceId actualGenerateIdResult = actualInstanceIdGeneratorResult.generateId(registration); + + // Assert + assertTrue(actualInstanceIdGeneratorResult instanceof CloudFoundryInstanceIdGenerator); + assertEquals("504149e8a3fa", actualGenerateIdResult.getValue()); + assertEquals("504149e8a3fa", actualGenerateIdResult.toString()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerInstanceWebClientConfigurationDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerInstanceWebClientConfigurationDiffblueTest.java new file mode 100644 index 00000000000..83a6ab7ae9c --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerInstanceWebClientConfigurationDiffblueTest.java @@ -0,0 +1,359 @@ +package de.codecentric.boot.admin.server.config; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration.CookieStoreConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration.InstanceExchangeFiltersConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerInstanceWebClientConfiguration.LegaycEndpointConvertersConfiguration; +import de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunction; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient.Builder; +import de.codecentric.boot.admin.server.web.client.InstanceWebClientCustomizer; +import de.codecentric.boot.admin.server.web.client.LegacyEndpointConverter; +import de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore; +import de.codecentric.boot.admin.server.web.client.cookies.PerInstanceCookieStore; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { InstanceExchangeFiltersConfiguration.class, AdminServerProperties.class, + CookieStoreConfiguration.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class AdminServerInstanceWebClientConfigurationDiffblueTest { + + @Autowired + private CookieStoreConfiguration cookieStoreConfiguration; + + @Autowired + private InstanceExchangeFiltersConfiguration instanceExchangeFiltersConfiguration; + + @MockitoBean + private PerInstanceCookieStore perInstanceCookieStore; + + @MockitoBean + private Publisher publisher; + + /** + * Test CookieStoreConfiguration {@link CookieStoreConfiguration#cookieStore()}. + *

    + *
  • Then return {@link JdkPerInstanceCookieStore}.
  • + *
+ *

+ * Method under test: {@link CookieStoreConfiguration#cookieStore()} + */ + @Test + public void testCookieStoreConfigurationCookieStore_thenReturnJdkPerInstanceCookieStore() { + // Arrange, Act and Assert + assertTrue(cookieStoreConfiguration.cookieStore() instanceof JdkPerInstanceCookieStore); + } + + /** + * Test InstanceExchangeFiltersConfiguration + * {@link InstanceExchangeFiltersConfiguration#filterInstanceWebClientCustomizer(List)}. + *

+ * Method under test: + * {@link InstanceExchangeFiltersConfiguration#filterInstanceWebClientCustomizer(List)} + */ + @Test + public void testInstanceExchangeFiltersConfigurationFilterInstanceWebClientCustomizer() { + // Arrange and Act + InstanceWebClientCustomizer actualFilterInstanceWebClientCustomizerResult = instanceExchangeFiltersConfiguration + .filterInstanceWebClientCustomizer(new ArrayList<>()); + Builder instanceWebClientBuilder = mock(Builder.class); + when(instanceWebClientBuilder.filters(Mockito.>>any())) + .thenReturn(InstanceWebClient.builder()); + actualFilterInstanceWebClientCustomizerResult.customize(instanceWebClientBuilder); + + // Assert + verify(instanceWebClientBuilder).filters(isA(Consumer.class)); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#beansLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#beansLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationBeansLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualBeansLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .beansLegacyEndpointConverter(); + + // Assert + assertFalse(actualBeansLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualBeansLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#configpropsLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#configpropsLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationConfigpropsLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualConfigpropsLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .configpropsLegacyEndpointConverter(); + + // Assert + assertFalse(actualConfigpropsLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualConfigpropsLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#envLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#envLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationEnvLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualEnvLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .envLegacyEndpointConverter(); + + // Assert + assertFalse(actualEnvLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualEnvLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#flywayLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#flywayLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationFlywayLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualFlywayLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .flywayLegacyEndpointConverter(); + + // Assert + assertFalse(actualFlywayLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualFlywayLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#healthLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#healthLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationHealthLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualHealthLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .healthLegacyEndpointConverter(); + + // Assert + assertFalse(actualHealthLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualHealthLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#httptraceLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#httptraceLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationHttptraceLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualHttptraceLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .httptraceLegacyEndpointConverter(); + + // Assert + assertFalse(actualHttptraceLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualHttptraceLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#infoLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#infoLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationInfoLegacyEndpointConverter() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualInfoLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .infoLegacyEndpointConverter(); + + // Assert + assertNull(actualInfoLegacyEndpointConverterResult.convert(null)); + assertFalse(actualInfoLegacyEndpointConverterResult.canConvert("Endpoint Id")); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#liquibaseLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#liquibaseLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationLiquibaseLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualLiquibaseLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .liquibaseLegacyEndpointConverter(); + + // Assert + assertFalse(actualLiquibaseLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualLiquibaseLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#mappingsLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#mappingsLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationMappingsLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualMappingsLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .mappingsLegacyEndpointConverter(); + + // Assert + assertFalse(actualMappingsLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualMappingsLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#startupLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#startupLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationStartupLegacyEndpointConverter() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualStartupLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .startupLegacyEndpointConverter(); + + // Assert + assertNull(actualStartupLegacyEndpointConverterResult.convert(null)); + assertFalse(actualStartupLegacyEndpointConverterResult.canConvert("Endpoint Id")); + } + + /** + * Test LegaycEndpointConvertersConfiguration + * {@link LegaycEndpointConvertersConfiguration#threaddumpLegacyEndpointConverter()}. + *

+ * Method under test: + * {@link LegaycEndpointConvertersConfiguration#threaddumpLegacyEndpointConverter()} + */ + @Test + public void testLegaycEndpointConvertersConfigurationThreaddumpLegacyEndpointConverter() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + LegacyEndpointConverter actualThreaddumpLegacyEndpointConverterResult = new LegaycEndpointConvertersConfiguration() + .threaddumpLegacyEndpointConverter(); + + // Assert + assertFalse(actualThreaddumpLegacyEndpointConverterResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier + .create(actualThreaddumpLegacyEndpointConverterResult.convert(null)); + createResult.expectError().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfigurationDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfigurationDiffblueTest.java new file mode 100644 index 00000000000..ae2a3a36a88 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfigurationDiffblueTest.java @@ -0,0 +1,1260 @@ +package de.codecentric.boot.admin.server.config; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.CompositeNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.CompositeNotifierConfiguration.NoSingleNotifierCandidateCondition; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.DingTalkNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.DiscordNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.FeiShuNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.FilteringNotifierWebConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.HipchatNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.LetsChatNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.MailNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.MicrosoftTeamsNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.OpsGenieNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.PagerdutyNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.RocketChatNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.SlackNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.TelegramNotifierConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration.WebexNotifierConfiguration; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.notify.CompositeNotifier; +import de.codecentric.boot.admin.server.notify.DingTalkNotifier; +import de.codecentric.boot.admin.server.notify.DiscordNotifier; +import de.codecentric.boot.admin.server.notify.FeiShuNotifier; +import de.codecentric.boot.admin.server.notify.FeiShuNotifier.Card; +import de.codecentric.boot.admin.server.notify.FeiShuNotifier.MessageType; +import de.codecentric.boot.admin.server.notify.HipchatNotifier; +import de.codecentric.boot.admin.server.notify.LetsChatNotifier; +import de.codecentric.boot.admin.server.notify.MailNotifier; +import de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier; +import de.codecentric.boot.admin.server.notify.Notifier; +import de.codecentric.boot.admin.server.notify.NotifierProxyProperties; +import de.codecentric.boot.admin.server.notify.OpsGenieNotifier; +import de.codecentric.boot.admin.server.notify.PagerdutyNotifier; +import de.codecentric.boot.admin.server.notify.RocketChatNotifier; +import de.codecentric.boot.admin.server.notify.SlackNotifier; +import de.codecentric.boot.admin.server.notify.TelegramNotifier; +import de.codecentric.boot.admin.server.notify.WebexNotifier; +import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.context.annotation.ConfigurationCondition; +import org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase; +import org.springframework.expression.EvaluationException; +import org.springframework.expression.Expression; +import org.springframework.expression.common.CompositeStringExpression; +import org.springframework.expression.common.LiteralExpression; +import org.springframework.expression.spel.standard.SpelExpression; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.JavaMailSenderImpl; +import org.thymeleaf.EngineConfiguration; +import org.thymeleaf.TemplateEngine; +import org.thymeleaf.cache.StandardCacheManager; +import org.thymeleaf.context.StandardEngineContextFactory; +import org.thymeleaf.dialect.IDialect; +import org.thymeleaf.spring6.SpringTemplateEngine; +import org.thymeleaf.templateparser.markup.decoupled.StandardDecoupledTemplateLogicResolver; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@RunWith(MockitoJUnitRunner.class) +public class AdminServerNotifierAutoConfigurationDiffblueTest { + + @Mock + private FilteringNotifier filteringNotifier; + + @InjectMocks + private FilteringNotifierWebConfiguration filteringNotifierWebConfiguration; + + @InjectMocks + private MailNotifierConfiguration mailNotifierConfiguration; + + /** + * Test CompositeNotifierConfiguration + * {@link CompositeNotifierConfiguration#compositeNotifier(List)}. + *

    + *
  • Then {@link ArrayList#ArrayList()} Empty.
  • + *
+ *

+ * Method under test: {@link CompositeNotifierConfiguration#compositeNotifier(List)} + */ + @Test + public void testCompositeNotifierConfigurationCompositeNotifier_thenArrayListEmpty() throws AssertionError { + // Arrange + CompositeNotifierConfiguration compositeNotifierConfiguration = new CompositeNotifierConfiguration(); + ArrayList notifiers = new ArrayList<>(); + + // Act + CompositeNotifier actualCompositeNotifierResult = compositeNotifierConfiguration.compositeNotifier(notifiers); + InstanceId instance = InstanceId.of("42"); + InstanceDeregisteredEvent event = new InstanceDeregisteredEvent(instance, 1L); + + Mono actualPublisher = actualCompositeNotifierResult.notify(event); + + // Assert + assertEquals("DEREGISTERED", event.getType()); + assertEquals(1L, event.getVersion()); + assertTrue(notifiers.isEmpty()); + assertSame(instance, event.getInstance()); + FirstStep createResult = StepVerifier.create(actualPublisher); + createResult.expectComplete().verify(); + } + + /** + * Test CompositeNotifierConfiguration + * {@link CompositeNotifierConfiguration#compositeNotifier(List)}. + *

    + *
  • Then {@link ArrayList#ArrayList()} Empty.
  • + *
+ *

+ * Method under test: {@link CompositeNotifierConfiguration#compositeNotifier(List)} + */ + @Test + public void testCompositeNotifierConfigurationCompositeNotifier_thenArrayListEmpty2() { + // Arrange + CompositeNotifierConfiguration compositeNotifierConfiguration = new CompositeNotifierConfiguration(); + ArrayList notifiers = new ArrayList<>(); + + // Act + compositeNotifierConfiguration.compositeNotifier(notifiers); + + // Assert that nothing has changed + assertTrue(notifiers.isEmpty()); + } + + /** + * Test CompositeNotifierConfiguration + * {@link CompositeNotifierConfiguration#compositeNotifier(List)}. + *

    + *
  • Then {@link ArrayList#ArrayList()} size is one.
  • + *
+ *

+ * Method under test: {@link CompositeNotifierConfiguration#compositeNotifier(List)} + */ + @Test + public void testCompositeNotifierConfigurationCompositeNotifier_thenArrayListSizeIsOne() throws AssertionError { + // Arrange + CompositeNotifierConfiguration compositeNotifierConfiguration = new CompositeNotifierConfiguration(); + + ArrayList notifiers = new ArrayList<>(); + notifiers.add(mock(Notifier.class)); + + // Act + CompositeNotifier actualCompositeNotifierResult = compositeNotifierConfiguration.compositeNotifier(notifiers); + InstanceId instance = InstanceId.of("42"); + InstanceDeregisteredEvent event = new InstanceDeregisteredEvent(instance, 1L); + + Mono actualPublisher = actualCompositeNotifierResult.notify(event); + + // Assert + assertEquals("DEREGISTERED", event.getType()); + assertEquals(1, notifiers.size()); + assertEquals(1L, event.getVersion()); + assertSame(instance, event.getInstance()); + FirstStep createResult = StepVerifier.create(actualPublisher); + createResult.expectError().verify(); + } + + /** + * Test CompositeNotifierConfiguration + * {@link CompositeNotifierConfiguration#compositeNotifier(List)}. + *

    + *
  • Then {@link ArrayList#ArrayList()} size is two.
  • + *
+ *

+ * Method under test: {@link CompositeNotifierConfiguration#compositeNotifier(List)} + */ + @Test + public void testCompositeNotifierConfigurationCompositeNotifier_thenArrayListSizeIsTwo() throws AssertionError { + // Arrange + CompositeNotifierConfiguration compositeNotifierConfiguration = new CompositeNotifierConfiguration(); + + ArrayList notifiers = new ArrayList<>(); + notifiers.add(mock(Notifier.class)); + notifiers.add(mock(Notifier.class)); + + // Act + CompositeNotifier actualCompositeNotifierResult = compositeNotifierConfiguration.compositeNotifier(notifiers); + InstanceId instance = InstanceId.of("42"); + InstanceDeregisteredEvent event = new InstanceDeregisteredEvent(instance, 1L); + + Mono actualPublisher = actualCompositeNotifierResult.notify(event); + + // Assert + assertEquals("DEREGISTERED", event.getType()); + assertEquals(1L, event.getVersion()); + assertEquals(2, notifiers.size()); + assertSame(instance, event.getInstance()); + FirstStep createResult = StepVerifier.create(actualPublisher); + createResult.expectError().verify(); + } + + /** + * Test CompositeNotifierConfiguration_NoSingleNotifierCandidateCondition new + * {@link CompositeNotifierConfiguration.NoSingleNotifierCandidateCondition} (default + * constructor). + *

+ * Method under test: default or parameterless constructor of + * {@link CompositeNotifierConfiguration.NoSingleNotifierCandidateCondition} + */ + @Test + public void testCompositeNotifierConfiguration_NoSingleNotifierCandidateConditionNewNoSingleNotifierCandidateCondition() { + // Arrange, Act and Assert + assertEquals(ConfigurationPhase.REGISTER_BEAN, + new NoSingleNotifierCandidateCondition().getConfigurationPhase()); + } + + /** + * Test DingTalkNotifierConfiguration + * {@link DingTalkNotifierConfiguration#dingTalkNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link DingTalkNotifierConfiguration#dingTalkNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testDingTalkNotifierConfigurationDingTalkNotifier() { + // Arrange + DingTalkNotifierConfiguration dingTalkNotifierConfiguration = new DingTalkNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + DingTalkNotifier actualDingTalkNotifierResult = dingTalkNotifierConfiguration.dingTalkNotifier(repository, + proxyProperties); + + // Assert + assertEquals("#{instance.registration.name} #{instance.id} is #{event.statusInfo.status}", + actualDingTalkNotifierResult.getMessage()); + assertNull(actualDingTalkNotifierResult.getSecret()); + assertNull(actualDingTalkNotifierResult.getWebhookUrl()); + assertTrue(actualDingTalkNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualDingTalkNotifierResult.getIgnoreChanges()); + } + + /** + * Test DingTalkNotifierConfiguration + * {@link DingTalkNotifierConfiguration#dingTalkNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link DingTalkNotifierConfiguration#dingTalkNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testDingTalkNotifierConfigurationDingTalkNotifier_givenMinusOne() { + // Arrange + DingTalkNotifierConfiguration dingTalkNotifierConfiguration = new DingTalkNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + DingTalkNotifier actualDingTalkNotifierResult = dingTalkNotifierConfiguration.dingTalkNotifier(repository, + proxyProperties); + + // Assert + assertEquals("#{instance.registration.name} #{instance.id} is #{event.statusInfo.status}", + actualDingTalkNotifierResult.getMessage()); + assertNull(actualDingTalkNotifierResult.getSecret()); + assertNull(actualDingTalkNotifierResult.getWebhookUrl()); + assertTrue(actualDingTalkNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualDingTalkNotifierResult.getIgnoreChanges()); + } + + /** + * Test DiscordNotifierConfiguration + * {@link DiscordNotifierConfiguration#discordNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link DiscordNotifierConfiguration#discordNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testDiscordNotifierConfigurationDiscordNotifier() { + // Arrange + DiscordNotifierConfiguration discordNotifierConfiguration = new DiscordNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + DiscordNotifier actualDiscordNotifierResult = discordNotifierConfiguration.discordNotifier(repository, + proxyProperties); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualDiscordNotifierResult.getMessage()); + assertNull(actualDiscordNotifierResult.getAvatarUrl()); + assertNull(actualDiscordNotifierResult.getUsername()); + assertNull(actualDiscordNotifierResult.getWebhookUrl()); + assertFalse(actualDiscordNotifierResult.isTts()); + assertTrue(actualDiscordNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualDiscordNotifierResult.getIgnoreChanges()); + } + + /** + * Test DiscordNotifierConfiguration + * {@link DiscordNotifierConfiguration#discordNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link DiscordNotifierConfiguration#discordNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testDiscordNotifierConfigurationDiscordNotifier_givenMinusOne() { + // Arrange + DiscordNotifierConfiguration discordNotifierConfiguration = new DiscordNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + DiscordNotifier actualDiscordNotifierResult = discordNotifierConfiguration.discordNotifier(repository, + proxyProperties); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualDiscordNotifierResult.getMessage()); + assertNull(actualDiscordNotifierResult.getAvatarUrl()); + assertNull(actualDiscordNotifierResult.getUsername()); + assertNull(actualDiscordNotifierResult.getWebhookUrl()); + assertFalse(actualDiscordNotifierResult.isTts()); + assertTrue(actualDiscordNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualDiscordNotifierResult.getIgnoreChanges()); + } + + /** + * Test FeiShuNotifierConfiguration + * {@link FeiShuNotifierConfiguration#feiShuNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link FeiShuNotifierConfiguration#feiShuNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testFeiShuNotifierConfigurationFeiShuNotifier() { + // Arrange + FeiShuNotifierConfiguration feiShuNotifierConfiguration = new FeiShuNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + FeiShuNotifier actualFeiShuNotifierResult = feiShuNotifierConfiguration.feiShuNotifier(repository, + proxyProperties); + + // Assert + Card card = actualFeiShuNotifierResult.getCard(); + assertEquals("Codecentric's Spring Boot Admin notice", card.getTitle()); + assertEquals( + "ServiceName: #{instance.registration.name}(#{instance.id}) \n" + + "ServiceUrl: #{instance.registration.serviceUrl} \n" + + "Status: changed status from [#{lastStatus}] to [#{event.statusInfo.status}]", + actualFeiShuNotifierResult.getMessage()); + assertEquals("red", card.getThemeColor()); + assertNull(actualFeiShuNotifierResult.getSecret()); + assertNull(actualFeiShuNotifierResult.getWebhookUrl()); + assertEquals(MessageType.interactive, actualFeiShuNotifierResult.getMessageType()); + assertTrue(actualFeiShuNotifierResult.isEnabled()); + assertTrue(actualFeiShuNotifierResult.isAtAll()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualFeiShuNotifierResult.getIgnoreChanges()); + } + + /** + * Test FeiShuNotifierConfiguration + * {@link FeiShuNotifierConfiguration#feiShuNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link FeiShuNotifierConfiguration#feiShuNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testFeiShuNotifierConfigurationFeiShuNotifier_givenMinusOne() { + // Arrange + FeiShuNotifierConfiguration feiShuNotifierConfiguration = new FeiShuNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + FeiShuNotifier actualFeiShuNotifierResult = feiShuNotifierConfiguration.feiShuNotifier(repository, + proxyProperties); + + // Assert + Card card = actualFeiShuNotifierResult.getCard(); + assertEquals("Codecentric's Spring Boot Admin notice", card.getTitle()); + assertEquals( + "ServiceName: #{instance.registration.name}(#{instance.id}) \n" + + "ServiceUrl: #{instance.registration.serviceUrl} \n" + + "Status: changed status from [#{lastStatus}] to [#{event.statusInfo.status}]", + actualFeiShuNotifierResult.getMessage()); + assertEquals("red", card.getThemeColor()); + assertNull(actualFeiShuNotifierResult.getSecret()); + assertNull(actualFeiShuNotifierResult.getWebhookUrl()); + assertEquals(MessageType.interactive, actualFeiShuNotifierResult.getMessageType()); + assertTrue(actualFeiShuNotifierResult.isEnabled()); + assertTrue(actualFeiShuNotifierResult.isAtAll()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualFeiShuNotifierResult.getIgnoreChanges()); + } + + /** + * Test FilteringNotifierWebConfiguration + * {@link FilteringNotifierWebConfiguration#notificationFilterController()}. + *

+ * Method under test: + * {@link FilteringNotifierWebConfiguration#notificationFilterController()} + */ + @Test + public void testFilteringNotifierWebConfigurationNotificationFilterController() { + // Arrange, Act and Assert + assertTrue(filteringNotifierWebConfiguration.notificationFilterController().getFilters().isEmpty()); + } + + /** + * Test HipchatNotifierConfiguration + * {@link HipchatNotifierConfiguration#hipchatNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link HipchatNotifierConfiguration#hipchatNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testHipchatNotifierConfigurationHipchatNotifier_givenMinusOne() { + // Arrange + HipchatNotifierConfiguration hipchatNotifierConfiguration = new HipchatNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + HipchatNotifier actualHipchatNotifierResult = hipchatNotifierConfiguration.hipchatNotifier(repository, + proxyProperties); + + // Assert + assertEquals( + "#{instance.registration.name}/#{instance.id} is #{event.statusInfo.status" + + "}", + actualHipchatNotifierResult.getDescription()); + assertNull(actualHipchatNotifierResult.getAuthToken()); + assertNull(actualHipchatNotifierResult.getRoomId()); + assertNull(actualHipchatNotifierResult.getUrl()); + assertFalse(actualHipchatNotifierResult.isNotify()); + assertTrue(actualHipchatNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualHipchatNotifierResult.getIgnoreChanges()); + } + + /** + * Test HipchatNotifierConfiguration + * {@link HipchatNotifierConfiguration#hipchatNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Then return Description is a string.
  • + *
+ *

+ * Method under test: + * {@link HipchatNotifierConfiguration#hipchatNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testHipchatNotifierConfigurationHipchatNotifier_thenReturnDescriptionIsAString() { + // Arrange + HipchatNotifierConfiguration hipchatNotifierConfiguration = new HipchatNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + HipchatNotifier actualHipchatNotifierResult = hipchatNotifierConfiguration.hipchatNotifier(repository, + proxyProperties); + + // Assert + assertEquals( + "#{instance.registration.name}/#{instance.id} is #{event.statusInfo.status" + + "}", + actualHipchatNotifierResult.getDescription()); + assertNull(actualHipchatNotifierResult.getAuthToken()); + assertNull(actualHipchatNotifierResult.getRoomId()); + assertNull(actualHipchatNotifierResult.getUrl()); + assertFalse(actualHipchatNotifierResult.isNotify()); + assertTrue(actualHipchatNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualHipchatNotifierResult.getIgnoreChanges()); + } + + /** + * Test LetsChatNotifierConfiguration + * {@link LetsChatNotifierConfiguration#letsChatNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link LetsChatNotifierConfiguration#letsChatNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testLetsChatNotifierConfigurationLetsChatNotifier() { + // Arrange + LetsChatNotifierConfiguration letsChatNotifierConfiguration = new LetsChatNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + LetsChatNotifier actualLetsChatNotifierResult = letsChatNotifierConfiguration.letsChatNotifier(repository, + proxyProperties); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualLetsChatNotifierResult.getMessage()); + assertEquals("Spring Boot Admin", actualLetsChatNotifierResult.getUsername()); + assertNull(actualLetsChatNotifierResult.getRoom()); + assertNull(actualLetsChatNotifierResult.getToken()); + assertNull(actualLetsChatNotifierResult.getUrl()); + assertTrue(actualLetsChatNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualLetsChatNotifierResult.getIgnoreChanges()); + } + + /** + * Test LetsChatNotifierConfiguration + * {@link LetsChatNotifierConfiguration#letsChatNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link LetsChatNotifierConfiguration#letsChatNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testLetsChatNotifierConfigurationLetsChatNotifier_givenMinusOne() { + // Arrange + LetsChatNotifierConfiguration letsChatNotifierConfiguration = new LetsChatNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + LetsChatNotifier actualLetsChatNotifierResult = letsChatNotifierConfiguration.letsChatNotifier(repository, + proxyProperties); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualLetsChatNotifierResult.getMessage()); + assertEquals("Spring Boot Admin", actualLetsChatNotifierResult.getUsername()); + assertNull(actualLetsChatNotifierResult.getRoom()); + assertNull(actualLetsChatNotifierResult.getToken()); + assertNull(actualLetsChatNotifierResult.getUrl()); + assertTrue(actualLetsChatNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualLetsChatNotifierResult.getIgnoreChanges()); + } + + /** + * Test MailNotifierConfiguration + * {@link MailNotifierConfiguration#mailNotifier(JavaMailSender, InstanceRepository, TemplateEngine)}. + *

+ * Method under test: + * {@link MailNotifierConfiguration#mailNotifier(JavaMailSender, InstanceRepository, TemplateEngine)} + */ + @Test + public void testMailNotifierConfigurationMailNotifier() { + // Arrange + JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + // Act + MailNotifier actualMailNotifierResult = mailNotifierConfiguration.mailNotifier(mailSender, repository, + new TemplateEngine()); + + // Assert + assertEquals("META-INF/spring-boot-admin-server/mail/status-changed.html", + actualMailNotifierResult.getTemplate()); + assertEquals("Spring Boot Admin ", actualMailNotifierResult.getFrom()); + assertNull(actualMailNotifierResult.getBaseUrl()); + assertEquals(0, actualMailNotifierResult.getCc().length); + assertTrue(actualMailNotifierResult.isEnabled()); + assertTrue(actualMailNotifierResult.getAdditionalProperties().isEmpty()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualMailNotifierResult.getIgnoreChanges()); + assertArrayEquals(new String[] { "root@localhost" }, actualMailNotifierResult.getTo()); + } + + /** + * Test MailNotifierConfiguration + * {@link MailNotifierConfiguration#mailNotifierTemplateEngine()}. + *

+ * Method under test: {@link MailNotifierConfiguration#mailNotifierTemplateEngine()} + */ + @Test + public void testMailNotifierConfigurationMailNotifierTemplateEngine() { + // Arrange and Act + TemplateEngine actualMailNotifierTemplateEngineResult = mailNotifierConfiguration.mailNotifierTemplateEngine(); + + // Assert + assertTrue(actualMailNotifierTemplateEngineResult.getConfiguration() instanceof EngineConfiguration); + assertTrue(actualMailNotifierTemplateEngineResult.getCacheManager() instanceof StandardCacheManager); + assertTrue(actualMailNotifierTemplateEngineResult + .getEngineContextFactory() instanceof StandardEngineContextFactory); + assertTrue(actualMailNotifierTemplateEngineResult instanceof SpringTemplateEngine); + assertTrue(actualMailNotifierTemplateEngineResult + .getDecoupledTemplateLogicResolver() instanceof StandardDecoupledTemplateLogicResolver); + Map> dialectsByPrefix = actualMailNotifierTemplateEngineResult.getDialectsByPrefix(); + assertEquals(1, dialectsByPrefix.size()); + assertEquals(1, actualMailNotifierTemplateEngineResult.getDialects().size()); + assertEquals(1, actualMailNotifierTemplateEngineResult.getLinkBuilders().size()); + assertEquals(1, actualMailNotifierTemplateEngineResult.getMessageResolvers().size()); + assertEquals(1, actualMailNotifierTemplateEngineResult.getTemplateResolvers().size()); + assertFalse(((SpringTemplateEngine) actualMailNotifierTemplateEngineResult).getEnableSpringELCompiler()); + assertFalse(((SpringTemplateEngine) actualMailNotifierTemplateEngineResult) + .getRenderHiddenMarkersBeforeCheckboxes()); + assertTrue(dialectsByPrefix.containsKey(null)); + assertTrue(actualMailNotifierTemplateEngineResult.isInitialized()); + } + + /** + * Test MicrosoftTeamsNotifierConfiguration + * {@link MicrosoftTeamsNotifierConfiguration#microsoftTeamsNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link MicrosoftTeamsNotifierConfiguration#microsoftTeamsNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testMicrosoftTeamsNotifierConfigurationMicrosoftTeamsNotifier() { + // Arrange + MicrosoftTeamsNotifierConfiguration microsoftTeamsNotifierConfiguration = new MicrosoftTeamsNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + MicrosoftTeamsNotifier actualMicrosoftTeamsNotifierResult = microsoftTeamsNotifierConfiguration + .microsoftTeamsNotifier(repository, proxyProperties); + + // Assert + assertEquals("#{instance.registration.name} with id #{instance.id} changed status from #{lastStatus} to #{event" + + ".statusInfo.status}", actualMicrosoftTeamsNotifierResult.getStatusActivitySubtitle()); + assertEquals("#{instance.registration.name} with id #{instance.id} has de-registered from Spring Boot Admin", + actualMicrosoftTeamsNotifierResult.getDeregisterActivitySubtitle()); + assertEquals("#{instance.registration.name} with id #{instance.id} has registered with Spring Boot Admin", + actualMicrosoftTeamsNotifierResult.getRegisterActivitySubtitle()); + assertEquals("De-Registered", actualMicrosoftTeamsNotifierResult.getDeRegisteredTitle()); + assertEquals("Registered", actualMicrosoftTeamsNotifierResult.getRegisteredTitle()); + assertEquals("Spring Boot Admin Notification", actualMicrosoftTeamsNotifierResult.getMessageSummary()); + assertEquals("Status Changed", actualMicrosoftTeamsNotifierResult.getStatusChangedTitle()); + assertEquals( + "event.type == 'STATUS_CHANGED' ? (event.statusInfo.status=='UP' ? '6db33f' : 'b32d36') : '439fe0'", + actualMicrosoftTeamsNotifierResult.getThemeColor()); + assertNull(actualMicrosoftTeamsNotifierResult.getWebhookUrl()); + assertTrue(actualMicrosoftTeamsNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualMicrosoftTeamsNotifierResult.getIgnoreChanges()); + } + + /** + * Test MicrosoftTeamsNotifierConfiguration + * {@link MicrosoftTeamsNotifierConfiguration#microsoftTeamsNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link MicrosoftTeamsNotifierConfiguration#microsoftTeamsNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testMicrosoftTeamsNotifierConfigurationMicrosoftTeamsNotifier_givenMinusOne() { + // Arrange + MicrosoftTeamsNotifierConfiguration microsoftTeamsNotifierConfiguration = new MicrosoftTeamsNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + MicrosoftTeamsNotifier actualMicrosoftTeamsNotifierResult = microsoftTeamsNotifierConfiguration + .microsoftTeamsNotifier(repository, proxyProperties); + + // Assert + assertEquals("#{instance.registration.name} with id #{instance.id} changed status from #{lastStatus} to #{event" + + ".statusInfo.status}", actualMicrosoftTeamsNotifierResult.getStatusActivitySubtitle()); + assertEquals("#{instance.registration.name} with id #{instance.id} has de-registered from Spring Boot Admin", + actualMicrosoftTeamsNotifierResult.getDeregisterActivitySubtitle()); + assertEquals("#{instance.registration.name} with id #{instance.id} has registered with Spring Boot Admin", + actualMicrosoftTeamsNotifierResult.getRegisterActivitySubtitle()); + assertEquals("De-Registered", actualMicrosoftTeamsNotifierResult.getDeRegisteredTitle()); + assertEquals("Registered", actualMicrosoftTeamsNotifierResult.getRegisteredTitle()); + assertEquals("Spring Boot Admin Notification", actualMicrosoftTeamsNotifierResult.getMessageSummary()); + assertEquals("Status Changed", actualMicrosoftTeamsNotifierResult.getStatusChangedTitle()); + assertEquals( + "event.type == 'STATUS_CHANGED' ? (event.statusInfo.status=='UP' ? '6db33f' : 'b32d36') : '439fe0'", + actualMicrosoftTeamsNotifierResult.getThemeColor()); + assertNull(actualMicrosoftTeamsNotifierResult.getWebhookUrl()); + assertTrue(actualMicrosoftTeamsNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualMicrosoftTeamsNotifierResult.getIgnoreChanges()); + } + + /** + * Test OpsGenieNotifierConfiguration + * {@link OpsGenieNotifierConfiguration#opsgenieNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link OpsGenieNotifierConfiguration#opsgenieNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testOpsGenieNotifierConfigurationOpsgenieNotifier() { + // Arrange + OpsGenieNotifierConfiguration opsGenieNotifierConfiguration = new OpsGenieNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + OpsGenieNotifier actualOpsgenieNotifierResult = opsGenieNotifierConfiguration.opsgenieNotifier(repository, + proxyProperties); + + // Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + actualOpsgenieNotifierResult.getMessage()); + assertEquals("https://api.opsgenie.com/v2/alerts", actualOpsgenieNotifierResult.getUrl().toString()); + assertNull(actualOpsgenieNotifierResult.getActions()); + assertNull(actualOpsgenieNotifierResult.getApiKey()); + assertNull(actualOpsgenieNotifierResult.getEntity()); + assertNull(actualOpsgenieNotifierResult.getSource()); + assertNull(actualOpsgenieNotifierResult.getTags()); + assertNull(actualOpsgenieNotifierResult.getUser()); + assertTrue(actualOpsgenieNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualOpsgenieNotifierResult.getIgnoreChanges()); + } + + /** + * Test OpsGenieNotifierConfiguration + * {@link OpsGenieNotifierConfiguration#opsgenieNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link OpsGenieNotifierConfiguration#opsgenieNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testOpsGenieNotifierConfigurationOpsgenieNotifier_givenMinusOne() { + // Arrange + OpsGenieNotifierConfiguration opsGenieNotifierConfiguration = new OpsGenieNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + OpsGenieNotifier actualOpsgenieNotifierResult = opsGenieNotifierConfiguration.opsgenieNotifier(repository, + proxyProperties); + + // Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + actualOpsgenieNotifierResult.getMessage()); + assertEquals("https://api.opsgenie.com/v2/alerts", actualOpsgenieNotifierResult.getUrl().toString()); + assertNull(actualOpsgenieNotifierResult.getActions()); + assertNull(actualOpsgenieNotifierResult.getApiKey()); + assertNull(actualOpsgenieNotifierResult.getEntity()); + assertNull(actualOpsgenieNotifierResult.getSource()); + assertNull(actualOpsgenieNotifierResult.getTags()); + assertNull(actualOpsgenieNotifierResult.getUser()); + assertTrue(actualOpsgenieNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualOpsgenieNotifierResult.getIgnoreChanges()); + } + + /** + * Test PagerdutyNotifierConfiguration + * {@link PagerdutyNotifierConfiguration#pagerdutyNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link PagerdutyNotifierConfiguration#pagerdutyNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testPagerdutyNotifierConfigurationPagerdutyNotifier() { + // Arrange + PagerdutyNotifierConfiguration pagerdutyNotifierConfiguration = new PagerdutyNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + PagerdutyNotifier actualPagerdutyNotifierResult = pagerdutyNotifierConfiguration.pagerdutyNotifier(repository, + proxyProperties); + + // Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + actualPagerdutyNotifierResult.getDescription()); + URI url = actualPagerdutyNotifierResult.getUrl(); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", url.toString()); + assertNull(actualPagerdutyNotifierResult.getClient()); + assertNull(actualPagerdutyNotifierResult.getServiceKey()); + assertNull(actualPagerdutyNotifierResult.getClientUrl()); + assertTrue(actualPagerdutyNotifierResult.isEnabled()); + assertSame(actualPagerdutyNotifierResult.DEFAULT_URI, url); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualPagerdutyNotifierResult.getIgnoreChanges()); + } + + /** + * Test PagerdutyNotifierConfiguration + * {@link PagerdutyNotifierConfiguration#pagerdutyNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link PagerdutyNotifierConfiguration#pagerdutyNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testPagerdutyNotifierConfigurationPagerdutyNotifier_givenMinusOne() { + // Arrange + PagerdutyNotifierConfiguration pagerdutyNotifierConfiguration = new PagerdutyNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + PagerdutyNotifier actualPagerdutyNotifierResult = pagerdutyNotifierConfiguration.pagerdutyNotifier(repository, + proxyProperties); + + // Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + actualPagerdutyNotifierResult.getDescription()); + URI url = actualPagerdutyNotifierResult.getUrl(); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", url.toString()); + assertNull(actualPagerdutyNotifierResult.getClient()); + assertNull(actualPagerdutyNotifierResult.getServiceKey()); + assertNull(actualPagerdutyNotifierResult.getClientUrl()); + assertTrue(actualPagerdutyNotifierResult.isEnabled()); + assertSame(actualPagerdutyNotifierResult.DEFAULT_URI, url); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualPagerdutyNotifierResult.getIgnoreChanges()); + } + + /** + * Test RocketChatNotifierConfiguration + * {@link RocketChatNotifierConfiguration#rocketChatNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link RocketChatNotifierConfiguration#rocketChatNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testRocketChatNotifierConfigurationRocketChatNotifier() throws EvaluationException { + // Arrange + RocketChatNotifierConfiguration rocketChatNotifierConfiguration = new RocketChatNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + RocketChatNotifier actualRocketChatNotifierResult = rocketChatNotifierConfiguration + .rocketChatNotifier(repository, proxyProperties); + + // Assert + Expression message = actualRocketChatNotifierResult.getMessage(); + assertTrue(message instanceof CompositeStringExpression); + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + message.getExpressionString()); + assertNull(actualRocketChatNotifierResult.getRoomId()); + assertNull(actualRocketChatNotifierResult.getToken()); + assertNull(actualRocketChatNotifierResult.getUrl()); + assertNull(actualRocketChatNotifierResult.getUserId()); + assertEquals(7, ((CompositeStringExpression) message).getExpressions().length); + assertTrue(actualRocketChatNotifierResult.isEnabled()); + Class expectedValueType = String.class; + assertEquals(expectedValueType, message.getValueType()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualRocketChatNotifierResult.getIgnoreChanges()); + } + + /** + * Test RocketChatNotifierConfiguration + * {@link RocketChatNotifierConfiguration#rocketChatNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link RocketChatNotifierConfiguration#rocketChatNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testRocketChatNotifierConfigurationRocketChatNotifier_givenMinusOne() throws EvaluationException { + // Arrange + RocketChatNotifierConfiguration rocketChatNotifierConfiguration = new RocketChatNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + RocketChatNotifier actualRocketChatNotifierResult = rocketChatNotifierConfiguration + .rocketChatNotifier(repository, proxyProperties); + + // Assert + Expression message = actualRocketChatNotifierResult.getMessage(); + assertTrue(message instanceof CompositeStringExpression); + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + message.getExpressionString()); + assertNull(actualRocketChatNotifierResult.getRoomId()); + assertNull(actualRocketChatNotifierResult.getToken()); + assertNull(actualRocketChatNotifierResult.getUrl()); + assertNull(actualRocketChatNotifierResult.getUserId()); + assertEquals(7, ((CompositeStringExpression) message).getExpressions().length); + assertTrue(actualRocketChatNotifierResult.isEnabled()); + Class expectedValueType = String.class; + assertEquals(expectedValueType, message.getValueType()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualRocketChatNotifierResult.getIgnoreChanges()); + } + + /** + * Test SlackNotifierConfiguration + * {@link SlackNotifierConfiguration#slackNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link SlackNotifierConfiguration#slackNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testSlackNotifierConfigurationSlackNotifier() { + // Arrange + SlackNotifierConfiguration slackNotifierConfiguration = new SlackNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + SlackNotifier actualSlackNotifierResult = slackNotifierConfiguration.slackNotifier(repository, proxyProperties); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualSlackNotifierResult.getMessage()); + assertEquals("Spring Boot Admin", actualSlackNotifierResult.getUsername()); + assertNull(actualSlackNotifierResult.getChannel()); + assertNull(actualSlackNotifierResult.getIcon()); + assertNull(actualSlackNotifierResult.getWebhookUrl()); + assertTrue(actualSlackNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualSlackNotifierResult.getIgnoreChanges()); + } + + /** + * Test SlackNotifierConfiguration + * {@link SlackNotifierConfiguration#slackNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link SlackNotifierConfiguration#slackNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testSlackNotifierConfigurationSlackNotifier_givenMinusOne() { + // Arrange + SlackNotifierConfiguration slackNotifierConfiguration = new SlackNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + SlackNotifier actualSlackNotifierResult = slackNotifierConfiguration.slackNotifier(repository, proxyProperties); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualSlackNotifierResult.getMessage()); + assertEquals("Spring Boot Admin", actualSlackNotifierResult.getUsername()); + assertNull(actualSlackNotifierResult.getChannel()); + assertNull(actualSlackNotifierResult.getIcon()); + assertNull(actualSlackNotifierResult.getWebhookUrl()); + assertTrue(actualSlackNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualSlackNotifierResult.getIgnoreChanges()); + } + + /** + * Test TelegramNotifierConfiguration + * {@link TelegramNotifierConfiguration#telegramNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link TelegramNotifierConfiguration#telegramNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testTelegramNotifierConfigurationTelegramNotifier_givenMinusOne() { + // Arrange + TelegramNotifierConfiguration telegramNotifierConfiguration = new TelegramNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + TelegramNotifier actualTelegramNotifierResult = telegramNotifierConfiguration.telegramNotifier(repository, + proxyProperties); + + // Assert + assertEquals("HTML", actualTelegramNotifierResult.getParseMode()); + assertEquals("https://api.telegram.org", actualTelegramNotifierResult.getApiUrl()); + assertNull(actualTelegramNotifierResult.getAuthToken()); + assertNull(actualTelegramNotifierResult.getChatId()); + assertFalse(actualTelegramNotifierResult.isDisableNotify()); + assertTrue(actualTelegramNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualTelegramNotifierResult.getIgnoreChanges()); + } + + /** + * Test TelegramNotifierConfiguration + * {@link TelegramNotifierConfiguration#telegramNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Then return ParseMode is {@code HTML}.
  • + *
+ *

+ * Method under test: + * {@link TelegramNotifierConfiguration#telegramNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testTelegramNotifierConfigurationTelegramNotifier_thenReturnParseModeIsHtml() { + // Arrange + TelegramNotifierConfiguration telegramNotifierConfiguration = new TelegramNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + TelegramNotifier actualTelegramNotifierResult = telegramNotifierConfiguration.telegramNotifier(repository, + proxyProperties); + + // Assert + assertEquals("HTML", actualTelegramNotifierResult.getParseMode()); + assertEquals("https://api.telegram.org", actualTelegramNotifierResult.getApiUrl()); + assertNull(actualTelegramNotifierResult.getAuthToken()); + assertNull(actualTelegramNotifierResult.getChatId()); + assertFalse(actualTelegramNotifierResult.isDisableNotify()); + assertTrue(actualTelegramNotifierResult.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualTelegramNotifierResult.getIgnoreChanges()); + } + + /** + * Test WebexNotifierConfiguration + * {@link WebexNotifierConfiguration#webexNotifier(InstanceRepository, NotifierProxyProperties)}. + *

+ * Method under test: + * {@link WebexNotifierConfiguration#webexNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testWebexNotifierConfigurationWebexNotifier() { + // Arrange + WebexNotifierConfiguration webexNotifierConfiguration = new WebexNotifierConfiguration(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act and Assert + Expression message = webexNotifierConfiguration.webexNotifier(repository, proxyProperties).getMessage(); + assertTrue(message instanceof CompositeStringExpression); + Expression[] expressions = ((CompositeStringExpression) message).getExpressions(); + assertTrue(expressions[0] instanceof LiteralExpression); + assertTrue(expressions[2] instanceof LiteralExpression); + assertTrue(expressions[4] instanceof LiteralExpression); + assertTrue(expressions[6] instanceof LiteralExpression); + assertTrue(expressions[3] instanceof SpelExpression); + assertTrue(expressions[5] instanceof SpelExpression); + assertEquals(7, expressions.length); + } + + /** + * Test WebexNotifierConfiguration + * {@link WebexNotifierConfiguration#webexNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given {@code 8080}.
  • + *
  • Then calls {@link IMap#addEntryListener(MapListener, boolean)}.
  • + *
+ *

+ * Method under test: + * {@link WebexNotifierConfiguration#webexNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testWebexNotifierConfigurationWebexNotifier_given8080_thenCallsAddEntryListener() { + // Arrange + WebexNotifierConfiguration webexNotifierConfiguration = new WebexNotifierConfiguration(); + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository( + new HazelcastEventStore(eventLogs)); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(8080); + proxyProperties.setUsername("janedoe"); + + // Act + WebexNotifier actualWebexNotifierResult = webexNotifierConfiguration.webexNotifier(repository, proxyProperties); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + Expression message = actualWebexNotifierResult.getMessage(); + assertTrue(message instanceof CompositeStringExpression); + Expression[] expressions = ((CompositeStringExpression) message).getExpressions(); + assertTrue(expressions[0] instanceof LiteralExpression); + assertTrue(expressions[2] instanceof LiteralExpression); + assertTrue(expressions[4] instanceof LiteralExpression); + assertTrue(expressions[6] instanceof LiteralExpression); + assertTrue(expressions[3] instanceof SpelExpression); + assertTrue(expressions[5] instanceof SpelExpression); + assertEquals(7, expressions.length); + } + + /** + * Test WebexNotifierConfiguration + * {@link WebexNotifierConfiguration#webexNotifier(InstanceRepository, NotifierProxyProperties)}. + *

    + *
  • Given minus one.
  • + *
+ *

+ * Method under test: + * {@link WebexNotifierConfiguration#webexNotifier(InstanceRepository, NotifierProxyProperties)} + */ + @Test + public void testWebexNotifierConfigurationWebexNotifier_givenMinusOne() { + // Arrange + WebexNotifierConfiguration webexNotifierConfiguration = new WebexNotifierConfiguration(); + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository( + new HazelcastEventStore(eventLogs)); + + NotifierProxyProperties proxyProperties = new NotifierProxyProperties(); + proxyProperties.setHost("localhost"); + proxyProperties.setPassword("iloveyou"); + proxyProperties.setPort(-1); + proxyProperties.setUsername("janedoe"); + + // Act + WebexNotifier actualWebexNotifierResult = webexNotifierConfiguration.webexNotifier(repository, proxyProperties); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + Expression message = actualWebexNotifierResult.getMessage(); + assertTrue(message instanceof CompositeStringExpression); + Expression[] expressions = ((CompositeStringExpression) message).getExpressions(); + assertTrue(expressions[0] instanceof LiteralExpression); + assertTrue(expressions[2] instanceof LiteralExpression); + assertTrue(expressions[4] instanceof LiteralExpression); + assertTrue(expressions[6] instanceof LiteralExpression); + assertTrue(expressions[3] instanceof SpelExpression); + assertTrue(expressions[5] instanceof SpelExpression); + assertEquals(7, expressions.length); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerPropertiesDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerPropertiesDiffblueTest.java new file mode 100644 index 00000000000..ec39253bf1a --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerPropertiesDiffblueTest.java @@ -0,0 +1,106 @@ +package de.codecentric.boot.admin.server.config; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class AdminServerPropertiesDiffblueTest { + + /** + * Test {@link AdminServerProperties#setContextPath(String)}. + *

    + *
  • Then {@link AdminServerProperties} (default constructor) ContextPath is + * {@code /Context Path}.
  • + *
+ *

+ * Method under test: {@link AdminServerProperties#setContextPath(String)} + */ + @Test + public void testSetContextPath_thenAdminServerPropertiesContextPathIsContextPath() { + // Arrange + AdminServerProperties adminServerProperties = new AdminServerProperties(); + + // Act + adminServerProperties.setContextPath("Context Path"); + + // Assert + assertEquals("/Context Path", adminServerProperties.getContextPath()); + } + + /** + * Test {@link AdminServerProperties#setContextPath(String)}. + *

    + *
  • Then {@link AdminServerProperties} (default constructor) ContextPath is + * {@code /}.
  • + *
+ *

+ * Method under test: {@link AdminServerProperties#setContextPath(String)} + */ + @Test + public void testSetContextPath_thenAdminServerPropertiesContextPathIsSlash() { + // Arrange + AdminServerProperties adminServerProperties = new AdminServerProperties(); + + // Act + adminServerProperties.setContextPath("///"); + + // Assert + assertEquals("/", adminServerProperties.getContextPath()); + } + + /** + * Test {@link AdminServerProperties#setContextPath(String)}. + *

    + *
  • When {@code null}.
  • + *
  • Then {@link AdminServerProperties} (default constructor) ContextPath is + * {@code null}.
  • + *
+ *

+ * Method under test: {@link AdminServerProperties#setContextPath(String)} + */ + @Test + public void testSetContextPath_whenNull_thenAdminServerPropertiesContextPathIsNull() { + // Arrange + AdminServerProperties adminServerProperties = new AdminServerProperties(); + + // Act + adminServerProperties.setContextPath(null); + + // Assert + assertNull(adminServerProperties.getContextPath()); + } + + /** + * Test {@link AdminServerProperties#setContextPath(String)}. + *

    + *
  • When {@code /}.
  • + *
  • Then {@link AdminServerProperties} (default constructor) ContextPath is empty + * string.
  • + *
+ *

+ * Method under test: {@link AdminServerProperties#setContextPath(String)} + */ + @Test + public void testSetContextPath_whenSlash_thenAdminServerPropertiesContextPathIsEmptyString() { + // Arrange + AdminServerProperties adminServerProperties = new AdminServerProperties(); + + // Act + adminServerProperties.setContextPath("/"); + + // Assert that nothing has changed + assertEquals("", adminServerProperties.getContextPath()); + } + + /** + * Test {@link AdminServerProperties#path(String)}. + *

+ * Method under test: {@link AdminServerProperties#path(String)} + */ + @Test + public void testPath() { + // Arrange, Act and Assert + assertEquals("Path", new AdminServerProperties().path("Path")); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerWebConfigurationDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerWebConfigurationDiffblueTest.java new file mode 100644 index 00000000000..754485cd0cc --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerWebConfigurationDiffblueTest.java @@ -0,0 +1,284 @@ +package de.codecentric.boot.admin.server.config; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.Module; +import com.fasterxml.jackson.databind.module.SimpleModule; +import de.codecentric.boot.admin.server.config.AdminServerWebConfiguration.ReactiveRestApiConfiguration; +import de.codecentric.boot.admin.server.config.AdminServerWebConfiguration.ServletRestApiConfiguration; +import de.codecentric.boot.admin.server.domain.entities.Application; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import de.codecentric.boot.admin.server.services.ApplicationRegistry; +import de.codecentric.boot.admin.server.services.InstanceFilter; +import de.codecentric.boot.admin.server.services.InstanceIdGenerator; +import de.codecentric.boot.admin.server.services.InstanceRegistry; +import de.codecentric.boot.admin.server.utils.jackson.AdminServerModule; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient.Builder; +import de.codecentric.boot.admin.server.web.reactive.AdminControllerHandlerMapping; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.util.AntPathMatcher; +import org.springframework.web.accept.ContentNegotiationManager; +import org.springframework.web.cors.reactive.DefaultCorsProcessor; +import org.springframework.web.reactive.accept.RequestedContentTypeResolver; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; +import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMethodMappingNamingStrategy; +import org.springframework.web.util.pattern.PathPatternParser; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { AdminServerWebConfiguration.class, AdminServerProperties.class, + InstanceRegistry.class, ApplicationRegistry.class, InstanceEventPublisher.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class AdminServerWebConfigurationDiffblueTest { + + @Autowired + private AdminServerProperties adminServerProperties; + + @Autowired + private AdminServerWebConfiguration adminServerWebConfiguration; + + @MockitoBean + private InstanceEventStore instanceEventStore; + + @MockitoBean + private InstanceFilter instanceFilter; + + @MockitoBean + private InstanceIdGenerator instanceIdGenerator; + + @MockitoBean + private InstanceRepository instanceRepository; + + /** + * Test {@link AdminServerWebConfiguration#adminJacksonModule()}. + *

+ * Method under test: {@link AdminServerWebConfiguration#adminJacksonModule()} + */ + @Test + public void testAdminJacksonModule() { + // Arrange and Act + SimpleModule actualAdminJacksonModuleResult = adminServerWebConfiguration.adminJacksonModule(); + + // Assert + assertTrue(actualAdminJacksonModuleResult instanceof AdminServerModule); + Iterable dependencies = actualAdminJacksonModuleResult.getDependencies(); + assertTrue(dependencies instanceof List); + Version versionResult = actualAdminJacksonModuleResult.version(); + assertEquals("", versionResult.getArtifactId()); + assertEquals("", versionResult.getGroupId()); + assertEquals("//0.0.0", versionResult.toFullString()); + assertEquals("de.codecentric.boot.admin.server.utils.jackson.AdminServerModule", + actualAdminJacksonModuleResult.getModuleName()); + assertEquals("de.codecentric.boot.admin.server.utils.jackson.AdminServerModule", + actualAdminJacksonModuleResult.getTypeId()); + assertEquals(0, versionResult.getMajorVersion()); + assertEquals(0, versionResult.getMinorVersion()); + assertEquals(0, versionResult.getPatchLevel()); + assertFalse(versionResult.isSnapshot()); + assertTrue(versionResult.isUknownVersion()); + assertTrue(versionResult.isUnknownVersion()); + assertTrue(((List) dependencies).isEmpty()); + } + + /** + * Test + * {@link AdminServerWebConfiguration#instancesController(InstanceRegistry, InstanceEventStore)}. + *

+ * Method under test: + * {@link AdminServerWebConfiguration#instancesController(InstanceRegistry, InstanceEventStore)} + */ + @Test + public void testInstancesController() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = new InstanceRegistry( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + adminServerWebConfiguration.instancesController(instanceRegistry, new InMemoryEventStore()).events()); + createResult.expectComplete().verify(); + } + + /** + * Test + * {@link AdminServerWebConfiguration#applicationsController(ApplicationRegistry, ApplicationEventPublisher)}. + *

+ * Method under test: + * {@link AdminServerWebConfiguration#applicationsController(ApplicationRegistry, ApplicationEventPublisher)} + */ + @Test + public void testApplicationsController() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(adminServerWebConfiguration + .applicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + } + + /** + * Test ReactiveRestApiConfiguration + * {@link ReactiveRestApiConfiguration#adminHandlerMapping(RequestedContentTypeResolver)}. + *

+ * Method under test: + * {@link ReactiveRestApiConfiguration#adminHandlerMapping(RequestedContentTypeResolver)} + */ + @Test + public void testReactiveRestApiConfigurationAdminHandlerMapping() throws IllegalStateException { + // Arrange + RequestedContentTypeResolver webFluxContentTypeResolver = mock(RequestedContentTypeResolver.class); + + // Act + RequestMappingHandlerMapping actualAdminHandlerMappingResult = new ReactiveRestApiConfiguration( + new AdminServerProperties()) + .adminHandlerMapping(webFluxContentTypeResolver); + + // Assert + assertTrue(actualAdminHandlerMappingResult instanceof AdminControllerHandlerMapping); + assertTrue(actualAdminHandlerMappingResult.getCorsProcessor() instanceof DefaultCorsProcessor); + PathPatternParser pathPatternParser = actualAdminHandlerMappingResult.getPathPatternParser(); + assertEquals('/', pathPatternParser.getPathOptions().separator()); + assertNull(actualAdminHandlerMappingResult.getApplicationContext()); + assertEquals(0, actualAdminHandlerMappingResult.getOrder()); + assertFalse(pathPatternParser.isMatchOptionalTrailingSeparator()); + assertTrue(actualAdminHandlerMappingResult.getHandlerMethods().isEmpty()); + assertTrue(actualAdminHandlerMappingResult.getPathPrefixes().isEmpty()); + assertTrue(pathPatternParser.isCaseSensitive()); + assertSame(webFluxContentTypeResolver, actualAdminHandlerMappingResult.getContentTypeResolver()); + } + + /** + * Test ReactiveRestApiConfiguration + * {@link ReactiveRestApiConfiguration#instancesProxyController(InstanceRegistry, Builder)}. + *

    + *
  • Then calls {@link Builder#build()}.
  • + *
+ *

+ * Method under test: + * {@link ReactiveRestApiConfiguration#instancesProxyController(InstanceRegistry, Builder)} + */ + @Test + public void testReactiveRestApiConfigurationInstancesProxyController_thenCallsBuild() { + // Arrange + ReactiveRestApiConfiguration reactiveRestApiConfiguration = new ReactiveRestApiConfiguration( + new AdminServerProperties()); + InstanceRegistry instanceRegistry = new InstanceRegistry( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + WebClient.Builder builder = mock(WebClient.Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder).build(); + Builder instanceWebClientBuilder = mock(Builder.class); + when(instanceWebClientBuilder.build()).thenReturn(buildResult); + + // Act + reactiveRestApiConfiguration.instancesProxyController(instanceRegistry, instanceWebClientBuilder); + + // Assert + verify(instanceWebClientBuilder).build(); + verify(builder).build(); + } + + /** + * Test ServletRestApiConfiguration + * {@link ServletRestApiConfiguration#adminHandlerMapping(ContentNegotiationManager)}. + *

+ * Method under test: + * {@link ServletRestApiConfiguration#adminHandlerMapping(ContentNegotiationManager)} + */ + @Test + public void testServletRestApiConfigurationAdminHandlerMapping() { + // Arrange + ServletRestApiConfiguration servletRestApiConfiguration = new ServletRestApiConfiguration( + new AdminServerProperties()); + ContentNegotiationManager contentNegotiationManager = new ContentNegotiationManager(); + + // Act + org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping actualAdminHandlerMappingResult = servletRestApiConfiguration + .adminHandlerMapping(contentNegotiationManager); + + // Assert + assertTrue( + actualAdminHandlerMappingResult instanceof de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping); + assertTrue(actualAdminHandlerMappingResult.getPathMatcher() instanceof AntPathMatcher); + assertTrue(actualAdminHandlerMappingResult + .getCorsProcessor() instanceof org.springframework.web.cors.DefaultCorsProcessor); + assertTrue(actualAdminHandlerMappingResult + .getNamingStrategy() instanceof RequestMappingInfoHandlerMethodMappingNamingStrategy); + assertNull(actualAdminHandlerMappingResult.getDefaultHandler()); + assertNull(actualAdminHandlerMappingResult.getFileExtensions()); + assertNull(actualAdminHandlerMappingResult.getCorsConfigurationSource()); + assertNull(actualAdminHandlerMappingResult.getAdaptedInterceptors()); + assertEquals(0, actualAdminHandlerMappingResult.getOrder()); + assertFalse(actualAdminHandlerMappingResult.useRegisteredSuffixPatternMatch()); + assertFalse(actualAdminHandlerMappingResult.useSuffixPatternMatch()); + assertFalse(actualAdminHandlerMappingResult.useTrailingSlashMatch()); + assertTrue(actualAdminHandlerMappingResult.getHandlerMethods().isEmpty()); + assertTrue(actualAdminHandlerMappingResult.getPathPrefixes().isEmpty()); + assertSame(contentNegotiationManager, actualAdminHandlerMappingResult.getContentNegotiationManager()); + } + + /** + * Test ServletRestApiConfiguration + * {@link ServletRestApiConfiguration#instancesProxyController(InstanceRegistry, Builder)}. + *

    + *
  • Then calls {@link Builder#build()}.
  • + *
+ *

+ * Method under test: + * {@link ServletRestApiConfiguration#instancesProxyController(InstanceRegistry, Builder)} + */ + @Test + public void testServletRestApiConfigurationInstancesProxyController_thenCallsBuild() { + // Arrange + ServletRestApiConfiguration servletRestApiConfiguration = new ServletRestApiConfiguration( + new AdminServerProperties()); + InstanceRegistry instanceRegistry = new InstanceRegistry( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + WebClient.Builder builder = mock(WebClient.Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder).build(); + Builder instanceWebClientBuilder = mock(Builder.class); + when(instanceWebClientBuilder.build()).thenReturn(buildResult); + + // Act + servletRestApiConfiguration.instancesProxyController(instanceRegistry, instanceWebClientBuilder); + + // Assert + verify(instanceWebClientBuilder).build(); + verify(builder).build(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/SpringBootAdminServerEnabledConditionDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/SpringBootAdminServerEnabledConditionDiffblueTest.java new file mode 100644 index 00000000000..06f91b09e04 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/SpringBootAdminServerEnabledConditionDiffblueTest.java @@ -0,0 +1,46 @@ +package de.codecentric.boot.admin.server.config; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import org.junit.Test; +import org.springframework.boot.autoconfigure.condition.ConditionOutcome; +import org.springframework.boot.web.reactive.context.StandardReactiveWebEnvironment; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.type.AnnotatedTypeMetadata; + +public class SpringBootAdminServerEnabledConditionDiffblueTest { + + /** + * Test + * {@link SpringBootAdminServerEnabledCondition#getMatchOutcome(ConditionContext, AnnotatedTypeMetadata)}. + *

    + *
  • Given + * {@link StandardReactiveWebEnvironment#StandardReactiveWebEnvironment()}.
  • + *
  • Then return Message is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link SpringBootAdminServerEnabledCondition#getMatchOutcome(ConditionContext, AnnotatedTypeMetadata)} + */ + @Test + public void testGetMatchOutcome_givenStandardReactiveWebEnvironment_thenReturnMessageIsNull() { + // Arrange + SpringBootAdminServerEnabledCondition springBootAdminServerEnabledCondition = new SpringBootAdminServerEnabledCondition(); + ConditionContext context = mock(ConditionContext.class); + when(context.getEnvironment()).thenReturn(new StandardReactiveWebEnvironment()); + + // Act + ConditionOutcome actualMatchOutcome = springBootAdminServerEnabledCondition.getMatchOutcome(context, + mock(AnnotatedTypeMetadata.class)); + + // Assert + verify(context).getEnvironment(); + assertNull(actualMatchOutcome.getMessage()); + assertTrue(actualMatchOutcome.getConditionMessage().isEmpty()); + assertTrue(actualMatchOutcome.isMatch()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/EventsourcingInstanceRepositoryDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/EventsourcingInstanceRepositoryDiffblueTest.java new file mode 100644 index 00000000000..7c51069cdc1 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/EventsourcingInstanceRepositoryDiffblueTest.java @@ -0,0 +1,270 @@ +package de.codecentric.boot.admin.server.domain.entities; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import java.util.function.BiFunction; +import org.junit.Test; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class EventsourcingInstanceRepositoryDiffblueTest { + + /** + * Test + * {@link EventsourcingInstanceRepository#EventsourcingInstanceRepository(InstanceEventStore)}. + *

+ * Method under test: + * {@link EventsourcingInstanceRepository#EventsourcingInstanceRepository(InstanceEventStore)} + */ + @Test + public void testNewEventsourcingInstanceRepository() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new EventsourcingInstanceRepository(new InMemoryEventStore()).findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#save(Instance)}. + *

    + *
  • Given + * {@link EventsourcingInstanceRepository#EventsourcingInstanceRepository(InstanceEventStore)} + * with eventStore is {@link InMemoryEventStore#InMemoryEventStore()}.
  • + *
+ *

+ * Method under test: {@link EventsourcingInstanceRepository#save(Instance)} + */ + @Test + public void testSave_givenEventsourcingInstanceRepositoryWithEventStoreIsInMemoryEventStore() + throws AssertionError { + // Arrange + EventsourcingInstanceRepository eventsourcingInstanceRepository = new EventsourcingInstanceRepository( + new InMemoryEventStore()); + String value = "42"; + InstanceId id = InstanceId.of(value); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(eventsourcingInstanceRepository.save(Instance.create(id))); + createResult.assertNext(i -> { + Instance instance = i; + assertNull(instance.getBuildVersion()); + assertSame(id, instance.getId()); + assertTrue(instance.getUnsavedEvents().isEmpty()); + assertEquals(-1L, instance.getVersion()); + assertFalse(instance.isRegistered()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#save(Instance)}. + *

    + *
  • Given + * {@link SnapshottingInstanceRepository#SnapshottingInstanceRepository(InstanceEventStore)} + * with eventStore is {@link InMemoryEventStore#InMemoryEventStore()}.
  • + *
+ *

+ * Method under test: {@link EventsourcingInstanceRepository#save(Instance)} + */ + @Test + public void testSave_givenSnapshottingInstanceRepositoryWithEventStoreIsInMemoryEventStore() throws AssertionError { + // Arrange + SnapshottingInstanceRepository snapshottingInstanceRepository = new SnapshottingInstanceRepository( + new InMemoryEventStore()); + String value = "42"; + InstanceId id = InstanceId.of(value); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.save(Instance.create(id))); + createResult.assertNext(i -> { + Instance instance = i; + assertNull(instance.getBuildVersion()); + assertSame(id, instance.getId()); + assertTrue(instance.getUnsavedEvents().isEmpty()); + assertEquals(-1L, instance.getVersion()); + assertFalse(instance.isRegistered()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#findAll()}. + *

+ * Method under test: {@link EventsourcingInstanceRepository#findAll()} + */ + @Test + public void testFindAll() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new EventsourcingInstanceRepository(new InMemoryEventStore()).findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#findAll()}. + *

+ * Method under test: {@link EventsourcingInstanceRepository#findAll()} + */ + @Test + public void testFindAll2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new SnapshottingInstanceRepository(new InMemoryEventStore()).findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#find(InstanceId)}. + *

    + *
  • Given + * {@link EventsourcingInstanceRepository#EventsourcingInstanceRepository(InstanceEventStore)} + * with eventStore is {@link InMemoryEventStore#InMemoryEventStore()}.
  • + *
+ *

+ * Method under test: {@link EventsourcingInstanceRepository#find(InstanceId)} + */ + @Test + public void testFind_givenEventsourcingInstanceRepositoryWithEventStoreIsInMemoryEventStore() + throws AssertionError { + // Arrange + EventsourcingInstanceRepository eventsourcingInstanceRepository = new EventsourcingInstanceRepository( + new InMemoryEventStore()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(eventsourcingInstanceRepository.find(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#find(InstanceId)}. + *

    + *
  • Given + * {@link SnapshottingInstanceRepository#SnapshottingInstanceRepository(InstanceEventStore)} + * with eventStore is {@link InMemoryEventStore#InMemoryEventStore()}.
  • + *
+ *

+ * Method under test: {@link EventsourcingInstanceRepository#find(InstanceId)} + */ + @Test + public void testFind_givenSnapshottingInstanceRepositoryWithEventStoreIsInMemoryEventStore() throws AssertionError { + // Arrange + SnapshottingInstanceRepository snapshottingInstanceRepository = new SnapshottingInstanceRepository( + new InMemoryEventStore()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.find(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#findByName(String)}. + *

+ * Method under test: {@link EventsourcingInstanceRepository#findByName(String)} + */ + @Test + public void testFindByName() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new EventsourcingInstanceRepository(new InMemoryEventStore()).findByName("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#findByName(String)}. + *

+ * Method under test: {@link EventsourcingInstanceRepository#findByName(String)} + */ + @Test + public void testFindByName2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new SnapshottingInstanceRepository(new InMemoryEventStore()).findByName("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#compute(InstanceId, BiFunction)}. + *

+ * Method under test: + * {@link EventsourcingInstanceRepository#compute(InstanceId, BiFunction)} + */ + @Test + public void testCompute() throws AssertionError { + // Arrange + EventsourcingInstanceRepository eventsourcingInstanceRepository = new EventsourcingInstanceRepository( + new InMemoryEventStore()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(eventsourcingInstanceRepository.compute(InstanceId.of("42"), mock(BiFunction.class))); + createResult.expectError().verify(); + } + + /** + * Test {@link EventsourcingInstanceRepository#compute(InstanceId, BiFunction)}. + *

+ * Method under test: + * {@link EventsourcingInstanceRepository#compute(InstanceId, BiFunction)} + */ + @Test + public void testCompute2() throws AssertionError { + // Arrange + SnapshottingInstanceRepository snapshottingInstanceRepository = new SnapshottingInstanceRepository( + new InMemoryEventStore()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.compute(InstanceId.of("42"), mock(BiFunction.class))); + createResult.expectError().verify(); + } + + /** + * Test + * {@link EventsourcingInstanceRepository#computeIfPresent(InstanceId, BiFunction)}. + *

+ * Method under test: + * {@link EventsourcingInstanceRepository#computeIfPresent(InstanceId, BiFunction)} + */ + @Test + public void testComputeIfPresent() throws AssertionError { + // Arrange + EventsourcingInstanceRepository eventsourcingInstanceRepository = new EventsourcingInstanceRepository( + new InMemoryEventStore()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(eventsourcingInstanceRepository.computeIfPresent(InstanceId.of("42"), mock(BiFunction.class))); + createResult.expectComplete().verify(); + } + + /** + * Test + * {@link EventsourcingInstanceRepository#computeIfPresent(InstanceId, BiFunction)}. + *

+ * Method under test: + * {@link EventsourcingInstanceRepository#computeIfPresent(InstanceId, BiFunction)} + */ + @Test + public void testComputeIfPresent2() throws AssertionError { + // Arrange + SnapshottingInstanceRepository snapshottingInstanceRepository = new SnapshottingInstanceRepository( + new InMemoryEventStore()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.computeIfPresent(InstanceId.of("42"), mock(BiFunction.class))); + createResult.expectComplete().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/InstanceDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/InstanceDiffblueTest.java new file mode 100644 index 00000000000..324a87f4b5e --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/InstanceDiffblueTest.java @@ -0,0 +1,418 @@ +package de.codecentric.boot.admin.server.domain.entities; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import de.codecentric.boot.admin.server.domain.values.Info; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import de.codecentric.boot.admin.server.domain.values.StatusInfo; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import org.junit.Test; + +public class InstanceDiffblueTest { + + /** + * Test {@link Instance#create(InstanceId)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
  • Then return StatusInfo Status is {@code UNKNOWN}.
  • + *
+ *

+ * Method under test: {@link Instance#create(InstanceId)} + */ + @Test + public void testCreate_whenInstanceIdWithValueIs42_thenReturnStatusInfoStatusIsUnknown() { + // Arrange + InstanceId id = InstanceId.of("42"); + + // Act + Instance actualCreateResult = Instance.create(id); + + // Assert + StatusInfo statusInfo = actualCreateResult.getStatusInfo(); + assertEquals("UNKNOWN", statusInfo.getStatus()); + assertNull(actualCreateResult.getBuildVersion()); + assertEquals(-1L, actualCreateResult.getVersion()); + Instant statusTimestamp = actualCreateResult.getStatusTimestamp(); + assertEquals(0, statusTimestamp.getNano()); + assertEquals(0L, statusTimestamp.getEpochSecond()); + assertFalse(actualCreateResult.isRegistered()); + assertFalse(statusInfo.isDown()); + assertFalse(statusInfo.isOffline()); + assertFalse(statusInfo.isUp()); + assertTrue(statusInfo.isUnknown()); + assertTrue(actualCreateResult.getUnsavedEvents().isEmpty()); + Map values = actualCreateResult.getInfo().getValues(); + assertTrue(values.isEmpty()); + assertTrue(statusInfo.getDetails().isEmpty()); + assertSame(values, actualCreateResult.getTags().getValues()); + assertSame(id, actualCreateResult.getId()); + } + + /** + * Test {@link Instance#deregister()}. + *

+ * Method under test: {@link Instance#deregister()} + */ + @Test + public void testDeregister() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + + // Act and Assert + assertSame(createResult, createResult.deregister()); + } + + /** + * Test {@link Instance#withInfo(Info)}. + *

+ * Method under test: {@link Instance#withInfo(Info)} + */ + @Test + public void testWithInfo() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + + // Act and Assert + assertSame(createResult, createResult.withInfo(Info.empty())); + } + + /** + * Test {@link Instance#withEndpoints(Endpoints)}. + *

    + *
  • Then return UnsavedEvents size is one.
  • + *
+ *

+ * Method under test: {@link Instance#withEndpoints(Endpoints)} + */ + @Test + public void testWithEndpoints_thenReturnUnsavedEventsSizeIsOne() { + // Arrange + InstanceId id = InstanceId.of("42"); + Instance createResult = Instance.create(id); + Endpoints endpoints = Endpoints.single("42", "https://example.org/example"); + + // Act + Instance actualWithEndpointsResult = createResult.withEndpoints(endpoints); + + // Assert + List unsavedEvents = actualWithEndpointsResult.getUnsavedEvents(); + assertEquals(1, unsavedEvents.size()); + InstanceEvent getResult = unsavedEvents.get(0); + assertTrue(getResult instanceof InstanceEndpointsDetectedEvent); + assertEquals("ENDPOINTS_DETECTED", getResult.getType()); + assertEquals(0L, actualWithEndpointsResult.getVersion()); + assertEquals(0L, getResult.getVersion()); + assertSame(endpoints, actualWithEndpointsResult.getEndpoints()); + assertSame(endpoints, ((InstanceEndpointsDetectedEvent) getResult).getEndpoints()); + assertSame(id, getResult.getInstance()); + } + + /** + * Test {@link Instance#withEndpoints(Endpoints)}. + *

    + *
  • When empty.
  • + *
  • Then return create {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link Instance#withEndpoints(Endpoints)} + */ + @Test + public void testWithEndpoints_whenEmpty_thenReturnCreateInstanceIdWithValueIs42() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + + // Act and Assert + assertSame(createResult, createResult.withEndpoints(Endpoints.empty())); + } + + /** + * Test {@link Instance#isRegistered()}. + *

+ * Method under test: {@link Instance#isRegistered()} + */ + @Test + public void testIsRegistered() { + // Arrange, Act and Assert + assertFalse(Instance.create(InstanceId.of("42")).isRegistered()); + } + + /** + * Test {@link Instance#getRegistration()}. + *

+ * Method under test: {@link Instance#getRegistration()} + */ + @Test + public void testGetRegistration() { + // Arrange, Act and Assert + assertThrows(IllegalStateException.class, () -> Instance.create(InstanceId.of("42")).getRegistration()); + } + + /** + * Test {@link Instance#getUnsavedEvents()}. + *

+ * Method under test: {@link Instance#getUnsavedEvents()} + */ + @Test + public void testGetUnsavedEvents() { + // Arrange, Act and Assert + assertTrue(Instance.create(InstanceId.of("42")).getUnsavedEvents().isEmpty()); + } + + /** + * Test {@link Instance#clearUnsavedEvents()}. + *

+ * Method under test: {@link Instance#clearUnsavedEvents()} + */ + @Test + public void testClearUnsavedEvents() { + // Arrange + InstanceId id = InstanceId.of("42"); + + // Act + Instance actualClearUnsavedEventsResult = Instance.create(id).clearUnsavedEvents(); + + // Assert + StatusInfo statusInfo = actualClearUnsavedEventsResult.getStatusInfo(); + assertEquals("UNKNOWN", statusInfo.getStatus()); + assertNull(actualClearUnsavedEventsResult.getBuildVersion()); + assertEquals(-1L, actualClearUnsavedEventsResult.getVersion()); + Instant statusTimestamp = actualClearUnsavedEventsResult.getStatusTimestamp(); + assertEquals(0, statusTimestamp.getNano()); + assertEquals(0L, statusTimestamp.getEpochSecond()); + assertFalse(actualClearUnsavedEventsResult.isRegistered()); + assertFalse(statusInfo.isDown()); + assertFalse(statusInfo.isOffline()); + assertFalse(statusInfo.isUp()); + assertTrue(statusInfo.isUnknown()); + assertTrue(actualClearUnsavedEventsResult.getUnsavedEvents().isEmpty()); + Map values = actualClearUnsavedEventsResult.getInfo().getValues(); + assertTrue(values.isEmpty()); + assertTrue(statusInfo.getDetails().isEmpty()); + assertSame(values, actualClearUnsavedEventsResult.getTags().getValues()); + assertSame(id, actualClearUnsavedEventsResult.getId()); + } + + /** + * Test {@link Instance#apply(InstanceEvent)} with {@code event}. + *

+ * Method under test: {@link Instance#apply(InstanceEvent)} + */ + @Test + public void testApplyWithEvent() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + InstanceId instance = InstanceId.of("42"); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + Registration registration2 = createResult + .apply(new InstanceRegistrationUpdatedEvent(instance, 1L, registration)) + .getRegistration(); + assertEquals("Name", registration2.getName()); + assertEquals("Source", registration2.getSource()); + assertEquals("https://example.org/example", registration2.getHealthUrl()); + assertEquals("https://example.org/example", registration2.getManagementUrl()); + assertEquals("https://example.org/example", registration2.getServiceUrl()); + assertTrue(registration2.getMetadata().isEmpty()); + } + + /** + * Test {@link Instance#apply(InstanceEvent)} with {@code event}. + *

    + *
  • Then return Endpoints is empty.
  • + *
+ *

+ * Method under test: {@link Instance#apply(InstanceEvent)} + */ + @Test + public void testApplyWithEvent_thenReturnEndpointsIsEmpty() { + // Arrange + InstanceId id = InstanceId.of("42"); + Instance createResult = Instance.create(id); + InstanceId instance = InstanceId.of("42"); + Endpoints endpoints = Endpoints.empty(); + + // Act + Instance actualApplyResult = createResult.apply(new InstanceEndpointsDetectedEvent(instance, 1L, endpoints)); + + // Assert + assertNull(actualApplyResult.getBuildVersion()); + assertEquals(1L, actualApplyResult.getVersion()); + assertFalse(actualApplyResult.isRegistered()); + assertTrue(actualApplyResult.getUnsavedEvents().isEmpty()); + assertSame(endpoints, actualApplyResult.getEndpoints()); + assertSame(id, actualApplyResult.getId()); + } + + /** + * Test {@link Instance#apply(InstanceEvent)} with {@code event}. + *

    + *
  • Then return Id Value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link Instance#apply(InstanceEvent)} + */ + @Test + public void testApplyWithEvent_thenReturnIdValueIs42() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + + // Act + Instance actualApplyResult = createResult.apply(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + InstanceId id = actualApplyResult.getId(); + assertEquals("42", id.getValue()); + assertEquals("42", id.toString()); + StatusInfo statusInfo = actualApplyResult.getStatusInfo(); + assertEquals("UNKNOWN", statusInfo.getStatus()); + assertFalse(statusInfo.isDown()); + assertFalse(statusInfo.isOffline()); + assertFalse(statusInfo.isUp()); + assertTrue(statusInfo.isUnknown()); + Map values = actualApplyResult.getInfo().getValues(); + assertTrue(values.isEmpty()); + assertTrue(statusInfo.getDetails().isEmpty()); + assertSame(values, actualApplyResult.getTags().getValues()); + } + + /** + * Test {@link Instance#apply(InstanceEvent)} with {@code event}. + *

    + *
  • Then return Info is empty.
  • + *
+ *

+ * Method under test: {@link Instance#apply(InstanceEvent)} + */ + @Test + public void testApplyWithEvent_thenReturnInfoIsEmpty() { + // Arrange + InstanceId id = InstanceId.of("42"); + Instance createResult = Instance.create(id); + InstanceId instance = InstanceId.of("42"); + Info info = Info.empty(); + + // Act + Instance actualApplyResult = createResult.apply(new InstanceInfoChangedEvent(instance, 1L, info)); + + // Assert + assertNull(actualApplyResult.getBuildVersion()); + assertEquals(1L, actualApplyResult.getVersion()); + assertFalse(actualApplyResult.isRegistered()); + assertTrue(actualApplyResult.getUnsavedEvents().isEmpty()); + assertSame(info, actualApplyResult.getInfo()); + assertSame(id, actualApplyResult.getId()); + } + + /** + * Test {@link Instance#apply(InstanceEvent)} with {@code event}. + *

    + *
  • Then return Registered.
  • + *
+ *

+ * Method under test: {@link Instance#apply(InstanceEvent)} + */ + @Test + public void testApplyWithEvent_thenReturnRegistered() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + InstanceId instance = InstanceId.of("42"); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act + Instance actualApplyResult = createResult.apply(new InstanceRegisteredEvent(instance, 1L, registration)); + + // Assert + Registration registration2 = actualApplyResult.getRegistration(); + assertEquals("Name", registration2.getName()); + assertEquals("Source", registration2.getSource()); + assertEquals("https://example.org/example", registration2.getHealthUrl()); + assertEquals("https://example.org/example", registration2.getManagementUrl()); + assertEquals("https://example.org/example", registration2.getServiceUrl()); + assertTrue(actualApplyResult.isRegistered()); + assertTrue(registration2.getMetadata().isEmpty()); + } + + /** + * Test {@link Instance#apply(Collection)} with {@code events}. + *

    + *
  • Then return Id Value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link Instance#apply(Collection)} + */ + @Test + public void testApplyWithEvents_thenReturnIdValueIs42() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + + ArrayList events = new ArrayList<>(); + events.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Act + Instance actualApplyResult = createResult.apply(events); + + // Assert + InstanceId id = actualApplyResult.getId(); + assertEquals("42", id.getValue()); + assertEquals("42", id.toString()); + StatusInfo statusInfo = actualApplyResult.getStatusInfo(); + assertEquals("UNKNOWN", statusInfo.getStatus()); + assertEquals(1L, actualApplyResult.getVersion()); + assertFalse(statusInfo.isDown()); + assertFalse(statusInfo.isOffline()); + assertFalse(statusInfo.isUp()); + assertTrue(statusInfo.isUnknown()); + Map values = actualApplyResult.getInfo().getValues(); + assertTrue(values.isEmpty()); + assertTrue(statusInfo.getDetails().isEmpty()); + assertSame(values, actualApplyResult.getTags().getValues()); + } + + /** + * Test {@link Instance#apply(Collection)} with {@code events}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
  • Then return create {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link Instance#apply(Collection)} + */ + @Test + public void testApplyWithEvents_whenArrayList_thenReturnCreateInstanceIdWithValueIs42() { + // Arrange + Instance createResult = Instance.create(InstanceId.of("42")); + + // Act and Assert + assertSame(createResult, createResult.apply(new ArrayList<>())); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/SnapshottingInstanceRepositoryDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/SnapshottingInstanceRepositoryDiffblueTest.java new file mode 100644 index 00000000000..9efa00ee1fa --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/SnapshottingInstanceRepositoryDiffblueTest.java @@ -0,0 +1,761 @@ +package de.codecentric.boot.admin.server.domain.entities; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceInfoChangedEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceRegistrationUpdatedEvent; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import de.codecentric.boot.admin.server.domain.values.Info; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import de.codecentric.boot.admin.server.domain.values.StatusInfo; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import de.codecentric.boot.admin.server.eventstore.OptimisticLockingException; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.Disposable; +import reactor.core.publisher.EmitterProcessor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { SnapshottingInstanceRepository.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class SnapshottingInstanceRepositoryDiffblueTest { + + @MockitoBean + private InstanceEventStore instanceEventStore; + + @Autowired + private SnapshottingInstanceRepository snapshottingInstanceRepository; + + /** + * Test + * {@link SnapshottingInstanceRepository#SnapshottingInstanceRepository(InstanceEventStore)}. + *

+ * Method under test: + * {@link SnapshottingInstanceRepository#SnapshottingInstanceRepository(InstanceEventStore)} + */ + @Test + public void testNewSnapshottingInstanceRepository() throws AssertionError { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new SnapshottingInstanceRepository(new InMemoryEventStore()).findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link SnapshottingInstanceRepository#findAll()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#findAll()} + */ + @Test + public void testFindAll() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(snapshottingInstanceRepository.findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link SnapshottingInstanceRepository#find(InstanceId)}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#find(InstanceId)} + */ + @Test + public void testFind() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.find(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link SnapshottingInstanceRepository#save(Instance)}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#save(Instance)} + */ + @Test + public void testSave() throws AssertionError { + // Arrange + Flux source = Flux.fromIterable(new ArrayList<>()); + when(instanceEventStore.append(Mockito.>any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.save(Instance.create(InstanceId.of("42")))); + createResult.expectError().verify(); + verify(instanceEventStore).append(isA(List.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#save(Instance)}. + *

    + *
  • Given + * {@link SnapshottingInstanceRepository#SnapshottingInstanceRepository(InstanceEventStore)} + * with eventStore is {@link InMemoryEventStore#InMemoryEventStore()}.
  • + *
+ *

+ * Method under test: {@link SnapshottingInstanceRepository#save(Instance)} + */ + @Test + public void testSave_givenSnapshottingInstanceRepositoryWithEventStoreIsInMemoryEventStore() throws AssertionError { + // Arrange + SnapshottingInstanceRepository snapshottingInstanceRepository = new SnapshottingInstanceRepository( + new InMemoryEventStore()); + String value = "42"; + InstanceId id = InstanceId.of(value); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.save(Instance.create(id))); + createResult.assertNext(i -> { + Instance instance = i; + assertNull(instance.getBuildVersion()); + assertSame(id, instance.getId()); + assertTrue(instance.getUnsavedEvents().isEmpty()); + assertEquals(-1L, instance.getVersion()); + assertFalse(instance.isRegistered()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart() { + // Arrange + doThrow(new OptimisticLockingException("An error occurred")).when(instanceEventStore) + .subscribe(Mockito.>any()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceEventStore.findAll()).thenReturn(fromIterableResult); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceEventStore).findAll(); + verify(instanceEventStore).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart2() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + doNothing().when(instanceEventStore).subscribe(Mockito.>any()); + when(instanceEventStore.findAll()).thenReturn(fromIterableResult); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceEventStore).findAll(); + verify(instanceEventStore).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart3() { + // Arrange + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 59L)); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + doNothing().when(instanceEventStore).subscribe(Mockito.>any()); + when(instanceEventStore.findAll()).thenReturn(fromIterableResult); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceEventStore).findAll(); + verify(instanceEventStore).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart4() { + // Arrange + ArrayList it = new ArrayList<>(); + InstanceId instance = InstanceId.of("42"); + it.add(new InstanceEndpointsDetectedEvent(instance, 1L, Endpoints.empty())); + Flux fromIterableResult = Flux.fromIterable(it); + Flux flux = mock(Flux.class); + when(flux.concatWith(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act + new SnapshottingInstanceRepository(eventStore).start(); + + // Assert + verify(eventStore).findAll(); + verify(flux).concatWith(isA(Publisher.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart5() { + // Arrange + ArrayList it = new ArrayList<>(); + InstanceId instance = InstanceId.of("42"); + it.add(new InstanceInfoChangedEvent(instance, 1L, Info.empty())); + Flux fromIterableResult = Flux.fromIterable(it); + Flux flux = mock(Flux.class); + when(flux.concatWith(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act + new SnapshottingInstanceRepository(eventStore).start(); + + // Assert + verify(eventStore).findAll(); + verify(flux).concatWith(isA(Publisher.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart6() { + // Arrange + InstanceDeregisteredEvent instanceDeregisteredEvent = mock(InstanceDeregisteredEvent.class); + when(instanceDeregisteredEvent.getVersion()).thenThrow(new OptimisticLockingException("An error occurred")); + when(instanceDeregisteredEvent.getInstance()).thenReturn(InstanceId.of("42")); + + ArrayList it = new ArrayList<>(); + InstanceId instance = InstanceId.of("42"); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + it.add(new InstanceRegisteredEvent(instance, 1L, registration)); + it.add(instanceDeregisteredEvent); + Flux fromIterableResult = Flux.fromIterable(it); + Flux flux = mock(Flux.class); + when(flux.concatWith(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act + new SnapshottingInstanceRepository(eventStore).start(); + + // Assert + verify(instanceDeregisteredEvent).getInstance(); + verify(instanceDeregisteredEvent).getVersion(); + verify(eventStore).findAll(); + verify(flux).concatWith(isA(Publisher.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart7() { + // Arrange + InstanceDeregisteredEvent instanceDeregisteredEvent = mock(InstanceDeregisteredEvent.class); + when(instanceDeregisteredEvent.getVersion()).thenThrow(new OptimisticLockingException("An error occurred")); + when(instanceDeregisteredEvent.getInstance()).thenReturn(InstanceId.of("42")); + + ArrayList it = new ArrayList<>(); + InstanceId instance = InstanceId.of("42"); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + it.add(new InstanceRegistrationUpdatedEvent(instance, 1L, registration)); + it.add(instanceDeregisteredEvent); + Flux fromIterableResult = Flux.fromIterable(it); + Flux flux = mock(Flux.class); + when(flux.concatWith(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act + new SnapshottingInstanceRepository(eventStore).start(); + + // Assert + verify(instanceDeregisteredEvent).getInstance(); + verify(instanceDeregisteredEvent).getVersion(); + verify(eventStore).findAll(); + verify(flux).concatWith(isA(Publisher.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

    + *
  • Given {@link Flux} {@link Flux#subscribe(Consumer)} return + * {@link Disposable}.
  • + *
  • Then calls {@link Flux#subscribe(Consumer)}.
  • + *
+ *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart_givenFluxSubscribeReturnDisposable_thenCallsSubscribe() { + // Arrange + Flux flux = mock(Flux.class); + when(flux.subscribe(Mockito.>any())).thenReturn(mock(Disposable.class)); + Flux flux2 = mock(Flux.class); + when(flux2.concatWith(Mockito.>any())).thenReturn(flux); + when(instanceEventStore.findAll()).thenReturn(flux2); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceEventStore).findAll(); + verify(flux2).concatWith(isA(Publisher.class)); + verify(flux).subscribe(isA(Consumer.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

    + *
  • Given {@link InstanceDeregisteredEvent} {@link InstanceEvent#getInstance()} + * return {@code null}.
  • + *
+ *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart_givenInstanceDeregisteredEventGetInstanceReturnNull() { + // Arrange + InstanceDeregisteredEvent instanceDeregisteredEvent = mock(InstanceDeregisteredEvent.class); + when(instanceDeregisteredEvent.getInstance()).thenReturn(null); + + ArrayList it = new ArrayList<>(); + it.add(instanceDeregisteredEvent); + Flux fromIterableResult = Flux.fromIterable(it); + Flux flux = mock(Flux.class); + when(flux.concatWith(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceEventStore.findAll()).thenReturn(flux); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceDeregisteredEvent).getInstance(); + verify(instanceEventStore).findAll(); + verify(flux).concatWith(isA(Publisher.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

    + *
  • Given {@link InstanceEventStore} {@link InstanceEventStore#findAll()} return + * create three and {@code true}.
  • + *
+ *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart_givenInstanceEventStoreFindAllReturnCreateThreeAndTrue() { + // Arrange + EmitterProcessor createResult = EmitterProcessor.create(3, true); + when(instanceEventStore.findAll()).thenReturn(createResult); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceEventStore).findAll(); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

    + *
  • Given {@link InstanceEventStore} {@link InstanceEventStore#findAll()} return + * {@link Flux}.
  • + *
  • Then calls {@link Flux#concatWith(Publisher)}.
  • + *
+ *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart_givenInstanceEventStoreFindAllReturnFlux_thenCallsConcatWith() { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.concatWith(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceEventStore.findAll()).thenReturn(flux); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceEventStore).findAll(); + verify(flux).concatWith(isA(Publisher.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

    + *
  • Then calls {@link InstanceEvent#getVersion()}.
  • + *
+ *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart_thenCallsGetVersion() { + // Arrange + InstanceDeregisteredEvent instanceDeregisteredEvent = mock(InstanceDeregisteredEvent.class); + when(instanceDeregisteredEvent.getVersion()).thenThrow(new OptimisticLockingException("An error occurred")); + when(instanceDeregisteredEvent.getInstance()).thenReturn(InstanceId.of("42")); + + ArrayList it = new ArrayList<>(); + it.add(instanceDeregisteredEvent); + Flux fromIterableResult = Flux.fromIterable(it); + Flux flux = mock(Flux.class); + when(flux.concatWith(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceEventStore.findAll()).thenReturn(flux); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceDeregisteredEvent).getInstance(); + verify(instanceDeregisteredEvent).getVersion(); + verify(instanceEventStore).findAll(); + verify(flux).concatWith(isA(Publisher.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#start()}. + *

    + *
  • Then calls {@link Publisher#subscribe(Subscriber)}.
  • + *
+ *

+ * Method under test: {@link SnapshottingInstanceRepository#start()} + */ + @Test + public void testStart_thenCallsSubscribe() { + // Arrange + doNothing().when(instanceEventStore).subscribe(Mockito.>any()); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceEventStore.findAll()).thenReturn(fromIterableResult); + + // Act + snapshottingInstanceRepository.start(); + + // Assert + verify(instanceEventStore).findAll(); + verify(instanceEventStore).subscribe(isA(Subscriber.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)}. + *

+ * Method under test: + * {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)} + */ + @Test + public void testRehydrateSnapshot() throws AssertionError { + // Arrange + SnapshottingInstanceRepository snapshottingInstanceRepository = new SnapshottingInstanceRepository( + new InMemoryEventStore()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.rehydrateSnapshot(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)} + */ + @Test + public void testRehydrateSnapshot_givenFluxCollectListReturnJustArrayList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + when(instanceEventStore.find(Mockito.any())).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.rehydrateSnapshot(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(instanceEventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + } + + /** + * Test {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)}. + *

    + *
  • Given {@link InstanceEventStore} {@link InstanceEventStore#find(InstanceId)} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: + * {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)} + */ + @Test + public void testRehydrateSnapshot_givenInstanceEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceEventStore.find(Mockito.any())).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.rehydrateSnapshot(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(instanceEventStore).find(isA(InstanceId.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: + * {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)} + */ + @Test + public void testRehydrateSnapshot_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + when(instanceEventStore.find(Mockito.any())).thenReturn(flux); + String value = "42"; + InstanceId id = InstanceId.of(value); + + // Act and Assert + FirstStep createResult = StepVerifier.create(snapshottingInstanceRepository.rehydrateSnapshot(id)); + createResult.assertNext(i -> { + Instance instance = i; + assertNull(instance.getBuildVersion()); + assertSame(id, instance.getId()); + Map values = instance.getInfo().getValues(); + assertTrue(values.isEmpty()); + StatusInfo statusInfo = instance.getStatusInfo(); + assertTrue(statusInfo.getDetails().isEmpty()); + assertEquals("UNKNOWN", statusInfo.getStatus()); + assertFalse(statusInfo.isDown()); + assertFalse(statusInfo.isOffline()); + assertTrue(statusInfo.isUnknown()); + assertFalse(statusInfo.isUp()); + Instant statusTimestamp = instance.getStatusTimestamp(); + assertEquals(0L, statusTimestamp.getEpochSecond()); + assertEquals(0, statusTimestamp.getNano()); + assertSame(values, instance.getTags().getValues()); + assertTrue(instance.getUnsavedEvents().isEmpty()); + assertEquals(-1L, instance.getVersion()); + assertFalse(instance.isRegistered()); + return; + }).expectComplete().verify(); + verify(instanceEventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#map(Function)}.
  • + *
+ *

+ * Method under test: + * {@link SnapshottingInstanceRepository#rehydrateSnapshot(InstanceId)} + */ + @Test + public void testRehydrateSnapshot_givenMonoMapReturnJustData_thenCallsMap() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + when(instanceEventStore.find(Mockito.any())).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(snapshottingInstanceRepository.rehydrateSnapshot(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(instanceEventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link SnapshottingInstanceRepository#updateSnapshot(InstanceEvent)}. + *
    + *
  • Given {@code null}.
  • + *
  • When {@link InstanceRegisteredEvent} {@link InstanceEvent#getInstance()} return + * {@code null}.
  • + *
+ *

+ * Method under test: + * {@link SnapshottingInstanceRepository#updateSnapshot(InstanceEvent)} + */ + @Test + public void testUpdateSnapshot_givenNull_whenInstanceRegisteredEventGetInstanceReturnNull() { + // Arrange + InstanceRegisteredEvent event = mock(InstanceRegisteredEvent.class); + when(event.getInstance()).thenReturn(null); + + // Act + snapshottingInstanceRepository.updateSnapshot(event); + + // Assert + verify(event).getInstance(); + } + + /** + * Test {@link SnapshottingInstanceRepository#updateSnapshot(InstanceEvent)}. + *

    + *
  • Given {@link OptimisticLockingException#OptimisticLockingException(String)} + * with message is {@code An error occurred}.
  • + *
+ *

+ * Method under test: + * {@link SnapshottingInstanceRepository#updateSnapshot(InstanceEvent)} + */ + @Test + public void testUpdateSnapshot_givenOptimisticLockingExceptionWithMessageIsAnErrorOccurred() { + // Arrange + InstanceRegisteredEvent event = mock(InstanceRegisteredEvent.class); + when(event.getVersion()).thenThrow(new OptimisticLockingException("An error occurred")); + when(event.getInstance()).thenReturn(InstanceId.of("42")); + + // Act + snapshottingInstanceRepository.updateSnapshot(event); + + // Assert + verify(event).getInstance(); + verify(event).getVersion(); + } + + /** + * Test {@link SnapshottingInstanceRepository#updateSnapshot(InstanceEvent)}. + *

    + *
  • Then calls {@link InstanceEvent#getTimestamp()}.
  • + *
+ *

+ * Method under test: + * {@link SnapshottingInstanceRepository#updateSnapshot(InstanceEvent)} + */ + @Test + public void testUpdateSnapshot_thenCallsGetTimestamp() { + // Arrange + SnapshottingInstanceRepository snapshottingInstanceRepository = new SnapshottingInstanceRepository( + new InMemoryEventStore()); + InstanceRegisteredEvent event = mock(InstanceRegisteredEvent.class); + Registration buildResult = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + when(event.getRegistration()).thenReturn(buildResult); + when(event.getTimestamp()) + .thenReturn(LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()); + when(event.getVersion()).thenReturn(1L); + when(event.getInstance()).thenReturn(InstanceId.of("42")); + + // Act + snapshottingInstanceRepository.updateSnapshot(event); + + // Assert + verify(event, atLeast(1)).getInstance(); + verify(event).getTimestamp(); + verify(event, atLeast(1)).getVersion(); + verify(event).getRegistration(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceDeregisteredEventDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceDeregisteredEventDiffblueTest.java new file mode 100644 index 00000000000..e351d04ebef --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceDeregisteredEventDiffblueTest.java @@ -0,0 +1,64 @@ +package de.codecentric.boot.admin.server.domain.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class InstanceDeregisteredEventDiffblueTest { + + /** + * Test {@link InstanceDeregisteredEvent#InstanceDeregisteredEvent(InstanceId, long)}. + *

    + *
  • Then return Version is one.
  • + *
+ *

+ * Method under test: + * {@link InstanceDeregisteredEvent#InstanceDeregisteredEvent(InstanceId, long)} + */ + @Test + public void testNewInstanceDeregisteredEvent_thenReturnVersionIsOne() { + // Arrange + InstanceId instance = InstanceId.of("42"); + + // Act + InstanceDeregisteredEvent actualInstanceDeregisteredEvent = new InstanceDeregisteredEvent(instance, 1L); + + // Assert + assertEquals(1L, actualInstanceDeregisteredEvent.getVersion()); + assertEquals(InstanceDeregisteredEvent.TYPE, actualInstanceDeregisteredEvent.getType()); + assertSame(instance, actualInstanceDeregisteredEvent.getInstance()); + } + + /** + * Test + * {@link InstanceDeregisteredEvent#InstanceDeregisteredEvent(InstanceId, long, Instant)}. + *

    + *
  • Then return Version is one.
  • + *
+ *

+ * Method under test: + * {@link InstanceDeregisteredEvent#InstanceDeregisteredEvent(InstanceId, long, Instant)} + */ + @Test + public void testNewInstanceDeregisteredEvent_thenReturnVersionIsOne2() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Instant timestamp = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + InstanceDeregisteredEvent actualInstanceDeregisteredEvent = new InstanceDeregisteredEvent(instance, 1L, + timestamp); + + // Assert + assertEquals(1L, actualInstanceDeregisteredEvent.getVersion()); + assertEquals(InstanceDeregisteredEvent.TYPE, actualInstanceDeregisteredEvent.getType()); + assertSame(instance, actualInstanceDeregisteredEvent.getInstance()); + Instant expectedTimestamp = timestamp.EPOCH; + assertSame(expectedTimestamp, actualInstanceDeregisteredEvent.getTimestamp()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceEndpointsDetectedEventDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceEndpointsDetectedEventDiffblueTest.java new file mode 100644 index 00000000000..b73b4e2a6bb --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceEndpointsDetectedEventDiffblueTest.java @@ -0,0 +1,71 @@ +package de.codecentric.boot.admin.server.domain.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class InstanceEndpointsDetectedEventDiffblueTest { + + /** + * Test + * {@link InstanceEndpointsDetectedEvent#InstanceEndpointsDetectedEvent(InstanceId, long, Endpoints)}. + *

    + *
  • Then return Version is one.
  • + *
+ *

+ * Method under test: + * {@link InstanceEndpointsDetectedEvent#InstanceEndpointsDetectedEvent(InstanceId, long, Endpoints)} + */ + @Test + public void testNewInstanceEndpointsDetectedEvent_thenReturnVersionIsOne() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Endpoints endpoints = Endpoints.empty(); + + // Act + InstanceEndpointsDetectedEvent actualInstanceEndpointsDetectedEvent = new InstanceEndpointsDetectedEvent( + instance, 1L, endpoints); + + // Assert + assertEquals(1L, actualInstanceEndpointsDetectedEvent.getVersion()); + assertEquals(InstanceEndpointsDetectedEvent.TYPE, actualInstanceEndpointsDetectedEvent.getType()); + assertSame(endpoints, actualInstanceEndpointsDetectedEvent.getEndpoints()); + assertSame(instance, actualInstanceEndpointsDetectedEvent.getInstance()); + } + + /** + * Test + * {@link InstanceEndpointsDetectedEvent#InstanceEndpointsDetectedEvent(InstanceId, long, Instant, Endpoints)}. + *

    + *
  • Then return Version is one.
  • + *
+ *

+ * Method under test: + * {@link InstanceEndpointsDetectedEvent#InstanceEndpointsDetectedEvent(InstanceId, long, Instant, Endpoints)} + */ + @Test + public void testNewInstanceEndpointsDetectedEvent_thenReturnVersionIsOne2() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Instant timestamp = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + Endpoints endpoints = Endpoints.empty(); + + // Act + InstanceEndpointsDetectedEvent actualInstanceEndpointsDetectedEvent = new InstanceEndpointsDetectedEvent( + instance, 1L, timestamp, endpoints); + + // Assert + assertEquals(1L, actualInstanceEndpointsDetectedEvent.getVersion()); + assertEquals(InstanceEndpointsDetectedEvent.TYPE, actualInstanceEndpointsDetectedEvent.getType()); + assertSame(endpoints, actualInstanceEndpointsDetectedEvent.getEndpoints()); + assertSame(instance, actualInstanceEndpointsDetectedEvent.getInstance()); + Instant expectedTimestamp = timestamp.EPOCH; + assertSame(expectedTimestamp, actualInstanceEndpointsDetectedEvent.getTimestamp()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceInfoChangedEventDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceInfoChangedEventDiffblueTest.java new file mode 100644 index 00000000000..8a5f97138e4 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceInfoChangedEventDiffblueTest.java @@ -0,0 +1,75 @@ +package de.codecentric.boot.admin.server.domain.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import de.codecentric.boot.admin.server.domain.values.Info; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class InstanceInfoChangedEventDiffblueTest { + + /** + * Test + * {@link InstanceInfoChangedEvent#InstanceInfoChangedEvent(InstanceId, long, Info)}. + *

    + *
  • Then return Version is one.
  • + *
+ *

+ * Method under test: + * {@link InstanceInfoChangedEvent#InstanceInfoChangedEvent(InstanceId, long, Info)} + */ + @Test + public void testNewInstanceInfoChangedEvent_thenReturnVersionIsOne() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Info info = Info.empty(); + + // Act + InstanceInfoChangedEvent actualInstanceInfoChangedEvent = new InstanceInfoChangedEvent(instance, 1L, info); + + // Assert + assertEquals(1L, actualInstanceInfoChangedEvent.getVersion()); + Info info2 = actualInstanceInfoChangedEvent.getInfo(); + assertTrue(info2.getValues().isEmpty()); + assertEquals(InstanceInfoChangedEvent.TYPE, actualInstanceInfoChangedEvent.getType()); + assertSame(info, info2); + assertSame(instance, actualInstanceInfoChangedEvent.getInstance()); + } + + /** + * Test + * {@link InstanceInfoChangedEvent#InstanceInfoChangedEvent(InstanceId, long, Instant, Info)}. + *

    + *
  • Then return Version is one.
  • + *
+ *

+ * Method under test: + * {@link InstanceInfoChangedEvent#InstanceInfoChangedEvent(InstanceId, long, Instant, Info)} + */ + @Test + public void testNewInstanceInfoChangedEvent_thenReturnVersionIsOne2() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Instant timestamp = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + Info info = Info.empty(); + + // Act + InstanceInfoChangedEvent actualInstanceInfoChangedEvent = new InstanceInfoChangedEvent(instance, 1L, timestamp, + info); + + // Assert + assertEquals(1L, actualInstanceInfoChangedEvent.getVersion()); + Info info2 = actualInstanceInfoChangedEvent.getInfo(); + assertTrue(info2.getValues().isEmpty()); + assertEquals(InstanceInfoChangedEvent.TYPE, actualInstanceInfoChangedEvent.getType()); + assertSame(info, info2); + assertSame(instance, actualInstanceInfoChangedEvent.getInstance()); + Instant expectedTimestamp = timestamp.EPOCH; + assertSame(expectedTimestamp, actualInstanceInfoChangedEvent.getTimestamp()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceRegisteredEventDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceRegisteredEventDiffblueTest.java new file mode 100644 index 00000000000..dfb58ba3991 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceRegisteredEventDiffblueTest.java @@ -0,0 +1,69 @@ +package de.codecentric.boot.admin.server.domain.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class InstanceRegisteredEventDiffblueTest { + + /** + * Test + * {@link InstanceRegisteredEvent#InstanceRegisteredEvent(InstanceId, long, Registration)}. + *

    + *
  • Then return Registration is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceRegisteredEvent#InstanceRegisteredEvent(InstanceId, long, Registration)} + */ + @Test + public void testNewInstanceRegisteredEvent_thenReturnRegistrationIsNull() { + // Arrange + InstanceId instance = InstanceId.of("42"); + + // Act + InstanceRegisteredEvent actualInstanceRegisteredEvent = new InstanceRegisteredEvent(instance, 1L, null); + + // Assert + assertNull(actualInstanceRegisteredEvent.getRegistration()); + assertEquals(1L, actualInstanceRegisteredEvent.getVersion()); + assertEquals(InstanceRegisteredEvent.TYPE, actualInstanceRegisteredEvent.getType()); + assertSame(instance, actualInstanceRegisteredEvent.getInstance()); + } + + /** + * Test + * {@link InstanceRegisteredEvent#InstanceRegisteredEvent(InstanceId, long, Instant, Registration)}. + *

    + *
  • Then return Registration is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceRegisteredEvent#InstanceRegisteredEvent(InstanceId, long, Instant, Registration)} + */ + @Test + public void testNewInstanceRegisteredEvent_thenReturnRegistrationIsNull2() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Instant timestamp = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + InstanceRegisteredEvent actualInstanceRegisteredEvent = new InstanceRegisteredEvent(instance, 1L, timestamp, + null); + + // Assert + assertNull(actualInstanceRegisteredEvent.getRegistration()); + assertEquals(1L, actualInstanceRegisteredEvent.getVersion()); + assertEquals(InstanceRegisteredEvent.TYPE, actualInstanceRegisteredEvent.getType()); + assertSame(instance, actualInstanceRegisteredEvent.getInstance()); + Instant expectedTimestamp = timestamp.EPOCH; + assertSame(expectedTimestamp, actualInstanceRegisteredEvent.getTimestamp()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceRegistrationUpdatedEventDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceRegistrationUpdatedEventDiffblueTest.java new file mode 100644 index 00000000000..f961192f251 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceRegistrationUpdatedEventDiffblueTest.java @@ -0,0 +1,70 @@ +package de.codecentric.boot.admin.server.domain.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class InstanceRegistrationUpdatedEventDiffblueTest { + + /** + * Test + * {@link InstanceRegistrationUpdatedEvent#InstanceRegistrationUpdatedEvent(InstanceId, long, Registration)}. + *

    + *
  • Then return Registration is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceRegistrationUpdatedEvent#InstanceRegistrationUpdatedEvent(InstanceId, long, Registration)} + */ + @Test + public void testNewInstanceRegistrationUpdatedEvent_thenReturnRegistrationIsNull() { + // Arrange + InstanceId instance = InstanceId.of("42"); + + // Act + InstanceRegistrationUpdatedEvent actualInstanceRegistrationUpdatedEvent = new InstanceRegistrationUpdatedEvent( + instance, 1L, null); + + // Assert + assertNull(actualInstanceRegistrationUpdatedEvent.getRegistration()); + assertEquals(1L, actualInstanceRegistrationUpdatedEvent.getVersion()); + assertEquals(InstanceRegistrationUpdatedEvent.TYPE, actualInstanceRegistrationUpdatedEvent.getType()); + assertSame(instance, actualInstanceRegistrationUpdatedEvent.getInstance()); + } + + /** + * Test + * {@link InstanceRegistrationUpdatedEvent#InstanceRegistrationUpdatedEvent(InstanceId, long, Instant, Registration)}. + *

    + *
  • Then return Registration is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceRegistrationUpdatedEvent#InstanceRegistrationUpdatedEvent(InstanceId, long, Instant, Registration)} + */ + @Test + public void testNewInstanceRegistrationUpdatedEvent_thenReturnRegistrationIsNull2() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Instant timestamp = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + InstanceRegistrationUpdatedEvent actualInstanceRegistrationUpdatedEvent = new InstanceRegistrationUpdatedEvent( + instance, 1L, timestamp, null); + + // Assert + assertNull(actualInstanceRegistrationUpdatedEvent.getRegistration()); + assertEquals(1L, actualInstanceRegistrationUpdatedEvent.getVersion()); + assertEquals(InstanceRegistrationUpdatedEvent.TYPE, actualInstanceRegistrationUpdatedEvent.getType()); + assertSame(instance, actualInstanceRegistrationUpdatedEvent.getInstance()); + Instant expectedTimestamp = timestamp.EPOCH; + assertSame(expectedTimestamp, actualInstanceRegistrationUpdatedEvent.getTimestamp()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceStatusChangedEventDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceStatusChangedEventDiffblueTest.java new file mode 100644 index 00000000000..027ce872557 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/events/InstanceStatusChangedEventDiffblueTest.java @@ -0,0 +1,70 @@ +package de.codecentric.boot.admin.server.domain.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.StatusInfo; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class InstanceStatusChangedEventDiffblueTest { + + /** + * Test + * {@link InstanceStatusChangedEvent#InstanceStatusChangedEvent(InstanceId, long, StatusInfo)}. + *

    + *
  • Then return StatusInfo is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceStatusChangedEvent#InstanceStatusChangedEvent(InstanceId, long, StatusInfo)} + */ + @Test + public void testNewInstanceStatusChangedEvent_thenReturnStatusInfoIsNull() { + // Arrange + InstanceId instance = InstanceId.of("42"); + + // Act + InstanceStatusChangedEvent actualInstanceStatusChangedEvent = new InstanceStatusChangedEvent(instance, 1L, + null); + + // Assert + assertNull(actualInstanceStatusChangedEvent.getStatusInfo()); + assertEquals(1L, actualInstanceStatusChangedEvent.getVersion()); + assertEquals(InstanceStatusChangedEvent.TYPE, actualInstanceStatusChangedEvent.getType()); + assertSame(instance, actualInstanceStatusChangedEvent.getInstance()); + } + + /** + * Test + * {@link InstanceStatusChangedEvent#InstanceStatusChangedEvent(InstanceId, long, Instant, StatusInfo)}. + *

    + *
  • Then return StatusInfo is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceStatusChangedEvent#InstanceStatusChangedEvent(InstanceId, long, Instant, StatusInfo)} + */ + @Test + public void testNewInstanceStatusChangedEvent_thenReturnStatusInfoIsNull2() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Instant timestamp = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + InstanceStatusChangedEvent actualInstanceStatusChangedEvent = new InstanceStatusChangedEvent(instance, 1L, + timestamp, null); + + // Assert + assertNull(actualInstanceStatusChangedEvent.getStatusInfo()); + assertEquals(1L, actualInstanceStatusChangedEvent.getVersion()); + assertEquals(InstanceStatusChangedEvent.TYPE, actualInstanceStatusChangedEvent.getType()); + assertSame(instance, actualInstanceStatusChangedEvent.getInstance()); + Instant expectedTimestamp = timestamp.EPOCH; + assertSame(expectedTimestamp, actualInstanceStatusChangedEvent.getTimestamp()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/BuildVersionDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/BuildVersionDiffblueTest.java new file mode 100644 index 00000000000..f029bb46182 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/BuildVersionDiffblueTest.java @@ -0,0 +1,355 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class BuildVersionDiffblueTest { + + /** + * Test {@link BuildVersion#valueOf(String)}. + *

    + *
  • When {@code foo}.
  • + *
  • Then return Value is {@code foo}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#valueOf(String)} + */ + @Test + public void testValueOf_whenFoo_thenReturnValueIsFoo() { + // Arrange and Act + BuildVersion actualValueOfResult = BuildVersion.valueOf("foo"); + + // Assert + assertEquals("foo", actualValueOfResult.getValue()); + assertEquals("foo", actualValueOfResult.toString()); + } + + /** + * Test {@link BuildVersion#valueOf(String)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return Value is {@link StatusInfo#STATUS_UNKNOWN}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#valueOf(String)} + */ + @Test + public void testValueOf_whenNull_thenReturnValueIsStatus_unknown() { + // Arrange and Act + BuildVersion actualValueOfResult = BuildVersion.valueOf(null); + + // Assert + assertEquals(StatusInfo.STATUS_UNKNOWN, actualValueOfResult.getValue()); + assertEquals(StatusInfo.STATUS_UNKNOWN, actualValueOfResult.toString()); + } + + /** + * Test {@link BuildVersion#from(Map)}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code 42}.
  • + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#from(Map)} + */ + @Test + public void testFrom_givenFoo_whenHashMapFooIs42_thenReturnNull() { + // Arrange + HashMap map = new HashMap<>(); + map.put("foo", "42"); + + // Act and Assert + assertNull(BuildVersion.from(map)); + } + + /** + * Test {@link BuildVersion#from(Map)}. + *

    + *
  • Given {@link HashMap#HashMap()} {@code version} is {@code not blank}.
  • + *
  • When {@link HashMap#HashMap()} {@code build.version} is {@code not blank}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#from(Map)} + */ + @Test + public void testFrom_givenHashMapVersionIsNotBlank_whenHashMapBuildVersionIsNotBlank() { + // Arrange + HashMap objectObjectMap = new HashMap<>(); + objectObjectMap.put("version", "not blank"); + + HashMap map = new HashMap<>(); + map.put("build", objectObjectMap); + map.put("build.version", "not blank"); + map.put("version", "not blank"); + + // Act + BuildVersion actualFromResult = BuildVersion.from(map); + + // Assert + assertEquals("not blank", actualFromResult.getValue()); + assertEquals("not blank", actualFromResult.toString()); + } + + /** + * Test {@link BuildVersion#from(Map)}. + *

    + *
  • Given {@code null}.
  • + *
  • When {@link HashMap#HashMap()} {@code build.version} is {@code null}.
  • + *
  • Then return Value is {@code not blank}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#from(Map)} + */ + @Test + public void testFrom_givenNull_whenHashMapBuildVersionIsNull_thenReturnValueIsNotBlank() { + // Arrange + HashMap objectObjectMap = new HashMap<>(); + objectObjectMap.put("version", null); + + HashMap map = new HashMap<>(); + map.put("build", objectObjectMap); + map.put("build.version", null); + map.put("version", "not blank"); + + // Act + BuildVersion actualFromResult = BuildVersion.from(map); + + // Assert + assertEquals("not blank", actualFromResult.getValue()); + assertEquals("not blank", actualFromResult.toString()); + } + + /** + * Test {@link BuildVersion#from(Map)}. + *

    + *
  • Given {@code null}.
  • + *
  • When {@link HashMap#HashMap()} {@code version} is {@code null}.
  • + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#from(Map)} + */ + @Test + public void testFrom_givenNull_whenHashMapVersionIsNull_thenReturnNull() { + // Arrange + HashMap objectObjectMap = new HashMap<>(); + objectObjectMap.put("version", null); + + HashMap map = new HashMap<>(); + map.put("build", objectObjectMap); + map.put("build.version", null); + map.put("version", null); + + // Act and Assert + assertNull(BuildVersion.from(map)); + } + + /** + * Test {@link BuildVersion#from(Map)}. + *

    + *
  • Given space.
  • + *
  • When {@link HashMap#HashMap()} {@code version} is space.
  • + *
  • Then return Value is {@link StatusInfo#STATUS_UNKNOWN}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#from(Map)} + */ + @Test + public void testFrom_givenSpace_whenHashMapVersionIsSpace_thenReturnValueIsStatus_unknown() { + // Arrange + HashMap objectObjectMap = new HashMap<>(); + objectObjectMap.put("version", null); + + HashMap map = new HashMap<>(); + map.put("build", objectObjectMap); + map.put("build.version", null); + map.put("version", " "); + + // Act + BuildVersion actualFromResult = BuildVersion.from(map); + + // Assert + assertEquals(StatusInfo.STATUS_UNKNOWN, actualFromResult.getValue()); + assertEquals(StatusInfo.STATUS_UNKNOWN, actualFromResult.toString()); + } + + /** + * Test {@link BuildVersion#from(Map)}. + *

    + *
  • When {@link HashMap#HashMap()} {@code build.version} is {@code not blank}.
  • + *
  • Then return Value is {@code not blank}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#from(Map)} + */ + @Test + public void testFrom_whenHashMapBuildVersionIsNotBlank_thenReturnValueIsNotBlank() { + // Arrange + HashMap objectObjectMap = new HashMap<>(); + objectObjectMap.put("version", null); + + HashMap map = new HashMap<>(); + map.put("build", objectObjectMap); + map.put("build.version", "not blank"); + map.put("version", "not blank"); + + // Act + BuildVersion actualFromResult = BuildVersion.from(map); + + // Assert + assertEquals("not blank", actualFromResult.getValue()); + assertEquals("not blank", actualFromResult.toString()); + } + + /** + * Test {@link BuildVersion#from(Map)}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: {@link BuildVersion#from(Map)} + */ + @Test + public void testFrom_whenHashMap_thenReturnNull() { + // Arrange, Act and Assert + assertNull(BuildVersion.from(new HashMap<>())); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link BuildVersion#getValue()} + *
  • {@link BuildVersion#toString()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + BuildVersion valueOfResult = BuildVersion.valueOf("foo"); + + // Act + String actualValue = valueOfResult.getValue(); + + // Assert + assertEquals("foo", actualValue); + assertEquals("foo", valueOfResult.toString()); + } + + /** + * Test {@link BuildVersion#compareTo(BuildVersion)} with {@code BuildVersion}. + *
    + *
  • Given valueOf {@code 42}.
  • + *
  • When valueOf {@code 42}.
  • + *
  • Then return zero.
  • + *
+ *

+ * Method under test: {@link BuildVersion#compareTo(BuildVersion)} + */ + @Test + public void testCompareToWithBuildVersion_givenValueOf42_whenValueOf42_thenReturnZero() { + // Arrange + BuildVersion valueOfResult = BuildVersion.valueOf("42"); + + // Act and Assert + assertEquals(0, valueOfResult.compareTo(BuildVersion.valueOf("42"))); + } + + /** + * Test {@link BuildVersion#compareTo(BuildVersion)} with {@code BuildVersion}. + *

    + *
  • Given valueOf {@code 42}.
  • + *
  • When valueOf {@code foo}.
  • + *
  • Then return minus fifty.
  • + *
+ *

+ * Method under test: {@link BuildVersion#compareTo(BuildVersion)} + */ + @Test + public void testCompareToWithBuildVersion_givenValueOf42_whenValueOfFoo_thenReturnMinusFifty() { + // Arrange + BuildVersion valueOfResult = BuildVersion.valueOf("42"); + + // Act and Assert + assertEquals(-50, valueOfResult.compareTo(BuildVersion.valueOf("foo"))); + } + + /** + * Test {@link BuildVersion#compareTo(BuildVersion)} with {@code BuildVersion}. + *

    + *
  • Given valueOf {@code build.version}.
  • + *
  • Then return one.
  • + *
+ *

+ * Method under test: {@link BuildVersion#compareTo(BuildVersion)} + */ + @Test + public void testCompareToWithBuildVersion_givenValueOfBuildVersion_thenReturnOne() { + // Arrange + BuildVersion valueOfResult = BuildVersion.valueOf("build.version"); + + // Act and Assert + assertEquals(1, valueOfResult.compareTo(BuildVersion.valueOf("build"))); + } + + /** + * Test {@link BuildVersion#compareTo(BuildVersion)} with {@code BuildVersion}. + *

    + *
  • Given valueOf {@code build}.
  • + *
  • Then return minus one.
  • + *
+ *

+ * Method under test: {@link BuildVersion#compareTo(BuildVersion)} + */ + @Test + public void testCompareToWithBuildVersion_givenValueOfBuild_thenReturnMinusOne() { + // Arrange + BuildVersion valueOfResult = BuildVersion.valueOf("build"); + + // Act and Assert + assertEquals(-1, valueOfResult.compareTo(BuildVersion.valueOf("build.version"))); + } + + /** + * Test {@link BuildVersion#compareTo(BuildVersion)} with {@code BuildVersion}. + *

    + *
  • Given valueOf {@code foo}.
  • + *
  • When valueOf {@code foo}.
  • + *
  • Then return zero.
  • + *
+ *

+ * Method under test: {@link BuildVersion#compareTo(BuildVersion)} + */ + @Test + public void testCompareToWithBuildVersion_givenValueOfFoo_whenValueOfFoo_thenReturnZero() { + // Arrange + BuildVersion valueOfResult = BuildVersion.valueOf("foo"); + + // Act and Assert + assertEquals(0, valueOfResult.compareTo(BuildVersion.valueOf("foo"))); + } + + /** + * Test {@link BuildVersion#compareTo(BuildVersion)} with {@code BuildVersion}. + *

    + *
  • Then return minus eleven.
  • + *
+ *

+ * Method under test: {@link BuildVersion#compareTo(BuildVersion)} + */ + @Test + public void testCompareToWithBuildVersion_thenReturnMinusEleven() { + // Arrange + BuildVersion valueOfResult = BuildVersion.valueOf("[.\\-+]"); + + // Act and Assert + assertEquals(-11, valueOfResult.compareTo(BuildVersion.valueOf("foo"))); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointDiffblueTest.java new file mode 100644 index 00000000000..4369529bdf3 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointDiffblueTest.java @@ -0,0 +1,27 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class EndpointDiffblueTest { + + /** + * Test {@link Endpoint#of(String, String)}. + *

    + *
  • When {@code 42}.
  • + *
  • Then return Id is {@code 42}.
  • + *
+ *

+ * Method under test: {@link Endpoint#of(String, String)} + */ + @Test + public void testOf_when42_thenReturnIdIs42() { + // Arrange and Act + Endpoint actualOfResult = Endpoint.of("42", "https://example.org/example"); + + // Assert + assertEquals("42", actualOfResult.getId()); + assertEquals("https://example.org/example", actualOfResult.getUrl()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointsDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointsDiffblueTest.java new file mode 100644 index 00000000000..c9a086f1c93 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointsDiffblueTest.java @@ -0,0 +1,287 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.Test; + +public class EndpointsDiffblueTest { + + /** + * Test {@link Endpoints#get(String)}. + *

+ * Method under test: {@link Endpoints#get(String)} + */ + @Test + public void testGet() { + // Arrange, Act and Assert + assertFalse(Endpoints.empty().get("42").isPresent()); + } + + /** + * Test {@link Endpoints#isPresent(String)}. + *

    + *
  • Given empty.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link Endpoints#isPresent(String)} + */ + @Test + public void testIsPresent_givenEmpty_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(Endpoints.empty().isPresent("42")); + } + + /** + * Test {@link Endpoints#isPresent(String)}. + *

    + *
  • Given single {@code 42} and {@code https://example.org/example}.
  • + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link Endpoints#isPresent(String)} + */ + @Test + public void testIsPresent_givenSingle42AndHttpsExampleOrgExample_thenReturnTrue() { + // Arrange, Act and Assert + assertTrue(Endpoints.single("42", "https://example.org/example").isPresent("42")); + } + + /** + * Test {@link Endpoints#iterator()}. + *

+ * Method under test: {@link Endpoints#iterator()} + */ + @Test + public void testIterator() { + // Arrange, Act and Assert + assertFalse(Endpoints.empty().iterator().hasNext()); + } + + /** + * Test {@link Endpoints#empty()}. + *

+ * Method under test: {@link Endpoints#empty()} + */ + @Test + public void testEmpty() { + // Arrange and Act + Endpoints actualEmptyResult = Endpoints.empty(); + + // Assert + assertFalse(actualEmptyResult.iterator().hasNext()); + Stream streamResult = actualEmptyResult.stream(); + assertTrue(streamResult.limit(5).collect(Collectors.toList()).isEmpty()); + } + + /** + * Test {@link Endpoints#single(String, String)}. + *

    + *
  • When {@code 42}.
  • + *
  • Then return iterator next Id is {@code 42}.
  • + *
+ *

+ * Method under test: {@link Endpoints#single(String, String)} + */ + @Test + public void testSingle_when42_thenReturnIteratorNextIdIs42() { + // Arrange and Act + Endpoints actualSingleResult = Endpoints.single("42", "https://example.org/example"); + + // Assert + Iterator iteratorResult = actualSingleResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertEquals("42", nextResult.getId()); + assertEquals("https://example.org/example", nextResult.getUrl()); + Stream streamResult = actualSingleResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(1, collectResult.size()); + assertFalse(iteratorResult.hasNext()); + assertSame(nextResult, collectResult.get(0)); + } + + /** + * Test {@link Endpoints#of(Collection)}. + *

    + *
  • Then return iterator next Id is {@code 42}.
  • + *
+ *

+ * Method under test: {@link Endpoints#of(Collection)} + */ + @Test + public void testOf_thenReturnIteratorNextIdIs42() { + // Arrange + ArrayList endpoints = new ArrayList<>(); + Endpoint ofResult = Endpoint.of("42", "https://example.org/example"); + endpoints.add(ofResult); + + // Act + Endpoints actualOfResult = Endpoints.of(endpoints); + + // Assert + Iterator iteratorResult = actualOfResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertEquals("42", nextResult.getId()); + Stream streamResult = actualOfResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(1, collectResult.size()); + assertFalse(iteratorResult.hasNext()); + assertSame(ofResult, nextResult); + assertSame(ofResult, collectResult.get(0)); + } + + /** + * Test {@link Endpoints#of(Collection)}. + *

    + *
  • Then return iterator next Id is {@code Id}.
  • + *
+ *

+ * Method under test: {@link Endpoints#of(Collection)} + */ + @Test + public void testOf_thenReturnIteratorNextIdIsId() { + // Arrange + Endpoint ofResult = Endpoint.of("Id", "https://example.org/example"); + + ArrayList endpoints = new ArrayList<>(); + endpoints.add(ofResult); + Endpoint ofResult2 = Endpoint.of("42", "https://example.org/example"); + endpoints.add(ofResult2); + + // Act + Endpoints actualOfResult = Endpoints.of(endpoints); + + // Assert + Iterator iteratorResult = actualOfResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + Endpoint actualNextResult = iteratorResult.next(); + boolean actualHasNextResult = iteratorResult.hasNext(); + assertEquals("Id", nextResult.getId()); + Stream streamResult = actualOfResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(2, collectResult.size()); + assertFalse(actualHasNextResult); + assertSame(ofResult2, actualNextResult); + assertSame(ofResult2, collectResult.get(1)); + assertSame(ofResult, nextResult); + assertSame(ofResult, collectResult.get(0)); + } + + /** + * Test {@link Endpoints#of(Collection)}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
  • Then return stream limit five collect toList Empty.
  • + *
+ *

+ * Method under test: {@link Endpoints#of(Collection)} + */ + @Test + public void testOf_whenArrayList_thenReturnStreamLimitFiveCollectToListEmpty() { + // Arrange and Act + Endpoints actualOfResult = Endpoints.of(new ArrayList<>()); + + // Assert + assertFalse(actualOfResult.iterator().hasNext()); + Stream streamResult = actualOfResult.stream(); + assertTrue(streamResult.limit(5).collect(Collectors.toList()).isEmpty()); + } + + /** + * Test {@link Endpoints#of(Collection)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return stream limit five collect toList Empty.
  • + *
+ *

+ * Method under test: {@link Endpoints#of(Collection)} + */ + @Test + public void testOf_whenNull_thenReturnStreamLimitFiveCollectToListEmpty() { + // Arrange and Act + Endpoints actualOfResult = Endpoints.of(null); + + // Assert + assertFalse(actualOfResult.iterator().hasNext()); + Stream streamResult = actualOfResult.stream(); + assertTrue(streamResult.limit(5).collect(Collectors.toList()).isEmpty()); + } + + /** + * Test {@link Endpoints#withEndpoint(String, String)}. + *

    + *
  • Given empty.
  • + *
  • Then return stream limit five collect toList size is one.
  • + *
+ *

+ * Method under test: {@link Endpoints#withEndpoint(String, String)} + */ + @Test + public void testWithEndpoint_givenEmpty_thenReturnStreamLimitFiveCollectToListSizeIsOne() { + // Arrange and Act + Endpoints actualWithEndpointResult = Endpoints.empty().withEndpoint("42", "https://example.org/example"); + + // Assert + Iterator iteratorResult = actualWithEndpointResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertEquals("42", nextResult.getId()); + Stream streamResult = actualWithEndpointResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(1, collectResult.size()); + assertFalse(iteratorResult.hasNext()); + assertSame(nextResult, collectResult.get(0)); + } + + /** + * Test {@link Endpoints#withEndpoint(String, String)}. + *

    + *
  • Then return iterator next Id is {@code Id}.
  • + *
+ *

+ * Method under test: {@link Endpoints#withEndpoint(String, String)} + */ + @Test + public void testWithEndpoint_thenReturnIteratorNextIdIsId() { + // Arrange and Act + Endpoints actualWithEndpointResult = Endpoints.single("Id", "https://example.org/example") + .withEndpoint("42", "https://example.org/example"); + + // Assert + Iterator iteratorResult = actualWithEndpointResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + Endpoint nextResult2 = iteratorResult.next(); + boolean actualHasNextResult = iteratorResult.hasNext(); + assertEquals("42", nextResult2.getId()); + assertEquals("Id", nextResult.getId()); + assertEquals("https://example.org/example", nextResult2.getUrl()); + Stream streamResult = actualWithEndpointResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(2, collectResult.size()); + assertFalse(actualHasNextResult); + assertSame(nextResult, collectResult.get(0)); + assertSame(nextResult2, collectResult.get(1)); + } + + /** + * Test {@link Endpoints#stream()}. + *

+ * Method under test: {@link Endpoints#stream()} + */ + @Test + public void testStream() { + // Arrange and Act + Stream actualStreamResult = Endpoints.empty().stream(); + + // Assert + assertTrue(actualStreamResult.limit(5).collect(Collectors.toList()).isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/InfoDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/InfoDiffblueTest.java new file mode 100644 index 00000000000..0078c69bf85 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/InfoDiffblueTest.java @@ -0,0 +1,83 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class InfoDiffblueTest { + + /** + * Test {@link Info#from(Map)}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code 42}.
  • + *
  • Then return Values is {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link Info#from(Map)} + */ + @Test + public void testFrom_givenFoo_whenHashMapFooIs42_thenReturnValuesIsHashMap() { + // Arrange + HashMap values = new HashMap<>(); + values.put("foo", "42"); + + // Act and Assert + assertEquals(values, Info.from(values).getValues()); + } + + /** + * Test {@link Info#from(Map)}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Info#from(Map)} + */ + @Test + public void testFrom_whenHashMap_thenReturnValuesEmpty() { + // Arrange, Act and Assert + assertTrue(Info.from(new HashMap<>()).getValues().isEmpty()); + } + + /** + * Test {@link Info#from(Map)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Info#from(Map)} + */ + @Test + public void testFrom_whenNull_thenReturnValuesEmpty() { + // Arrange, Act and Assert + assertTrue(Info.from(null).getValues().isEmpty()); + } + + /** + * Test {@link Info#empty()}. + *

+ * Method under test: {@link Info#empty()} + */ + @Test + public void testEmpty() { + // Arrange, Act and Assert + assertTrue(Info.empty().getValues().isEmpty()); + } + + /** + * Test {@link Info#getValues()}. + *

+ * Method under test: {@link Info#getValues()} + */ + @Test + public void testGetValues() { + // Arrange, Act and Assert + assertTrue(Info.empty().getValues().isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/InstanceIdDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/InstanceIdDiffblueTest.java new file mode 100644 index 00000000000..5817a9f1ff0 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/InstanceIdDiffblueTest.java @@ -0,0 +1,52 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class InstanceIdDiffblueTest { + + /** + * Test {@link InstanceId#of(String)}. + *

    + *
  • When {@code 42}.
  • + *
  • Then return Value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link InstanceId#of(String)} + */ + @Test + public void testOf_when42_thenReturnValueIs42() { + // Arrange and Act + InstanceId actualOfResult = InstanceId.of("42"); + + // Assert + assertEquals("42", actualOfResult.getValue()); + assertEquals("42", actualOfResult.toString()); + } + + /** + * Test {@link InstanceId#toString()}. + *

+ * Method under test: {@link InstanceId#toString()} + */ + @Test + public void testToString() { + // Arrange, Act and Assert + assertEquals("42", InstanceId.of("42").toString()); + } + + /** + * Test {@link InstanceId#compareTo(InstanceId)} with {@code InstanceId}. + *

+ * Method under test: {@link InstanceId#compareTo(InstanceId)} + */ + @Test + public void testCompareToWithInstanceId() { + // Arrange + InstanceId ofResult = InstanceId.of("42"); + + // Act and Assert + assertEquals(0, ofResult.compareTo(InstanceId.of("42"))); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/RegistrationDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/RegistrationDiffblueTest.java new file mode 100644 index 00000000000..3458a121dc8 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/RegistrationDiffblueTest.java @@ -0,0 +1,28 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class RegistrationDiffblueTest { + + /** + * Test {@link Registration#getMetadata()}. + *

+ * Method under test: {@link Registration#getMetadata()} + */ + @Test + public void testGetMetadata() { + // Arrange + Registration buildResult = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + assertTrue(buildResult.getMetadata().isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/StatusInfoDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/StatusInfoDiffblueTest.java new file mode 100644 index 00000000000..fd01746ee9a --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/StatusInfoDiffblueTest.java @@ -0,0 +1,440 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class StatusInfoDiffblueTest { + + /** + * Test {@link StatusInfo#valueOf(String, Map)} with {@code statusCode}, + * {@code details}. + *

    + *
  • When {@code not blank}.
  • + *
  • Then return Status is {@code NOT BLANK}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#valueOf(String, Map)} + */ + @Test + public void testValueOfWithStatusCodeDetails_whenNotBlank_thenReturnStatusIsNotBlank() { + // Arrange and Act + StatusInfo actualValueOfResult = StatusInfo.valueOf("not blank", null); + + // Assert + assertEquals("NOT BLANK", actualValueOfResult.getStatus()); + assertFalse(actualValueOfResult.isDown()); + assertFalse(actualValueOfResult.isOffline()); + assertFalse(actualValueOfResult.isUnknown()); + assertFalse(actualValueOfResult.isUp()); + assertTrue(actualValueOfResult.getDetails().isEmpty()); + } + + /** + * Test {@link StatusInfo#valueOf(String, Map)} with {@code statusCode}, + * {@code details}. + *

    + *
  • When {@code Status Code}.
  • + *
  • Then return Status is {@code STATUS CODE}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#valueOf(String, Map)} + */ + @Test + public void testValueOfWithStatusCodeDetails_whenStatusCode_thenReturnStatusIsStatusCode() { + // Arrange and Act + StatusInfo actualValueOfResult = StatusInfo.valueOf("Status Code", new HashMap<>()); + + // Assert + assertEquals("STATUS CODE", actualValueOfResult.getStatus()); + assertFalse(actualValueOfResult.isDown()); + assertFalse(actualValueOfResult.isOffline()); + assertFalse(actualValueOfResult.isUnknown()); + assertFalse(actualValueOfResult.isUp()); + assertTrue(actualValueOfResult.getDetails().isEmpty()); + } + + /** + * Test {@link StatusInfo#valueOf(String)} with {@code statusCode}. + *

    + *
  • When {@code Status Code}.
  • + *
  • Then return Status is {@code STATUS CODE}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#valueOf(String)} + */ + @Test + public void testValueOfWithStatusCode_whenStatusCode_thenReturnStatusIsStatusCode() { + // Arrange and Act + StatusInfo actualValueOfResult = StatusInfo.valueOf("Status Code"); + + // Assert + assertEquals("STATUS CODE", actualValueOfResult.getStatus()); + assertFalse(actualValueOfResult.isDown()); + assertFalse(actualValueOfResult.isOffline()); + assertFalse(actualValueOfResult.isUnknown()); + assertFalse(actualValueOfResult.isUp()); + assertTrue(actualValueOfResult.getDetails().isEmpty()); + } + + /** + * Test {@link StatusInfo#ofUnknown()}. + *

+ * Method under test: {@link StatusInfo#ofUnknown()} + */ + @Test + public void testOfUnknown() { + // Arrange and Act + StatusInfo actualOfUnknownResult = StatusInfo.ofUnknown(); + + // Assert + assertFalse(actualOfUnknownResult.isDown()); + assertFalse(actualOfUnknownResult.isOffline()); + assertFalse(actualOfUnknownResult.isUp()); + assertTrue(actualOfUnknownResult.isUnknown()); + assertTrue(actualOfUnknownResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_UNKNOWN, actualOfUnknownResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofUp()}. + *

+ * Method under test: {@link StatusInfo#ofUp()} + */ + @Test + public void testOfUp() { + // Arrange and Act + StatusInfo actualOfUpResult = StatusInfo.ofUp(); + + // Assert + assertFalse(actualOfUpResult.isDown()); + assertFalse(actualOfUpResult.isOffline()); + assertFalse(actualOfUpResult.isUnknown()); + assertTrue(actualOfUpResult.isUp()); + assertTrue(actualOfUpResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_UP, actualOfUpResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofUp(Map)} with {@code Map}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#ofUp(Map)} + */ + @Test + public void testOfUpWithMap_whenHashMap() { + // Arrange and Act + StatusInfo actualOfUpResult = StatusInfo.ofUp(new HashMap<>()); + + // Assert + assertFalse(actualOfUpResult.isDown()); + assertFalse(actualOfUpResult.isOffline()); + assertFalse(actualOfUpResult.isUnknown()); + assertTrue(actualOfUpResult.isUp()); + assertTrue(actualOfUpResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_UP, actualOfUpResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofUp(Map)} with {@code Map}. + *

    + *
  • When {@code null}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#ofUp(Map)} + */ + @Test + public void testOfUpWithMap_whenNull() { + // Arrange and Act + StatusInfo actualOfUpResult = StatusInfo.ofUp(null); + + // Assert + assertFalse(actualOfUpResult.isDown()); + assertFalse(actualOfUpResult.isOffline()); + assertFalse(actualOfUpResult.isUnknown()); + assertTrue(actualOfUpResult.isUp()); + assertTrue(actualOfUpResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_UP, actualOfUpResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofDown()}. + *

+ * Method under test: {@link StatusInfo#ofDown()} + */ + @Test + public void testOfDown() { + // Arrange and Act + StatusInfo actualOfDownResult = StatusInfo.ofDown(); + + // Assert + assertFalse(actualOfDownResult.isOffline()); + assertFalse(actualOfDownResult.isUnknown()); + assertFalse(actualOfDownResult.isUp()); + assertTrue(actualOfDownResult.isDown()); + assertTrue(actualOfDownResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_DOWN, actualOfDownResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofDown(Map)} with {@code Map}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#ofDown(Map)} + */ + @Test + public void testOfDownWithMap_whenHashMap() { + // Arrange and Act + StatusInfo actualOfDownResult = StatusInfo.ofDown(new HashMap<>()); + + // Assert + assertFalse(actualOfDownResult.isOffline()); + assertFalse(actualOfDownResult.isUnknown()); + assertFalse(actualOfDownResult.isUp()); + assertTrue(actualOfDownResult.isDown()); + assertTrue(actualOfDownResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_DOWN, actualOfDownResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofDown(Map)} with {@code Map}. + *

    + *
  • When {@code null}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#ofDown(Map)} + */ + @Test + public void testOfDownWithMap_whenNull() { + // Arrange and Act + StatusInfo actualOfDownResult = StatusInfo.ofDown(null); + + // Assert + assertFalse(actualOfDownResult.isOffline()); + assertFalse(actualOfDownResult.isUnknown()); + assertFalse(actualOfDownResult.isUp()); + assertTrue(actualOfDownResult.isDown()); + assertTrue(actualOfDownResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_DOWN, actualOfDownResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofOffline()}. + *

+ * Method under test: {@link StatusInfo#ofOffline()} + */ + @Test + public void testOfOffline() { + // Arrange and Act + StatusInfo actualOfOfflineResult = StatusInfo.ofOffline(); + + // Assert + assertFalse(actualOfOfflineResult.isDown()); + assertFalse(actualOfOfflineResult.isUnknown()); + assertFalse(actualOfOfflineResult.isUp()); + assertTrue(actualOfOfflineResult.isOffline()); + assertTrue(actualOfOfflineResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_OFFLINE, actualOfOfflineResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofOffline(Map)} with {@code Map}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#ofOffline(Map)} + */ + @Test + public void testOfOfflineWithMap_whenHashMap() { + // Arrange and Act + StatusInfo actualOfOfflineResult = StatusInfo.ofOffline(new HashMap<>()); + + // Assert + assertFalse(actualOfOfflineResult.isDown()); + assertFalse(actualOfOfflineResult.isUnknown()); + assertFalse(actualOfOfflineResult.isUp()); + assertTrue(actualOfOfflineResult.isOffline()); + assertTrue(actualOfOfflineResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_OFFLINE, actualOfOfflineResult.getStatus()); + } + + /** + * Test {@link StatusInfo#ofOffline(Map)} with {@code Map}. + *

    + *
  • When {@code null}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#ofOffline(Map)} + */ + @Test + public void testOfOfflineWithMap_whenNull() { + // Arrange and Act + StatusInfo actualOfOfflineResult = StatusInfo.ofOffline(null); + + // Assert + assertFalse(actualOfOfflineResult.isDown()); + assertFalse(actualOfOfflineResult.isUnknown()); + assertFalse(actualOfOfflineResult.isUp()); + assertTrue(actualOfOfflineResult.isOffline()); + assertTrue(actualOfOfflineResult.getDetails().isEmpty()); + assertEquals(StatusInfo.STATUS_OFFLINE, actualOfOfflineResult.getStatus()); + } + + /** + * Test {@link StatusInfo#getDetails()}. + *

+ * Method under test: {@link StatusInfo#getDetails()} + */ + @Test + public void testGetDetails() { + // Arrange, Act and Assert + assertTrue(StatusInfo.valueOf("Status Code", new HashMap<>()).getDetails().isEmpty()); + } + + /** + * Test {@link StatusInfo#isUp()}. + *

    + *
  • Given valueOf {@code Status Code} and {@link HashMap#HashMap()}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isUp()} + */ + @Test + public void testIsUp_givenValueOfStatusCodeAndHashMap_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(StatusInfo.valueOf("Status Code", new HashMap<>()).isUp()); + } + + /** + * Test {@link StatusInfo#isUp()}. + *

    + *
  • Given valueOf {@link StatusInfo#STATUS_UP} and {@link HashMap#HashMap()}.
  • + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isUp()} + */ + @Test + public void testIsUp_givenValueOfStatus_upAndHashMap_thenReturnTrue() { + // Arrange, Act and Assert + assertTrue(StatusInfo.valueOf(StatusInfo.STATUS_UP, new HashMap<>()).isUp()); + } + + /** + * Test {@link StatusInfo#isOffline()}. + *

    + *
  • Given valueOf {@code Status Code} and {@link HashMap#HashMap()}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isOffline()} + */ + @Test + public void testIsOffline_givenValueOfStatusCodeAndHashMap_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(StatusInfo.valueOf("Status Code", new HashMap<>()).isOffline()); + } + + /** + * Test {@link StatusInfo#isOffline()}. + *

    + *
  • Given valueOf {@link StatusInfo#STATUS_OFFLINE} and + * {@link HashMap#HashMap()}.
  • + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isOffline()} + */ + @Test + public void testIsOffline_givenValueOfStatus_offlineAndHashMap_thenReturnTrue() { + // Arrange, Act and Assert + assertTrue(StatusInfo.valueOf(StatusInfo.STATUS_OFFLINE, new HashMap<>()).isOffline()); + } + + /** + * Test {@link StatusInfo#isDown()}. + *

    + *
  • Given valueOf {@code Status Code} and {@link HashMap#HashMap()}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isDown()} + */ + @Test + public void testIsDown_givenValueOfStatusCodeAndHashMap_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(StatusInfo.valueOf("Status Code", new HashMap<>()).isDown()); + } + + /** + * Test {@link StatusInfo#isDown()}. + *

    + *
  • Given valueOf {@link StatusInfo#STATUS_DOWN} and + * {@link HashMap#HashMap()}.
  • + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isDown()} + */ + @Test + public void testIsDown_givenValueOfStatus_downAndHashMap_thenReturnTrue() { + // Arrange, Act and Assert + assertTrue(StatusInfo.valueOf(StatusInfo.STATUS_DOWN, new HashMap<>()).isDown()); + } + + /** + * Test {@link StatusInfo#isUnknown()}. + *

    + *
  • Given valueOf {@code Status Code} and {@link HashMap#HashMap()}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isUnknown()} + */ + @Test + public void testIsUnknown_givenValueOfStatusCodeAndHashMap_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(StatusInfo.valueOf("Status Code", new HashMap<>()).isUnknown()); + } + + /** + * Test {@link StatusInfo#isUnknown()}. + *

    + *
  • Given valueOf {@link StatusInfo#STATUS_UNKNOWN} and + * {@link HashMap#HashMap()}.
  • + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link StatusInfo#isUnknown()} + */ + @Test + public void testIsUnknown_givenValueOfStatus_unknownAndHashMap_thenReturnTrue() { + // Arrange, Act and Assert + assertTrue(StatusInfo.valueOf(StatusInfo.STATUS_UNKNOWN, new HashMap<>()).isUnknown()); + } + + /** + * Test {@link StatusInfo#severity()}. + *

+ * Method under test: {@link StatusInfo#severity()} + */ + @Test + public void testSeverity() { + // Arrange and Act + Comparator actualSeverityResult = StatusInfo.severity(); + + // Assert + assertEquals(0, actualSeverityResult.compare("foo", "foo")); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/TagsDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/TagsDiffblueTest.java new file mode 100644 index 00000000000..a2e75ce8625 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/TagsDiffblueTest.java @@ -0,0 +1,269 @@ +package de.codecentric.boot.admin.server.domain.values; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class TagsDiffblueTest { + + /** + * Test {@link Tags#getValues()}. + *

+ * Method under test: {@link Tags#getValues()} + */ + @Test + public void testGetValues() { + // Arrange, Act and Assert + assertTrue(Tags.empty().getValues().isEmpty()); + } + + /** + * Test {@link Tags#append(Tags)}. + *

+ * Method under test: {@link Tags#append(Tags)} + */ + @Test + public void testAppend() { + // Arrange + Tags emptyResult = Tags.empty(); + + // Act and Assert + assertTrue(emptyResult.append(Tags.empty()).getValues().isEmpty()); + } + + /** + * Test {@link Tags#empty()}. + *

+ * Method under test: {@link Tags#empty()} + */ + @Test + public void testEmpty() { + // Arrange, Act and Assert + assertTrue(Tags.empty().getValues().isEmpty()); + } + + /** + * Test {@link Tags#from(Map, String)} with {@code map}, {@code prefix}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code 42} is {@code 42}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map, String)} + */ + @Test + public void testFromWithMapPrefix_givenFoo_whenHashMap42Is42_thenReturnValuesEmpty() { + // Arrange + HashMap map = new HashMap<>(); + map.put("42", "42"); + map.put("foo", "42"); + + // Act and Assert + assertTrue(Tags.from(map, "Prefix").getValues().isEmpty()); + } + + /** + * Test {@link Tags#from(Map, String)} with {@code map}, {@code prefix}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code 42} is {@code 42}.
  • + *
  • Then return Values is {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map, String)} + */ + @Test + public void testFromWithMapPrefix_givenFoo_whenHashMap42Is42_thenReturnValuesIsHashMap() { + // Arrange + HashMap map = new HashMap<>(); + map.put("42", "42"); + map.put("foo", "42"); + + // Act and Assert + assertEquals(map, Tags.from(map, null).getValues()); + } + + /** + * Test {@link Tags#from(Map, String)} with {@code map}, {@code prefix}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code 42}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map, String)} + */ + @Test + public void testFromWithMapPrefix_givenFoo_whenHashMapFooIs42_thenReturnValuesEmpty() { + // Arrange + HashMap map = new HashMap<>(); + map.put("foo", "42"); + + // Act and Assert + assertTrue(Tags.from(map, "Prefix").getValues().isEmpty()); + } + + /** + * Test {@link Tags#from(Map, String)} with {@code map}, {@code prefix}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@code null}.
  • + *
  • Then return Values size is one.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map, String)} + */ + @Test + public void testFromWithMapPrefix_givenFoo_whenNull_thenReturnValuesSizeIsOne() { + // Arrange + HashMap map = new HashMap<>(); + map.put("foo", "42"); + + // Act and Assert + Map values = Tags.from(map, null).getValues(); + assertEquals(1, values.size()); + assertEquals("42", values.get("foo")); + } + + /** + * Test {@link Tags#from(Map, String)} with {@code map}, {@code prefix}. + *

    + *
  • Given {@code null}.
  • + *
  • When {@link HashMap#HashMap()} {@code null} is {@code 42}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map, String)} + */ + @Test + public void testFromWithMapPrefix_givenNull_whenHashMapNullIs42_thenReturnValuesEmpty() { + // Arrange + HashMap map = new HashMap<>(); + map.put(null, "42"); + + // Act and Assert + assertTrue(Tags.from(map, "Prefix").getValues().isEmpty()); + } + + /** + * Test {@link Tags#from(Map, String)} with {@code map}, {@code prefix}. + *

    + *
  • Given {@code null}.
  • + *
  • When {@link HashMap#HashMap()} {@code null} is {@code 42}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map, String)} + */ + @Test + public void testFromWithMapPrefix_givenNull_whenHashMapNullIs42_thenReturnValuesEmpty2() { + // Arrange + HashMap map = new HashMap<>(); + map.put(null, "42"); + + // Act and Assert + assertTrue(Tags.from(map, null).getValues().isEmpty()); + } + + /** + * Test {@link Tags#from(Map, String)} with {@code map}, {@code prefix}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map, String)} + */ + @Test + public void testFromWithMapPrefix_whenHashMap_thenReturnValuesEmpty() { + // Arrange, Act and Assert + assertTrue(Tags.from(new HashMap<>(), "Prefix").getValues().isEmpty()); + } + + /** + * Test {@link Tags#from(Map)} with {@code map}. + *

    + *
  • Given {@code 42}.
  • + *
  • When {@link HashMap#HashMap()} {@code 42} is {@code 42}.
  • + *
  • Then return Values is {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map)} + */ + @Test + public void testFromWithMap_given42_whenHashMap42Is42_thenReturnValuesIsHashMap() { + // Arrange + HashMap map = new HashMap<>(); + map.put("42", "42"); + map.put("foo", "42"); + + // Act and Assert + assertEquals(map, Tags.from(map).getValues()); + } + + /** + * Test {@link Tags#from(Map)} with {@code map}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code 42}.
  • + *
  • Then return Values size is one.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map)} + */ + @Test + public void testFromWithMap_givenFoo_whenHashMapFooIs42_thenReturnValuesSizeIsOne() { + // Arrange + HashMap map = new HashMap<>(); + map.put("foo", "42"); + + // Act and Assert + Map values = Tags.from(map).getValues(); + assertEquals(1, values.size()); + assertEquals("42", values.get("foo")); + } + + /** + * Test {@link Tags#from(Map)} with {@code map}. + *

    + *
  • Given {@link HashMap#HashMap()} {@code null} is {@link HashMap#HashMap()}.
  • + *
  • When {@link HashMap#HashMap()} {@code null} is {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map)} + */ + @Test + public void testFromWithMap_givenHashMapNullIsHashMap_whenHashMapNullIsHashMap() { + // Arrange + HashMap objectObjectMap = new HashMap<>(); + objectObjectMap.put(null, new HashMap<>()); + + HashMap objectObjectMap2 = new HashMap<>(); + objectObjectMap2.put(null, objectObjectMap); + + HashMap map = new HashMap<>(); + map.put(null, objectObjectMap2); + + // Act and Assert + assertTrue(Tags.from(map).getValues().isEmpty()); + } + + /** + * Test {@link Tags#from(Map)} with {@code map}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link Tags#from(Map)} + */ + @Test + public void testFromWithMap_whenHashMap_thenReturnValuesEmpty() { + // Arrange, Act and Assert + assertTrue(Tags.from(new HashMap<>()).getValues().isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/HazelcastEventStoreDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/HazelcastEventStoreDiffblueTest.java new file mode 100644 index 00000000000..de6c402545f --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/HazelcastEventStoreDiffblueTest.java @@ -0,0 +1,64 @@ +package de.codecentric.boot.admin.server.eventstore; + +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.util.List; +import java.util.UUID; +import org.junit.Test; +import org.mockito.Mockito; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class HazelcastEventStoreDiffblueTest { + + /** + * Test {@link HazelcastEventStore#HazelcastEventStore(int, IMap)}. + *

    + *
  • Given randomUUID.
  • + *
  • Then calls {@link IMap#addEntryListener(MapListener, boolean)}.
  • + *
+ *

+ * Method under test: {@link HazelcastEventStore#HazelcastEventStore(int, IMap)} + */ + @Test + public void testNewHazelcastEventStore_givenRandomUUID_thenCallsAddEntryListener() throws AssertionError { + // Arrange + IMap> eventLog = mock(IMap.class); + when(eventLog.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(new HazelcastEventStore(3, eventLog).findAll()); + createResult.expectComplete().verify(); + verify(eventLog).addEntryListener(isA(MapListener.class), eq(true)); + } + + /** + * Test {@link HazelcastEventStore#HazelcastEventStore(IMap)}. + *

    + *
  • Given randomUUID.
  • + *
  • Then calls {@link IMap#addEntryListener(MapListener, boolean)}.
  • + *
+ *

+ * Method under test: {@link HazelcastEventStore#HazelcastEventStore(IMap)} + */ + @Test + public void testNewHazelcastEventStore_givenRandomUUID_thenCallsAddEntryListener2() throws AssertionError { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(new HazelcastEventStore(eventLogs).findAll()); + createResult.expectComplete().verify(); + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/InMemoryEventStoreDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/InMemoryEventStoreDiffblueTest.java new file mode 100644 index 00000000000..b0253ce4ade --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/InMemoryEventStoreDiffblueTest.java @@ -0,0 +1,62 @@ +package de.codecentric.boot.admin.server.eventstore; + +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { InMemoryEventStore.class }) +@RunWith(SpringJUnit4ClassRunner.class) +public class InMemoryEventStoreDiffblueTest { + + @Autowired + private InMemoryEventStore inMemoryEventStore; + + /** + * Test {@link InMemoryEventStore#InMemoryEventStore()}. + *

+ * Method under test: {@link InMemoryEventStore#InMemoryEventStore()} + */ + @Test + public void testNewInMemoryEventStore() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new InMemoryEventStore().findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InMemoryEventStore#InMemoryEventStore(int)}. + *

+ * Method under test: {@link InMemoryEventStore#InMemoryEventStore(int)} + */ + @Test + public void testNewInMemoryEventStore2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new InMemoryEventStore(3).findAll()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InMemoryEventStore#append(List)}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InMemoryEventStore#append(List)} + */ + @Test + public void testAppend_whenArrayList() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(inMemoryEventStore.append(new ArrayList<>())); + createResult.expectComplete().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/OptimisticLockingExceptionDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/OptimisticLockingExceptionDiffblueTest.java new file mode 100644 index 00000000000..75dc1c2c272 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/OptimisticLockingExceptionDiffblueTest.java @@ -0,0 +1,27 @@ +package de.codecentric.boot.admin.server.eventstore; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class OptimisticLockingExceptionDiffblueTest { + + /** + * Test {@link OptimisticLockingException#OptimisticLockingException(String)}. + *

+ * Method under test: + * {@link OptimisticLockingException#OptimisticLockingException(String)} + */ + @Test + public void testNewOptimisticLockingException() { + // Arrange and Act + OptimisticLockingException actualOptimisticLockingException = new OptimisticLockingException( + "An error occurred"); + + // Assert + assertEquals("An error occurred", actualOptimisticLockingException.getMessage()); + assertNull(actualOptimisticLockingException.getCause()); + assertEquals(0, actualOptimisticLockingException.getSuppressed().length); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/AbstractEventNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/AbstractEventNotifierDiffblueTest.java new file mode 100644 index 00000000000..46eef10d6f8 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/AbstractEventNotifierDiffblueTest.java @@ -0,0 +1,126 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import org.junit.Test; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class AbstractEventNotifierDiffblueTest { + + /** + * Test {@link AbstractEventNotifier#notify(InstanceEvent)} with + * {@code InstanceEvent}. + *

+ * Method under test: {@link AbstractEventNotifier#notify(InstanceEvent)} + */ + @Test + public void testNotifyWithInstanceEvent() throws AssertionError { + // Arrange + Notifier delegate = mock(Notifier.class); + RemindingNotifier remindingNotifier = new RemindingNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(remindingNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AbstractEventNotifier#notify(InstanceEvent)} with + * {@code InstanceEvent}. + *

+ * Method under test: {@link AbstractEventNotifier#notify(InstanceEvent)} + */ + @Test + public void testNotifyWithInstanceEvent2() throws AssertionError { + // Arrange + DingTalkNotifier dingTalkNotifier = new DingTalkNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + dingTalkNotifier.setEnabled(false); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(dingTalkNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AbstractEventNotifier#notify(InstanceEvent)} with + * {@code InstanceEvent}. + *

+ * Method under test: {@link AbstractEventNotifier#notify(InstanceEvent)} + */ + @Test + public void testNotifyWithInstanceEvent3() throws AssertionError { + // Arrange + Notifier delegate = mock(Notifier.class); + RemindingNotifier remindingNotifier = new RemindingNotifier(delegate, + new SnapshottingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(remindingNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AbstractEventNotifier#shouldNotify(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link AbstractEventNotifier#shouldNotify(InstanceEvent, Instance)} + */ + @Test + public void testShouldNotify() { + // Arrange + LoggingNotifier loggingNotifier = new LoggingNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + assertFalse(loggingNotifier.shouldNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link AbstractEventNotifier#isEnabled()}. + *

    + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link AbstractEventNotifier#isEnabled()} + */ + @Test + public void testIsEnabled_thenReturnFalse() { + // Arrange + LoggingNotifier loggingNotifier = new LoggingNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore())); + loggingNotifier.setEnabled(false); + + // Act and Assert + assertFalse(loggingNotifier.isEnabled()); + } + + /** + * Test {@link AbstractEventNotifier#isEnabled()}. + *

    + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link AbstractEventNotifier#isEnabled()} + */ + @Test + public void testIsEnabled_thenReturnTrue() { + // Arrange, Act and Assert + assertTrue(new LoggingNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore())).isEnabled()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/AbstractStatusChangeNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/AbstractStatusChangeNotifierDiffblueTest.java new file mode 100644 index 00000000000..c4f19972b21 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/AbstractStatusChangeNotifierDiffblueTest.java @@ -0,0 +1,138 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import org.junit.Test; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class AbstractStatusChangeNotifierDiffblueTest { + + /** + * Test {@link AbstractStatusChangeNotifier#notify(InstanceEvent)} with + * {@code InstanceEvent}. + *

+ * Method under test: {@link AbstractStatusChangeNotifier#notify(InstanceEvent)} + */ + @Test + public void testNotifyWithInstanceEvent() throws AssertionError { + // Arrange + LoggingNotifier loggingNotifier = new LoggingNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(loggingNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AbstractStatusChangeNotifier#notify(InstanceEvent)} with + * {@code InstanceEvent}. + *

+ * Method under test: {@link AbstractStatusChangeNotifier#notify(InstanceEvent)} + */ + @Test + public void testNotifyWithInstanceEvent2() throws AssertionError { + // Arrange + DingTalkNotifier dingTalkNotifier = new DingTalkNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + dingTalkNotifier.setEnabled(false); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(dingTalkNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AbstractStatusChangeNotifier#notify(InstanceEvent)} with + * {@code InstanceEvent}. + *

+ * Method under test: {@link AbstractStatusChangeNotifier#notify(InstanceEvent)} + */ + @Test + public void testNotifyWithInstanceEvent3() throws AssertionError { + // Arrange + LoggingNotifier loggingNotifier = new LoggingNotifier( + new SnapshottingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(loggingNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link AbstractStatusChangeNotifier#shouldNotify(InstanceEvent, Instance)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: + * {@link AbstractStatusChangeNotifier#shouldNotify(InstanceEvent, Instance)} + */ + @Test + public void testShouldNotify_whenNull_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(new LoggingNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore())) + .shouldNotify(null, null)); + } + + /** + * Test {@link AbstractStatusChangeNotifier#getLastStatus(InstanceId)}. + *

+ * Method under test: {@link AbstractStatusChangeNotifier#getLastStatus(InstanceId)} + */ + @Test + public void testGetLastStatus() { + // Arrange + LoggingNotifier loggingNotifier = new LoggingNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + assertEquals("UNKNOWN", loggingNotifier.getLastStatus(InstanceId.of("42"))); + } + + /** + * Test {@link AbstractStatusChangeNotifier#setIgnoreChanges(String[])}. + *

+ * Method under test: {@link AbstractStatusChangeNotifier#setIgnoreChanges(String[])} + */ + @Test + public void testSetIgnoreChanges() { + // Arrange + LoggingNotifier loggingNotifier = new LoggingNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act + loggingNotifier.setIgnoreChanges(new String[] { "Ignore Changes" }); + + // Assert + assertArrayEquals(new String[] { "Ignore Changes" }, loggingNotifier.getIgnoreChanges()); + } + + /** + * Test {@link AbstractStatusChangeNotifier#getIgnoreChanges()}. + *

+ * Method under test: {@link AbstractStatusChangeNotifier#getIgnoreChanges()} + */ + @Test + public void testGetIgnoreChanges() { + // Arrange, Act and Assert + assertArrayEquals(new String[] { "UNKNOWN:UP" }, + new LoggingNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore())).getIgnoreChanges()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/CompositeNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/CompositeNotifierDiffblueTest.java new file mode 100644 index 00000000000..33ef27396d1 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/CompositeNotifierDiffblueTest.java @@ -0,0 +1,60 @@ +package de.codecentric.boot.admin.server.notify; + +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.util.ArrayList; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { CompositeNotifier.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class CompositeNotifierDiffblueTest { + + @Autowired + private CompositeNotifier compositeNotifier; + + @MockitoBean + private Iterable iterable; + + /** + * Test {@link CompositeNotifier#CompositeNotifier(Iterable)}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link CompositeNotifier#CompositeNotifier(Iterable)} + */ + @Test + public void testNewCompositeNotifier_whenArrayList() throws AssertionError { + // Arrange and Act + CompositeNotifier actualCompositeNotifier = new CompositeNotifier(new ArrayList<>()); + + // Assert + FirstStep createResult = StepVerifier + .create(actualCompositeNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link CompositeNotifier#notify(InstanceEvent)} with {@code InstanceEvent}. + *

+ * Method under test: {@link CompositeNotifier#notify(InstanceEvent)} + */ + @Test + public void testNotifyWithInstanceEvent() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(compositeNotifier.notify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectError().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/DingTalkNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/DingTalkNotifierDiffblueTest.java new file mode 100644 index 00000000000..8793f72acd1 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/DingTalkNotifierDiffblueTest.java @@ -0,0 +1,172 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.util.List; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { DingTalkNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class DingTalkNotifierDiffblueTest { + + @Autowired + private DingTalkNotifier dingTalkNotifier; + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test {@link DingTalkNotifier#DingTalkNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link DingTalkNotifier#DingTalkNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewDingTalkNotifier() { + // Arrange and Act + DingTalkNotifier actualDingTalkNotifier = new DingTalkNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals("#{instance.registration.name} #{instance.id} is #{event.statusInfo.status}", + actualDingTalkNotifier.getMessage()); + assertNull(actualDingTalkNotifier.getSecret()); + assertNull(actualDingTalkNotifier.getWebhookUrl()); + assertTrue(actualDingTalkNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualDingTalkNotifier.getIgnoreChanges()); + } + + /** + * Test {@link DingTalkNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link DingTalkNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(dingTalkNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link DingTalkNotifier#createMessage(InstanceEvent, Instance)}. + *

    + *
  • Then return Body size is two.
  • + *
+ *

+ * Method under test: {@link DingTalkNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage_thenReturnBodySizeIsTwo() { + // Arrange + DingTalkNotifier dingTalkNotifier = new DingTalkNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + dingTalkNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = dingTalkNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + Object body = ((HttpEntity) actualCreateMessageResult).getBody(); + assertEquals(2, ((Map) body).size()); + Object getResult = ((Map) body).get("text"); + assertTrue(getResult instanceof Map); + assertTrue(body instanceof Map); + assertTrue(actualCreateMessageResult instanceof HttpEntity); + assertEquals(1, ((Map) getResult).size()); + assertEquals("Not all who wander are lost", ((Map) getResult).get("content")); + HttpHeaders headers = ((HttpEntity) actualCreateMessageResult).getHeaders(); + assertEquals(1, headers.size()); + List getResult2 = headers.get(HttpHeaders.CONTENT_TYPE); + assertEquals(1, getResult2.size()); + assertEquals("application/json", getResult2.get(0)); + assertEquals("text", ((Map) body).get("msgtype")); + assertTrue(((HttpEntity) actualCreateMessageResult).hasBody()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link DingTalkNotifier#setRestTemplate(RestTemplate)} + *
  • {@link DingTalkNotifier#setSecret(String)} + *
  • {@link DingTalkNotifier#setWebhookUrl(String)} + *
  • {@link DingTalkNotifier#getSecret()} + *
  • {@link DingTalkNotifier#getWebhookUrl()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + DingTalkNotifier dingTalkNotifier = new DingTalkNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + dingTalkNotifier.setRestTemplate(mock(RestTemplate.class)); + dingTalkNotifier.setSecret("Secret"); + dingTalkNotifier.setWebhookUrl("https://example.org/example"); + String actualSecret = dingTalkNotifier.getSecret(); + + // Assert + assertEquals("Secret", actualSecret); + assertEquals("https://example.org/example", dingTalkNotifier.getWebhookUrl()); + } + + /** + * Test {@link DingTalkNotifier#getMessage()}. + *

+ * Method under test: {@link DingTalkNotifier#getMessage()} + */ + @Test + public void testGetMessage() { + // Arrange, Act and Assert + assertEquals("#{instance.registration.name} #{instance.id} is #{event.statusInfo.status}", + dingTalkNotifier.getMessage()); + } + + /** + * Test {@link DingTalkNotifier#setMessage(String)}. + *

+ * Method under test: {@link DingTalkNotifier#setMessage(String)} + */ + @Test + public void testSetMessage() { + // Arrange and Act + dingTalkNotifier.setMessage("Not all who wander are lost"); + + // Assert + assertEquals("Not all who wander are lost", dingTalkNotifier.getMessage()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/DiscordNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/DiscordNotifierDiffblueTest.java new file mode 100644 index 00000000000..fca355e0542 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/DiscordNotifierDiffblueTest.java @@ -0,0 +1,322 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import java.util.List; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { DiscordNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class DiscordNotifierDiffblueTest { + + @Autowired + private DiscordNotifier discordNotifier; + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test {@link DiscordNotifier#DiscordNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link DiscordNotifier#DiscordNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewDiscordNotifier() { + // Arrange and Act + DiscordNotifier actualDiscordNotifier = new DiscordNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualDiscordNotifier.getMessage()); + assertNull(actualDiscordNotifier.getAvatarUrl()); + assertNull(actualDiscordNotifier.getUsername()); + assertNull(actualDiscordNotifier.getWebhookUrl()); + assertFalse(actualDiscordNotifier.isTts()); + assertTrue(actualDiscordNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualDiscordNotifier.getIgnoreChanges()); + } + + /** + * Test {@link DiscordNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link DiscordNotifier} WebhookUrl is + * {@link PagerdutyNotifier#DEFAULT_URI}.
  • + *
+ *

+ * Method under test: {@link DiscordNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenDiscordNotifierWebhookUrlIsDefault_uri() throws AssertionError { + // Arrange + discordNotifier.setWebhookUrl(PagerdutyNotifier.DEFAULT_URI); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(discordNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link DiscordNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link DiscordNotifier} WebhookUrl is {@code null}.
  • + *
+ *

+ * Method under test: {@link DiscordNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenDiscordNotifierWebhookUrlIsNull() throws AssertionError { + // Arrange + discordNotifier.setWebhookUrl(null); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(discordNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link DiscordNotifier#createDiscordNotification(InstanceEvent, Instance)}. + *

    + *
  • Then return Body {@code avatar_url} is + * {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: + * {@link DiscordNotifier#createDiscordNotification(InstanceEvent, Instance)} + */ + @Test + public void testCreateDiscordNotification_thenReturnBodyAvatarUrlIsHttpsExampleOrgExample() { + // Arrange + DiscordNotifier discordNotifier = new DiscordNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + discordNotifier.setMessage("Not all who wander are lost"); + discordNotifier.setAvatarUrl("https://example.org/example"); + discordNotifier.setUsername(null); + + // Act + Object actualCreateDiscordNotificationResult = discordNotifier + .createDiscordNotification(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + Object body = ((HttpEntity) actualCreateDiscordNotificationResult).getBody(); + assertTrue(body instanceof Map); + assertTrue(actualCreateDiscordNotificationResult instanceof HttpEntity); + assertEquals(3, ((Map) body).size()); + assertEquals("Not all who wander are lost", ((Map) body).get("content")); + HttpHeaders headers = ((HttpEntity) actualCreateDiscordNotificationResult).getHeaders(); + assertEquals(2, headers.size()); + List getResult = headers.get(HttpHeaders.USER_AGENT); + assertEquals(1, getResult.size()); + assertEquals("RestTemplate", getResult.get(0)); + List getResult2 = headers.get(HttpHeaders.CONTENT_TYPE); + assertEquals(1, getResult2.size()); + assertEquals("application/json", getResult2.get(0)); + assertEquals("https://example.org/example", ((Map) body).get("avatar_url")); + assertFalse((Boolean) ((Map) body).get("tts")); + assertTrue(((HttpEntity) actualCreateDiscordNotificationResult).hasBody()); + } + + /** + * Test {@link DiscordNotifier#createDiscordNotification(InstanceEvent, Instance)}. + *
    + *
  • Then return Body size is two.
  • + *
+ *

+ * Method under test: + * {@link DiscordNotifier#createDiscordNotification(InstanceEvent, Instance)} + */ + @Test + public void testCreateDiscordNotification_thenReturnBodySizeIsTwo() { + // Arrange + DiscordNotifier discordNotifier = new DiscordNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + discordNotifier.setMessage("Not all who wander are lost"); + discordNotifier.setAvatarUrl(null); + discordNotifier.setUsername(null); + + // Act + Object actualCreateDiscordNotificationResult = discordNotifier + .createDiscordNotification(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + Object body = ((HttpEntity) actualCreateDiscordNotificationResult).getBody(); + assertTrue(body instanceof Map); + assertTrue(actualCreateDiscordNotificationResult instanceof HttpEntity); + assertEquals(2, ((Map) body).size()); + assertEquals("Not all who wander are lost", ((Map) body).get("content")); + HttpHeaders headers = ((HttpEntity) actualCreateDiscordNotificationResult).getHeaders(); + assertEquals(2, headers.size()); + List getResult = headers.get(HttpHeaders.USER_AGENT); + assertEquals(1, getResult.size()); + assertEquals("RestTemplate", getResult.get(0)); + List getResult2 = headers.get(HttpHeaders.CONTENT_TYPE); + assertEquals(1, getResult2.size()); + assertEquals("application/json", getResult2.get(0)); + assertFalse((Boolean) ((Map) body).get("tts")); + assertTrue(((HttpEntity) actualCreateDiscordNotificationResult).hasBody()); + } + + /** + * Test {@link DiscordNotifier#createDiscordNotification(InstanceEvent, Instance)}. + *
    + *
  • Then return Body {@code username} is {@code janedoe}.
  • + *
+ *

+ * Method under test: + * {@link DiscordNotifier#createDiscordNotification(InstanceEvent, Instance)} + */ + @Test + public void testCreateDiscordNotification_thenReturnBodyUsernameIsJanedoe() { + // Arrange + DiscordNotifier discordNotifier = new DiscordNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + discordNotifier.setMessage("Not all who wander are lost"); + discordNotifier.setAvatarUrl(null); + discordNotifier.setUsername("janedoe"); + + // Act + Object actualCreateDiscordNotificationResult = discordNotifier + .createDiscordNotification(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + Object body = ((HttpEntity) actualCreateDiscordNotificationResult).getBody(); + assertTrue(body instanceof Map); + assertTrue(actualCreateDiscordNotificationResult instanceof HttpEntity); + assertEquals(3, ((Map) body).size()); + assertEquals("Not all who wander are lost", ((Map) body).get("content")); + HttpHeaders headers = ((HttpEntity) actualCreateDiscordNotificationResult).getHeaders(); + assertEquals(2, headers.size()); + List getResult = headers.get(HttpHeaders.USER_AGENT); + assertEquals(1, getResult.size()); + assertEquals("RestTemplate", getResult.get(0)); + List getResult2 = headers.get(HttpHeaders.CONTENT_TYPE); + assertEquals(1, getResult2.size()); + assertEquals("application/json", getResult2.get(0)); + assertEquals("janedoe", ((Map) body).get("username")); + assertFalse((Boolean) ((Map) body).get("tts")); + assertTrue(((HttpEntity) actualCreateDiscordNotificationResult).hasBody()); + } + + /** + * Test {@link DiscordNotifier#createContent(InstanceEvent, Instance)}. + *
    + *
  • Then return {@code Not all who wander are lost}.
  • + *
+ *

+ * Method under test: {@link DiscordNotifier#createContent(InstanceEvent, Instance)} + */ + @Test + public void testCreateContent_thenReturnNotAllWhoWanderAreLost() { + // Arrange + DiscordNotifier discordNotifier = new DiscordNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + discordNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + discordNotifier.createContent(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link DiscordNotifier#setAvatarUrl(String)} + *
  • {@link DiscordNotifier#setRestTemplate(RestTemplate)} + *
  • {@link DiscordNotifier#setTts(boolean)} + *
  • {@link DiscordNotifier#setUsername(String)} + *
  • {@link DiscordNotifier#setWebhookUrl(URI)} + *
  • {@link DiscordNotifier#getAvatarUrl()} + *
  • {@link DiscordNotifier#getUsername()} + *
  • {@link DiscordNotifier#getWebhookUrl()} + *
  • {@link DiscordNotifier#isTts()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + DiscordNotifier discordNotifier = new DiscordNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + discordNotifier.setAvatarUrl("https://example.org/example"); + discordNotifier.setRestTemplate(mock(RestTemplate.class)); + discordNotifier.setTts(true); + discordNotifier.setUsername("janedoe"); + URI webhookUrl = PagerdutyNotifier.DEFAULT_URI; + discordNotifier.setWebhookUrl(webhookUrl); + String actualAvatarUrl = discordNotifier.getAvatarUrl(); + String actualUsername = discordNotifier.getUsername(); + URI actualWebhookUrl = discordNotifier.getWebhookUrl(); + boolean actualIsTtsResult = discordNotifier.isTts(); + + // Assert + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualWebhookUrl.toString()); + assertEquals("https://example.org/example", actualAvatarUrl); + assertEquals("janedoe", actualUsername); + assertTrue(actualIsTtsResult); + assertSame(webhookUrl, actualWebhookUrl); + } + + /** + * Test {@link DiscordNotifier#getMessage()}. + *

+ * Method under test: {@link DiscordNotifier#getMessage()} + */ + @Test + public void testGetMessage() { + // Arrange, Act and Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + discordNotifier.getMessage()); + } + + /** + * Test {@link DiscordNotifier#setMessage(String)}. + *

+ * Method under test: {@link DiscordNotifier#setMessage(String)} + */ + @Test + public void testSetMessage() { + // Arrange and Act + discordNotifier.setMessage("Not all who wander are lost"); + + // Assert + assertEquals("Not all who wander are lost", discordNotifier.getMessage()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/FeiShuNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/FeiShuNotifierDiffblueTest.java new file mode 100644 index 00000000000..d56acd7393d --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/FeiShuNotifierDiffblueTest.java @@ -0,0 +1,218 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.notify.FeiShuNotifier.Card; +import de.codecentric.boot.admin.server.notify.FeiShuNotifier.MessageType; +import java.net.URI; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { FeiShuNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class FeiShuNotifierDiffblueTest { + + @Autowired + private FeiShuNotifier feiShuNotifier; + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test Card getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link Card#Card(FeiShuNotifier)} + *
  • {@link Card#setThemeColor(String)} + *
  • {@link Card#setTitle(String)} + *
  • {@link Card#getThemeColor()} + *
  • {@link Card#getTitle()} + *
+ */ + @Test + public void testCardGettersAndSetters() { + // Arrange and Act + Card actualCard = new FeiShuNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)).new Card(); + actualCard.setThemeColor("Theme Color"); + actualCard.setTitle("Dr"); + String actualThemeColor = actualCard.getThemeColor(); + + // Assert + assertEquals("Dr", actualCard.getTitle()); + assertEquals("Theme Color", actualThemeColor); + } + + /** + * Test {@link FeiShuNotifier#FeiShuNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link FeiShuNotifier#FeiShuNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewFeiShuNotifier() { + // Arrange and Act + FeiShuNotifier actualFeiShuNotifier = new FeiShuNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + Card card = actualFeiShuNotifier.getCard(); + assertEquals("Codecentric's Spring Boot Admin notice", card.getTitle()); + assertEquals( + "ServiceName: #{instance.registration.name}(#{instance.id}) \n" + + "ServiceUrl: #{instance.registration.serviceUrl} \n" + + "Status: changed status from [#{lastStatus}] to [#{event.statusInfo.status}]", + actualFeiShuNotifier.getMessage()); + assertEquals("red", card.getThemeColor()); + assertNull(actualFeiShuNotifier.getSecret()); + assertNull(actualFeiShuNotifier.getWebhookUrl()); + assertEquals(MessageType.interactive, actualFeiShuNotifier.getMessageType()); + assertTrue(actualFeiShuNotifier.isEnabled()); + assertTrue(actualFeiShuNotifier.isAtAll()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualFeiShuNotifier.getIgnoreChanges()); + } + + /** + * Test {@link FeiShuNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link FeiShuNotifier} WebhookUrl is + * {@link PagerdutyNotifier#DEFAULT_URI}.
  • + *
+ *

+ * Method under test: {@link FeiShuNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenFeiShuNotifierWebhookUrlIsDefault_uri() throws AssertionError { + // Arrange + feiShuNotifier.setWebhookUrl(PagerdutyNotifier.DEFAULT_URI); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(feiShuNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link FeiShuNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link FeiShuNotifier} WebhookUrl is {@code null}.
  • + *
+ *

+ * Method under test: {@link FeiShuNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenFeiShuNotifierWebhookUrlIsNull() throws AssertionError { + // Arrange + feiShuNotifier.setWebhookUrl(null); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(feiShuNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link FeiShuNotifier#getMessage()}. + *

+ * Method under test: {@link FeiShuNotifier#getMessage()} + */ + @Test + public void testGetMessage() { + // Arrange, Act and Assert + assertEquals( + "ServiceName: #{instance.registration.name}(#{instance.id}) \n" + + "ServiceUrl: #{instance.registration.serviceUrl} \n" + + "Status: changed status from [#{lastStatus}] to [#{event.statusInfo.status}]", + feiShuNotifier.getMessage()); + } + + /** + * Test {@link FeiShuNotifier#setMessage(String)}. + *

+ * Method under test: {@link FeiShuNotifier#setMessage(String)} + */ + @Test + public void testSetMessage() { + // Arrange and Act + feiShuNotifier.setMessage("Not all who wander are lost"); + + // Assert + assertEquals("Not all who wander are lost", feiShuNotifier.getMessage()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link FeiShuNotifier#setAtAll(boolean)} + *
  • {@link FeiShuNotifier#setCard(Card)} + *
  • {@link FeiShuNotifier#setMessageType(MessageType)} + *
  • {@link FeiShuNotifier#setRestTemplate(RestTemplate)} + *
  • {@link FeiShuNotifier#setSecret(String)} + *
  • {@link FeiShuNotifier#setWebhookUrl(URI)} + *
  • {@link FeiShuNotifier#getCard()} + *
  • {@link FeiShuNotifier#getMessageType()} + *
  • {@link FeiShuNotifier#getSecret()} + *
  • {@link FeiShuNotifier#getWebhookUrl()} + *
  • {@link FeiShuNotifier#isAtAll()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + FeiShuNotifier feiShuNotifier = new FeiShuNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + feiShuNotifier.setAtAll(true); + Card card = new FeiShuNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)).new Card(); + feiShuNotifier.setCard(card); + feiShuNotifier.setMessageType(MessageType.text); + feiShuNotifier.setRestTemplate(mock(RestTemplate.class)); + feiShuNotifier.setSecret("Secret"); + URI webhookUrl = PagerdutyNotifier.DEFAULT_URI; + feiShuNotifier.setWebhookUrl(webhookUrl); + Card actualCard = feiShuNotifier.getCard(); + MessageType actualMessageType = feiShuNotifier.getMessageType(); + String actualSecret = feiShuNotifier.getSecret(); + URI actualWebhookUrl = feiShuNotifier.getWebhookUrl(); + boolean actualIsAtAllResult = feiShuNotifier.isAtAll(); + + // Assert + assertEquals("Secret", actualSecret); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualWebhookUrl.toString()); + assertEquals(MessageType.text, actualMessageType); + assertTrue(actualIsAtAllResult); + assertSame(card, actualCard); + assertSame(webhookUrl, actualWebhookUrl); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HazelcastNotificationTriggerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HazelcastNotificationTriggerDiffblueTest.java new file mode 100644 index 00000000000..8c3ee912255 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HazelcastNotificationTriggerDiffblueTest.java @@ -0,0 +1,183 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertSame; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.util.ArrayList; +import java.util.concurrent.ConcurrentMap; +import java.util.function.Consumer; +import java.util.function.Function; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@RunWith(MockitoJUnitRunner.class) +public class HazelcastNotificationTriggerDiffblueTest { + + @Mock + private ConcurrentMap concurrentMap; + + @InjectMocks + private HazelcastNotificationTrigger hazelcastNotificationTrigger; + + @Mock + private Notifier notifier; + + /** + * Test {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)}. + *

+ * Method under test: + * {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications() { + // Arrange + Mono mono = mock(Mono.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + when(mono.doOnError(Mockito.>any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + when(notifier.notify(Mockito.any())).thenReturn(mono); + when(concurrentMap.replace(Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + when(concurrentMap.getOrDefault(Mockito.any(), Mockito.any())).thenReturn(0L); + + // Act + hazelcastNotificationTrigger.sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(notifier).notify(isA(InstanceEvent.class)); + verify(concurrentMap).getOrDefault(isA(Object.class), eq(-1L)); + verify(concurrentMap).replace(isA(InstanceId.class), eq(0L), eq(1L)); + verify(mono).doOnError(isA(Consumer.class)); + } + + /** + * Test {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)}. + *

+ * Method under test: + * {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications2() { + // Arrange + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator2 = new ChannelSendOperator<>(source, mock(Function.class)); + + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(channelSendOperator2); + Mono mono = mock(Mono.class); + when(mono.doOnError(Mockito.>any())).thenReturn(channelSendOperator); + when(notifier.notify(Mockito.any())).thenReturn(mono); + when(concurrentMap.replace(Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + when(concurrentMap.getOrDefault(Mockito.any(), Mockito.any())).thenReturn(0L); + + // Act + Mono actualSendNotificationsResult = hazelcastNotificationTrigger + .sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(notifier).notify(isA(InstanceEvent.class)); + verify(concurrentMap).getOrDefault(isA(Object.class), eq(-1L)); + verify(concurrentMap).replace(isA(InstanceId.class), eq(0L), eq(1L)); + verify(mono).doOnError(isA(Consumer.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + assertSame(channelSendOperator2, actualSendNotificationsResult); + } + + /** + * Test {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)}. + *
    + *
  • Given {@link ConcurrentMap} {@link ConcurrentMap#getOrDefault(Object, Object)} + * return one.
  • + *
+ *

+ * Method under test: + * {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications_givenConcurrentMapGetOrDefaultReturnOne() throws AssertionError { + // Arrange + when(concurrentMap.getOrDefault(Mockito.any(), Mockito.any())).thenReturn(1L); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + hazelcastNotificationTrigger.sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + verify(concurrentMap).getOrDefault(isA(Object.class), eq(-1L)); + } + + /** + * Test {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)}. + *
    + *
  • Then calls {@link ConcurrentMap#putIfAbsent(Object, Object)}.
  • + *
+ *

+ * Method under test: + * {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications_thenCallsPutIfAbsent() { + // Arrange + Flux source = Flux.fromIterable(new ArrayList<>()); + when(notifier.notify(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + when(concurrentMap.putIfAbsent(Mockito.any(), Mockito.any())).thenReturn(null); + when(concurrentMap.getOrDefault(Mockito.any(), Mockito.any())).thenReturn(-1L); + + // Act + hazelcastNotificationTrigger.sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(notifier).notify(isA(InstanceEvent.class)); + verify(concurrentMap).getOrDefault(isA(Object.class), eq(-1L)); + verify(concurrentMap).putIfAbsent(isA(InstanceId.class), eq(1L)); + } + + /** + * Test {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)}. + *
    + *
  • Then calls {@link ConcurrentMap#replace(Object, Object, Object)}.
  • + *
+ *

+ * Method under test: + * {@link HazelcastNotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications_thenCallsReplace() { + // Arrange + Flux source = Flux.fromIterable(new ArrayList<>()); + when(notifier.notify(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + when(concurrentMap.replace(Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + when(concurrentMap.getOrDefault(Mockito.any(), Mockito.any())).thenReturn(0L); + + // Act + hazelcastNotificationTrigger.sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(notifier).notify(isA(InstanceEvent.class)); + verify(concurrentMap).getOrDefault(isA(Object.class), eq(-1L)); + verify(concurrentMap).replace(isA(InstanceId.class), eq(0L), eq(1L)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HipchatNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HipchatNotifierDiffblueTest.java new file mode 100644 index 00000000000..3c7c371b97a --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HipchatNotifierDiffblueTest.java @@ -0,0 +1,252 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { HipchatNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class HipchatNotifierDiffblueTest { + + @Autowired + private HipchatNotifier hipchatNotifier; + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test {@link HipchatNotifier#HipchatNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link HipchatNotifier#HipchatNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewHipchatNotifier() { + // Arrange and Act + HipchatNotifier actualHipchatNotifier = new HipchatNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals( + "#{instance.registration.name}/#{instance.id} is #{event.statusInfo.status" + + "}", + actualHipchatNotifier.getDescription()); + assertNull(actualHipchatNotifier.getAuthToken()); + assertNull(actualHipchatNotifier.getRoomId()); + assertNull(actualHipchatNotifier.getUrl()); + assertFalse(actualHipchatNotifier.getNotify()); + assertFalse(actualHipchatNotifier.isNotify()); + assertTrue(actualHipchatNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualHipchatNotifier.getIgnoreChanges()); + } + + /** + * Test {@link HipchatNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link HipchatNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(hipchatNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link HipchatNotifier#buildUrl()}. + *

    + *
  • Given {@link HipchatNotifier} Url is + * {@link PagerdutyNotifier#DEFAULT_URI}.
  • + *
  • Then return a string.
  • + *
+ *

+ * Method under test: {@link HipchatNotifier#buildUrl()} + */ + @Test + public void testBuildUrl_givenHipchatNotifierUrlIsDefault_uri_thenReturnAString() { + // Arrange + hipchatNotifier.setUrl(PagerdutyNotifier.DEFAULT_URI); + + // Act and Assert + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json/room/null/notification?auth" + + "_token=null", hipchatNotifier.buildUrl()); + } + + /** + * Test {@link HipchatNotifier#buildUrl()}. + *

    + *
  • Given {@link HipchatNotifier}.
  • + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link HipchatNotifier#buildUrl()} + */ + @Test + public void testBuildUrl_givenHipchatNotifier_thenThrowIllegalStateException() { + // Arrange, Act and Assert + assertThrows(IllegalStateException.class, () -> hipchatNotifier.buildUrl()); + } + + /** + * Test {@link HipchatNotifier#getMessage(InstanceEvent, Instance)}. + *

    + *
  • Then return {@code The characteristics of someone or something}.
  • + *
+ *

+ * Method under test: {@link HipchatNotifier#getMessage(InstanceEvent, Instance)} + */ + @Test + public void testGetMessage_thenReturnTheCharacteristicsOfSomeoneOrSomething() { + // Arrange + HipchatNotifier hipchatNotifier = new HipchatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + hipchatNotifier.setDescription("The characteristics of someone or something"); + + // Act and Assert + assertEquals("The characteristics of someone or something", + hipchatNotifier.getMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link HipchatNotifier#getColor(InstanceEvent)}. + *

    + *
  • Given {@link IllegalStateException#IllegalStateException(String)} with + * {@code UP}.
  • + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link HipchatNotifier#getColor(InstanceEvent)} + */ + @Test + public void testGetColor_givenIllegalStateExceptionWithUp_thenThrowIllegalStateException() { + // Arrange + InstanceStatusChangedEvent event = mock(InstanceStatusChangedEvent.class); + when(event.getStatusInfo()).thenThrow(new IllegalStateException("UP")); + + // Act and Assert + assertThrows(IllegalStateException.class, () -> hipchatNotifier.getColor(event)); + verify(event).getStatusInfo(); + } + + /** + * Test {@link HipchatNotifier#getColor(InstanceEvent)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
  • Then return {@code gray}.
  • + *
+ *

+ * Method under test: {@link HipchatNotifier#getColor(InstanceEvent)} + */ + @Test + public void testGetColor_whenInstanceIdWithValueIs42_thenReturnGray() { + // Arrange, Act and Assert + assertEquals("gray", hipchatNotifier.getColor(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link HipchatNotifier#setAuthToken(String)} + *
  • {@link HipchatNotifier#setNotify(boolean)} + *
  • {@link HipchatNotifier#setRestTemplate(RestTemplate)} + *
  • {@link HipchatNotifier#setRoomId(String)} + *
  • {@link HipchatNotifier#setUrl(URI)} + *
  • {@link HipchatNotifier#getAuthToken()} + *
  • {@link HipchatNotifier#getNotify()} + *
  • {@link HipchatNotifier#getRoomId()} + *
  • {@link HipchatNotifier#getUrl()} + *
  • {@link HipchatNotifier#isNotify()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + HipchatNotifier hipchatNotifier = new HipchatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + hipchatNotifier.setAuthToken("ABC123"); + hipchatNotifier.setNotify(true); + hipchatNotifier.setRestTemplate(mock(RestTemplate.class)); + hipchatNotifier.setRoomId("42"); + URI url = PagerdutyNotifier.DEFAULT_URI; + hipchatNotifier.setUrl(url); + String actualAuthToken = hipchatNotifier.getAuthToken(); + boolean actualNotify = hipchatNotifier.getNotify(); + String actualRoomId = hipchatNotifier.getRoomId(); + URI actualUrl = hipchatNotifier.getUrl(); + boolean actualIsNotifyResult = hipchatNotifier.isNotify(); + + // Assert + assertEquals("42", actualRoomId); + assertEquals("ABC123", actualAuthToken); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualUrl.toString()); + assertTrue(actualNotify); + assertTrue(actualIsNotifyResult); + assertSame(url, actualUrl); + } + + /** + * Test {@link HipchatNotifier#getDescription()}. + *

+ * Method under test: {@link HipchatNotifier#getDescription()} + */ + @Test + public void testGetDescription() { + // Arrange, Act and Assert + assertEquals( + "#{instance.registration.name}/#{instance.id} is #{event.statusInfo.status" + + "}", + hipchatNotifier.getDescription()); + } + + /** + * Test {@link HipchatNotifier#setDescription(String)}. + *

+ * Method under test: {@link HipchatNotifier#setDescription(String)} + */ + @Test + public void testSetDescription() { + // Arrange and Act + hipchatNotifier.setDescription("The characteristics of someone or something"); + + // Assert + assertEquals("The characteristics of someone or something", hipchatNotifier.getDescription()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/LetsChatNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/LetsChatNotifierDiffblueTest.java new file mode 100644 index 00000000000..852f533fbc0 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/LetsChatNotifierDiffblueTest.java @@ -0,0 +1,194 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { LetsChatNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class LetsChatNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @Autowired + private LetsChatNotifier letsChatNotifier; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test {@link LetsChatNotifier#LetsChatNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link LetsChatNotifier#LetsChatNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewLetsChatNotifier() { + // Arrange and Act + LetsChatNotifier actualLetsChatNotifier = new LetsChatNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualLetsChatNotifier.getMessage()); + assertEquals("Spring Boot Admin", actualLetsChatNotifier.getUsername()); + assertNull(actualLetsChatNotifier.getRoom()); + assertNull(actualLetsChatNotifier.getToken()); + assertNull(actualLetsChatNotifier.getUrl()); + assertTrue(actualLetsChatNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualLetsChatNotifier.getIgnoreChanges()); + } + + /** + * Test {@link LetsChatNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link LetsChatNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(letsChatNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LetsChatNotifier#createMessage(InstanceEvent, Instance)}. + *

    + *
  • Then return {@link Map}.
  • + *
+ *

+ * Method under test: {@link LetsChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage_thenReturnMap() { + // Arrange + LetsChatNotifier letsChatNotifier = new LetsChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + letsChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = letsChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + assertEquals("Not all who wander are lost", ((Map) actualCreateMessageResult).get("text")); + } + + /** + * Test {@link LetsChatNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Then return {@code Not all who wander are lost}.
  • + *
+ *

+ * Method under test: {@link LetsChatNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_thenReturnNotAllWhoWanderAreLost() { + // Arrange + LetsChatNotifier letsChatNotifier = new LetsChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + letsChatNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + letsChatNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link LetsChatNotifier#setRestTemplate(RestTemplate)} + *
  • {@link LetsChatNotifier#setRoom(String)} + *
  • {@link LetsChatNotifier#setToken(String)} + *
  • {@link LetsChatNotifier#setUrl(URI)} + *
  • {@link LetsChatNotifier#setUsername(String)} + *
  • {@link LetsChatNotifier#getRoom()} + *
  • {@link LetsChatNotifier#getToken()} + *
  • {@link LetsChatNotifier#getUrl()} + *
  • {@link LetsChatNotifier#getUsername()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + LetsChatNotifier letsChatNotifier = new LetsChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + letsChatNotifier.setRestTemplate(mock(RestTemplate.class)); + letsChatNotifier.setRoom("Room"); + letsChatNotifier.setToken("ABC123"); + URI url = PagerdutyNotifier.DEFAULT_URI; + letsChatNotifier.setUrl(url); + letsChatNotifier.setUsername("janedoe"); + String actualRoom = letsChatNotifier.getRoom(); + String actualToken = letsChatNotifier.getToken(); + URI actualUrl = letsChatNotifier.getUrl(); + String actualUsername = letsChatNotifier.getUsername(); + + // Assert + assertEquals("ABC123", actualToken); + assertEquals("Room", actualRoom); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualUrl.toString()); + assertEquals("janedoe", actualUsername); + assertSame(url, actualUrl); + } + + /** + * Test {@link LetsChatNotifier#getMessage()}. + *

+ * Method under test: {@link LetsChatNotifier#getMessage()} + */ + @Test + public void testGetMessage() { + // Arrange, Act and Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + letsChatNotifier.getMessage()); + } + + /** + * Test {@link LetsChatNotifier#setMessage(String)}. + *

+ * Method under test: {@link LetsChatNotifier#setMessage(String)} + */ + @Test + public void testSetMessage() { + // Arrange and Act + letsChatNotifier.setMessage("Not all who wander are lost"); + + // Assert + assertEquals("Not all who wander are lost", letsChatNotifier.getMessage()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/LoggingNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/LoggingNotifierDiffblueTest.java new file mode 100644 index 00000000000..2804fabb0d4 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/LoggingNotifierDiffblueTest.java @@ -0,0 +1,51 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertTrue; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import org.junit.Test; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class LoggingNotifierDiffblueTest { + + /** + * Test {@link LoggingNotifier#LoggingNotifier(InstanceRepository)}. + *

+ * Method under test: {@link LoggingNotifier#LoggingNotifier(InstanceRepository)} + */ + @Test + public void testNewLoggingNotifier() { + // Arrange and Act + LoggingNotifier actualLoggingNotifier = new LoggingNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Assert + assertTrue(actualLoggingNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualLoggingNotifier.getIgnoreChanges()); + } + + /** + * Test {@link LoggingNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link LoggingNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange + LoggingNotifier loggingNotifier = new LoggingNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(loggingNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/MailNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/MailNotifierDiffblueTest.java new file mode 100644 index 00000000000..164aa468771 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/MailNotifierDiffblueTest.java @@ -0,0 +1,274 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.JavaMailSenderImpl; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.thymeleaf.TemplateEngine; +import org.thymeleaf.context.Context; +import org.thymeleaf.context.IContext; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { MailNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class MailNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private JavaMailSender javaMailSender; + + @Autowired + private MailNotifier mailNotifier; + + @MockitoBean + private TemplateEngine templateEngine; + + /** + * Test + * {@link MailNotifier#MailNotifier(JavaMailSender, InstanceRepository, TemplateEngine)}. + *

+ * Method under test: + * {@link MailNotifier#MailNotifier(JavaMailSender, InstanceRepository, TemplateEngine)} + */ + @Test + public void testNewMailNotifier() { + // Arrange and Act + MailNotifier actualMailNotifier = new MailNotifier(javaMailSender, instanceRepository, templateEngine); + + // Assert + assertEquals("META-INF/spring-boot-admin-server/mail/status-changed.html", actualMailNotifier.getTemplate()); + assertEquals("Spring Boot Admin ", actualMailNotifier.getFrom()); + assertNull(actualMailNotifier.getBaseUrl()); + assertEquals(0, actualMailNotifier.getCc().length); + assertTrue(actualMailNotifier.isEnabled()); + assertTrue(actualMailNotifier.getAdditionalProperties().isEmpty()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualMailNotifier.getIgnoreChanges()); + assertArrayEquals(new String[] { "root@localhost" }, actualMailNotifier.getTo()); + } + + /** + * Test {@link MailNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link MailNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(mailNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link MailNotifier#getBody(Context)}. + *

    + *
  • Given {@link TemplateEngine} {@link TemplateEngine#process(String, IContext)} + * return {@code Process}.
  • + *
  • Then return {@code Process}.
  • + *
+ *

+ * Method under test: {@link MailNotifier#getBody(Context)} + */ + @Test + public void testGetBody_givenTemplateEngineProcessReturnProcess_thenReturnProcess() { + // Arrange + when(templateEngine.process(Mockito.any(), Mockito.any())).thenReturn("Process"); + + // Act + String actualBody = mailNotifier.getBody(new Context()); + + // Assert + verify(templateEngine).process(eq("META-INF/spring-boot-admin-server/mail/status-changed.html"), + isA(IContext.class)); + assertEquals("Process", actualBody); + } + + /** + * Test {@link MailNotifier#getBody(Context)}. + *

    + *
  • Then throw {@link RuntimeException}.
  • + *
+ *

+ * Method under test: {@link MailNotifier#getBody(Context)} + */ + @Test + public void testGetBody_thenThrowRuntimeException() { + // Arrange + when(templateEngine.process(Mockito.any(), Mockito.any())) + .thenThrow(new RuntimeException("foo")); + + // Act and Assert + assertThrows(RuntimeException.class, () -> mailNotifier.getBody(new Context())); + verify(templateEngine).process(eq("META-INF/spring-boot-admin-server/mail/status-changed.html"), + isA(IContext.class)); + } + + /** + * Test {@link MailNotifier#getSubject(Context)}. + *

    + *
  • Given {@link TemplateEngine} + * {@link TemplateEngine#process(String, Set, IContext)} return {@code Process}.
  • + *
  • Then return {@code Process}.
  • + *
+ *

+ * Method under test: {@link MailNotifier#getSubject(Context)} + */ + @Test + public void testGetSubject_givenTemplateEngineProcessReturnProcess_thenReturnProcess() { + // Arrange + when(templateEngine.process(Mockito.any(), Mockito.>any(), Mockito.any())) + .thenReturn("Process"); + + // Act + String actualSubject = mailNotifier.getSubject(new Context()); + + // Assert + verify(templateEngine).process(eq("META-INF/spring-boot-admin-server/mail/status-changed.html"), isA(Set.class), + isA(IContext.class)); + assertEquals("Process", actualSubject); + } + + /** + * Test {@link MailNotifier#getSubject(Context)}. + *

    + *
  • Then throw {@link RuntimeException}.
  • + *
+ *

+ * Method under test: {@link MailNotifier#getSubject(Context)} + */ + @Test + public void testGetSubject_thenThrowRuntimeException() { + // Arrange + when(templateEngine.process(Mockito.any(), Mockito.>any(), Mockito.any())) + .thenThrow(new RuntimeException("subject")); + + // Act and Assert + assertThrows(RuntimeException.class, () -> mailNotifier.getSubject(new Context())); + verify(templateEngine).process(eq("META-INF/spring-boot-admin-server/mail/status-changed.html"), isA(Set.class), + isA(IContext.class)); + } + + /** + * Test {@link MailNotifier#getTo()}. + *

+ * Method under test: {@link MailNotifier#getTo()} + */ + @Test + public void testGetTo() { + // Arrange, Act and Assert + assertArrayEquals(new String[] { "root@localhost" }, mailNotifier.getTo()); + } + + /** + * Test {@link MailNotifier#setTo(String[])}. + *

+ * Method under test: {@link MailNotifier#setTo(String[])} + */ + @Test + public void testSetTo() { + // Arrange and Act + mailNotifier.setTo(new String[] { "alice.liddell@example.org" }); + + // Assert + assertArrayEquals(new String[] { "alice.liddell@example.org" }, mailNotifier.getTo()); + } + + /** + * Test {@link MailNotifier#getCc()}. + *

+ * Method under test: {@link MailNotifier#getCc()} + */ + @Test + public void testGetCc() { + // Arrange, Act and Assert + assertEquals(0, mailNotifier.getCc().length); + } + + /** + * Test {@link MailNotifier#setCc(String[])}. + *

+ * Method under test: {@link MailNotifier#setCc(String[])} + */ + @Test + public void testSetCc() { + // Arrange and Act + mailNotifier.setCc(new String[] { "ada.lovelace@example.org" }); + + // Assert + assertArrayEquals(new String[] { "ada.lovelace@example.org" }, mailNotifier.getCc()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link MailNotifier#setAdditionalProperties(Map)} + *
  • {@link MailNotifier#setBaseUrl(String)} + *
  • {@link MailNotifier#setFrom(String)} + *
  • {@link MailNotifier#setTemplate(String)} + *
  • {@link MailNotifier#getAdditionalProperties()} + *
  • {@link MailNotifier#getBaseUrl()} + *
  • {@link MailNotifier#getFrom()} + *
  • {@link MailNotifier#getTemplate()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + MailNotifier mailNotifier = new MailNotifier(mailSender, repository, new TemplateEngine()); + HashMap additionalProperties = new HashMap<>(); + + // Act + mailNotifier.setAdditionalProperties(additionalProperties); + mailNotifier.setBaseUrl("https://example.org/example"); + mailNotifier.setFrom("jane.doe@example.org"); + mailNotifier.setTemplate("Template"); + Map actualAdditionalProperties = mailNotifier.getAdditionalProperties(); + String actualBaseUrl = mailNotifier.getBaseUrl(); + String actualFrom = mailNotifier.getFrom(); + + // Assert + assertEquals("Template", mailNotifier.getTemplate()); + assertEquals("https://example.org/example", actualBaseUrl); + assertEquals("jane.doe@example.org", actualFrom); + assertTrue(actualAdditionalProperties.isEmpty()); + assertSame(additionalProperties, actualAdditionalProperties); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifierDiffblueTest.java new file mode 100644 index 00000000000..7d9c73b1f72 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifierDiffblueTest.java @@ -0,0 +1,352 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceRegisteredEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import java.util.List; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.expression.MapAccessor; +import org.springframework.expression.ConstructorResolver; +import org.springframework.expression.EvaluationContext; +import org.springframework.expression.Expression; +import org.springframework.expression.PropertyAccessor; +import org.springframework.expression.common.LiteralExpression; +import org.springframework.expression.spel.support.DataBindingPropertyAccessor; +import org.springframework.expression.spel.support.SimpleEvaluationContext; +import org.springframework.expression.spel.support.StandardEvaluationContext; +import org.springframework.expression.spel.support.StandardOperatorOverloader; +import org.springframework.expression.spel.support.StandardTypeComparator; +import org.springframework.expression.spel.support.StandardTypeConverter; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; + +@ContextConfiguration(classes = { MicrosoftTeamsNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class MicrosoftTeamsNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @Autowired + private MicrosoftTeamsNotifier microsoftTeamsNotifier; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test + * {@link MicrosoftTeamsNotifier#MicrosoftTeamsNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#MicrosoftTeamsNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewMicrosoftTeamsNotifier() { + // Arrange and Act + MicrosoftTeamsNotifier actualMicrosoftTeamsNotifier = new MicrosoftTeamsNotifier(instanceRepository, + mock(RestTemplate.class)); + + // Assert + assertEquals("#{instance.registration.name} with id #{instance.id} changed status from #{lastStatus} to #{event" + + ".statusInfo.status}", actualMicrosoftTeamsNotifier.getStatusActivitySubtitle()); + assertEquals("#{instance.registration.name} with id #{instance.id} has de-registered from Spring Boot Admin", + actualMicrosoftTeamsNotifier.getDeregisterActivitySubtitle()); + assertEquals("#{instance.registration.name} with id #{instance.id} has registered with Spring Boot Admin", + actualMicrosoftTeamsNotifier.getRegisterActivitySubtitle()); + assertEquals("De-Registered", actualMicrosoftTeamsNotifier.getDeRegisteredTitle()); + assertEquals("Registered", actualMicrosoftTeamsNotifier.getRegisteredTitle()); + assertEquals("Spring Boot Admin Notification", actualMicrosoftTeamsNotifier.getMessageSummary()); + assertEquals("Status Changed", actualMicrosoftTeamsNotifier.getStatusChangedTitle()); + assertEquals( + "event.type == 'STATUS_CHANGED' ? (event.statusInfo.status=='UP' ? '6db33f' : 'b32d36') : '439fe0'", + actualMicrosoftTeamsNotifier.getThemeColor()); + assertNull(actualMicrosoftTeamsNotifier.getWebhookUrl()); + assertTrue(actualMicrosoftTeamsNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualMicrosoftTeamsNotifier.getIgnoreChanges()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#shouldNotify(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#shouldNotify(InstanceEvent, Instance)} + */ + @Test + public void testShouldNotify() { + // Arrange + InstanceId instance = InstanceId.of("42"); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + assertTrue(microsoftTeamsNotifier.shouldNotify(new InstanceRegisteredEvent(instance, 1L, registration), null)); + } + + /** + * Test {@link MicrosoftTeamsNotifier#shouldNotify(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#shouldNotify(InstanceEvent, Instance)} + */ + @Test + public void testShouldNotify2() { + // Arrange, Act and Assert + assertTrue(microsoftTeamsNotifier.shouldNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link MicrosoftTeamsNotifier#shouldNotify(InstanceEvent, Instance)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#shouldNotify(InstanceEvent, Instance)} + */ + @Test + public void testShouldNotify_whenNull_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(microsoftTeamsNotifier.shouldNotify(null, null)); + } + + /** + * Test + * {@link MicrosoftTeamsNotifier#evaluateExpression(EvaluationContext, Expression)}. + *

    + *
  • When {@link StandardEvaluationContext#StandardEvaluationContext()}.
  • + *
  • Then return {@code 42}.
  • + *
+ *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#evaluateExpression(EvaluationContext, Expression)} + */ + @Test + public void testEvaluateExpression_whenStandardEvaluationContext_thenReturn42() { + // Arrange + StandardEvaluationContext context = new StandardEvaluationContext(); + + // Act and Assert + assertEquals("42", microsoftTeamsNotifier.evaluateExpression(context, new LiteralExpression("42"))); + } + + /** + * Test + * {@link MicrosoftTeamsNotifier#createEvaluationContext(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#createEvaluationContext(InstanceEvent, Instance)} + */ + @Test + public void testCreateEvaluationContext() { + // Arrange and Act + EvaluationContext actualCreateEvaluationContextResult = microsoftTeamsNotifier + .createEvaluationContext(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + Object value = actualCreateEvaluationContextResult.getRootObject().getValue(); + assertTrue(value instanceof Map); + List propertyAccessors = actualCreateEvaluationContextResult.getPropertyAccessors(); + assertEquals(2, propertyAccessors.size()); + assertTrue(propertyAccessors.get(1) instanceof MapAccessor); + assertTrue(propertyAccessors.get(0) instanceof DataBindingPropertyAccessor); + assertTrue(actualCreateEvaluationContextResult instanceof SimpleEvaluationContext); + assertTrue(actualCreateEvaluationContextResult.getOperatorOverloader() instanceof StandardOperatorOverloader); + assertTrue(actualCreateEvaluationContextResult.getTypeComparator() instanceof StandardTypeComparator); + assertTrue(actualCreateEvaluationContextResult.getTypeConverter() instanceof StandardTypeConverter); + assertNull(actualCreateEvaluationContextResult.getBeanResolver()); + assertEquals(3, ((Map) value).size()); + List constructorResolvers = actualCreateEvaluationContextResult.getConstructorResolvers(); + assertTrue(constructorResolvers.isEmpty()); + assertTrue(((Map) value).containsKey("event")); + assertTrue(((Map) value).containsKey("instance")); + assertTrue(((Map) value).containsKey("lastStatus")); + assertTrue(actualCreateEvaluationContextResult.isAssignmentEnabled()); + assertSame(constructorResolvers, actualCreateEvaluationContextResult.getIndexAccessors()); + assertSame(constructorResolvers, actualCreateEvaluationContextResult.getMethodResolvers()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#getThemeColor()}. + *

+ * Method under test: {@link MicrosoftTeamsNotifier#getThemeColor()} + */ + @Test + public void testGetThemeColor() { + // Arrange, Act and Assert + assertEquals( + "event.type == 'STATUS_CHANGED' ? (event.statusInfo.status=='UP' ? '6db33f' : 'b32d36') : '439fe0'", + microsoftTeamsNotifier.getThemeColor()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#setThemeColor(String)}. + *

+ * Method under test: {@link MicrosoftTeamsNotifier#setThemeColor(String)} + */ + @Test + public void testSetThemeColor() { + // Arrange and Act + microsoftTeamsNotifier.setThemeColor("Theme Color"); + + // Assert + assertEquals("Theme Color", microsoftTeamsNotifier.getThemeColor()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#getDeregisterActivitySubtitle()}. + *

+ * Method under test: {@link MicrosoftTeamsNotifier#getDeregisterActivitySubtitle()} + */ + @Test + public void testGetDeregisterActivitySubtitle() { + // Arrange, Act and Assert + assertEquals("#{instance.registration.name} with id #{instance.id} has de-registered from Spring Boot Admin", + microsoftTeamsNotifier.getDeregisterActivitySubtitle()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#setDeregisterActivitySubtitle(String)}. + *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#setDeregisterActivitySubtitle(String)} + */ + @Test + public void testSetDeregisterActivitySubtitle() { + // Arrange and Act + microsoftTeamsNotifier.setDeregisterActivitySubtitle("Dr"); + + // Assert + assertEquals("Dr", microsoftTeamsNotifier.getDeregisterActivitySubtitle()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#getRegisterActivitySubtitle()}. + *

+ * Method under test: {@link MicrosoftTeamsNotifier#getRegisterActivitySubtitle()} + */ + @Test + public void testGetRegisterActivitySubtitle() { + // Arrange, Act and Assert + assertEquals("#{instance.registration.name} with id #{instance.id} has registered with Spring Boot Admin", + microsoftTeamsNotifier.getRegisterActivitySubtitle()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#setRegisterActivitySubtitle(String)}. + *

+ * Method under test: + * {@link MicrosoftTeamsNotifier#setRegisterActivitySubtitle(String)} + */ + @Test + public void testSetRegisterActivitySubtitle() { + // Arrange and Act + microsoftTeamsNotifier.setRegisterActivitySubtitle("Dr"); + + // Assert + assertEquals("Dr", microsoftTeamsNotifier.getRegisterActivitySubtitle()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#getStatusActivitySubtitle()}. + *

+ * Method under test: {@link MicrosoftTeamsNotifier#getStatusActivitySubtitle()} + */ + @Test + public void testGetStatusActivitySubtitle() { + // Arrange, Act and Assert + assertEquals("#{instance.registration.name} with id #{instance.id} changed status from #{lastStatus} to #{event" + + ".statusInfo.status}", microsoftTeamsNotifier.getStatusActivitySubtitle()); + } + + /** + * Test {@link MicrosoftTeamsNotifier#setStatusActivitySubtitle(String)}. + *

+ * Method under test: {@link MicrosoftTeamsNotifier#setStatusActivitySubtitle(String)} + */ + @Test + public void testSetStatusActivitySubtitle() { + // Arrange and Act + microsoftTeamsNotifier.setStatusActivitySubtitle("Dr"); + + // Assert + assertEquals("Dr", microsoftTeamsNotifier.getStatusActivitySubtitle()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link MicrosoftTeamsNotifier#setDeRegisteredTitle(String)} + *
  • {@link MicrosoftTeamsNotifier#setMessageSummary(String)} + *
  • {@link MicrosoftTeamsNotifier#setRegisteredTitle(String)} + *
  • {@link MicrosoftTeamsNotifier#setRestTemplate(RestTemplate)} + *
  • {@link MicrosoftTeamsNotifier#setStatusChangedTitle(String)} + *
  • {@link MicrosoftTeamsNotifier#setWebhookUrl(URI)} + *
  • {@link MicrosoftTeamsNotifier#getDeRegisteredTitle()} + *
  • {@link MicrosoftTeamsNotifier#getMessageSummary()} + *
  • {@link MicrosoftTeamsNotifier#getRegisteredTitle()} + *
  • {@link MicrosoftTeamsNotifier#getStatusChangedTitle()} + *
  • {@link MicrosoftTeamsNotifier#getWebhookUrl()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + MicrosoftTeamsNotifier microsoftTeamsNotifier = new MicrosoftTeamsNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + microsoftTeamsNotifier.setDeRegisteredTitle("Dr"); + microsoftTeamsNotifier.setMessageSummary("Message Summary"); + microsoftTeamsNotifier.setRegisteredTitle("Dr"); + microsoftTeamsNotifier.setRestTemplate(mock(RestTemplate.class)); + microsoftTeamsNotifier.setStatusChangedTitle("Dr"); + URI webhookUrl = PagerdutyNotifier.DEFAULT_URI; + microsoftTeamsNotifier.setWebhookUrl(webhookUrl); + String actualDeRegisteredTitle = microsoftTeamsNotifier.getDeRegisteredTitle(); + String actualMessageSummary = microsoftTeamsNotifier.getMessageSummary(); + String actualRegisteredTitle = microsoftTeamsNotifier.getRegisteredTitle(); + String actualStatusChangedTitle = microsoftTeamsNotifier.getStatusChangedTitle(); + URI actualWebhookUrl = microsoftTeamsNotifier.getWebhookUrl(); + + // Assert + assertEquals("Dr", actualDeRegisteredTitle); + assertEquals("Dr", actualRegisteredTitle); + assertEquals("Dr", actualStatusChangedTitle); + assertEquals("Message Summary", actualMessageSummary); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualWebhookUrl.toString()); + assertSame(webhookUrl, actualWebhookUrl); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/NotificationTriggerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/NotificationTriggerDiffblueTest.java new file mode 100644 index 00000000000..fcbe34cf899 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/NotificationTriggerDiffblueTest.java @@ -0,0 +1,111 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertSame; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.util.ArrayList; +import java.util.function.Consumer; +import java.util.function.Function; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +@ContextConfiguration(classes = { NotificationTrigger.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class NotificationTriggerDiffblueTest { + + @Autowired + private NotificationTrigger notificationTrigger; + + @MockitoBean + private Notifier notifier; + + @MockitoBean + private Publisher publisher; + + /** + * Test {@link NotificationTrigger#sendNotifications(InstanceEvent)}. + *

+ * Method under test: {@link NotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications() { + // Arrange + Flux source = Flux.fromIterable(new ArrayList<>()); + when(notifier.notify(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + + // Act + notificationTrigger.sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(notifier).notify(isA(InstanceEvent.class)); + } + + /** + * Test {@link NotificationTrigger#sendNotifications(InstanceEvent)}. + *

+ * Method under test: {@link NotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications2() { + // Arrange + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + when(channelSendOperator.doOnError(Mockito.>any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + when(notifier.notify(Mockito.any())).thenReturn(channelSendOperator); + + // Act + notificationTrigger.sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(notifier).notify(isA(InstanceEvent.class)); + verify(channelSendOperator).doOnError(isA(Consumer.class)); + } + + /** + * Test {@link NotificationTrigger#sendNotifications(InstanceEvent)}. + *

+ * Method under test: {@link NotificationTrigger#sendNotifications(InstanceEvent)} + */ + @Test + public void testSendNotifications3() { + // Arrange + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator2 = new ChannelSendOperator<>(source, mock(Function.class)); + + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(channelSendOperator2); + ChannelSendOperator channelSendOperator3 = mock(ChannelSendOperator.class); + when(channelSendOperator3.doOnError(Mockito.>any())).thenReturn(channelSendOperator); + when(notifier.notify(Mockito.any())).thenReturn(channelSendOperator3); + + // Act + Mono actualSendNotificationsResult = notificationTrigger + .sendNotifications(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(notifier).notify(isA(InstanceEvent.class)); + verify(channelSendOperator3).doOnError(isA(Consumer.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + assertSame(channelSendOperator2, actualSendNotificationsResult); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifierDiffblueTest.java new file mode 100644 index 00000000000..da2687f2e88 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifierDiffblueTest.java @@ -0,0 +1,183 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { OpsGenieNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class OpsGenieNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @Autowired + private OpsGenieNotifier opsGenieNotifier; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test {@link OpsGenieNotifier#OpsGenieNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link OpsGenieNotifier#OpsGenieNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewOpsGenieNotifier() { + // Arrange and Act + OpsGenieNotifier actualOpsGenieNotifier = new OpsGenieNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + actualOpsGenieNotifier.getMessage()); + assertEquals("https://api.opsgenie.com/v2/alerts", actualOpsGenieNotifier.getUrl().toString()); + assertNull(actualOpsGenieNotifier.getActions()); + assertNull(actualOpsGenieNotifier.getApiKey()); + assertNull(actualOpsGenieNotifier.getEntity()); + assertNull(actualOpsGenieNotifier.getSource()); + assertNull(actualOpsGenieNotifier.getTags()); + assertNull(actualOpsGenieNotifier.getUser()); + assertTrue(actualOpsGenieNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualOpsGenieNotifier.getIgnoreChanges()); + } + + /** + * Test {@link OpsGenieNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link OpsGenieNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(opsGenieNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectComplete().verify(); + } + + /** + * Test {@link OpsGenieNotifier#getMessage()}. + *

+ * Method under test: {@link OpsGenieNotifier#getMessage()} + */ + @Test + public void testGetMessage() { + // Arrange, Act and Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + opsGenieNotifier.getMessage()); + } + + /** + * Test {@link OpsGenieNotifier#getMessage(InstanceEvent, Instance)} with + * {@code InstanceEvent}, {@code Instance}. + *

+ * Method under test: {@link OpsGenieNotifier#getMessage(InstanceEvent, Instance)} + */ + @Test + public void testGetMessageWithInstanceEventInstance() { + // Arrange + OpsGenieNotifier opsGenieNotifier = new OpsGenieNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + opsGenieNotifier.setDescription("The characteristics of someone or something"); + + // Act and Assert + assertEquals("The characteristics of someone or something", + opsGenieNotifier.getMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link OpsGenieNotifier#setDescription(String)}. + *

+ * Method under test: {@link OpsGenieNotifier#setDescription(String)} + */ + @Test + public void testSetDescription() { + // Arrange and Act + opsGenieNotifier.setDescription("The characteristics of someone or something"); + + // Assert + assertEquals("The characteristics of someone or something", opsGenieNotifier.getMessage()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link OpsGenieNotifier#setActions(String)} + *
  • {@link OpsGenieNotifier#setApiKey(String)} + *
  • {@link OpsGenieNotifier#setEntity(String)} + *
  • {@link OpsGenieNotifier#setRestTemplate(RestTemplate)} + *
  • {@link OpsGenieNotifier#setSource(String)} + *
  • {@link OpsGenieNotifier#setTags(String)} + *
  • {@link OpsGenieNotifier#setUrl(URI)} + *
  • {@link OpsGenieNotifier#setUser(String)} + *
  • {@link OpsGenieNotifier#getActions()} + *
  • {@link OpsGenieNotifier#getApiKey()} + *
  • {@link OpsGenieNotifier#getEntity()} + *
  • {@link OpsGenieNotifier#getSource()} + *
  • {@link OpsGenieNotifier#getTags()} + *
  • {@link OpsGenieNotifier#getUrl()} + *
  • {@link OpsGenieNotifier#getUser()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + OpsGenieNotifier opsGenieNotifier = new OpsGenieNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + opsGenieNotifier.setActions("Actions"); + opsGenieNotifier.setApiKey("Api Key"); + opsGenieNotifier.setEntity("Entity"); + opsGenieNotifier.setRestTemplate(mock(RestTemplate.class)); + opsGenieNotifier.setSource("Source"); + opsGenieNotifier.setTags("Tags"); + URI url = PagerdutyNotifier.DEFAULT_URI; + opsGenieNotifier.setUrl(url); + opsGenieNotifier.setUser("User"); + String actualActions = opsGenieNotifier.getActions(); + String actualApiKey = opsGenieNotifier.getApiKey(); + String actualEntity = opsGenieNotifier.getEntity(); + String actualSource = opsGenieNotifier.getSource(); + String actualTags = opsGenieNotifier.getTags(); + URI actualUrl = opsGenieNotifier.getUrl(); + + // Assert + assertEquals("Actions", actualActions); + assertEquals("Api Key", actualApiKey); + assertEquals("Entity", actualEntity); + assertEquals("Source", actualSource); + assertEquals("Tags", actualTags); + assertEquals("User", opsGenieNotifier.getUser()); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualUrl.toString()); + assertSame(url, actualUrl); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifierDiffblueTest.java new file mode 100644 index 00000000000..66414e5fe2c --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifierDiffblueTest.java @@ -0,0 +1,215 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { PagerdutyNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class PagerdutyNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @Autowired + private PagerdutyNotifier pagerdutyNotifier; + + @MockitoBean + private RestTemplate restTemplate; + + /** + * Test {@link PagerdutyNotifier#PagerdutyNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link PagerdutyNotifier#PagerdutyNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewPagerdutyNotifier() { + // Arrange and Act + PagerdutyNotifier actualPagerdutyNotifier = new PagerdutyNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + actualPagerdutyNotifier.getDescription()); + URI url = actualPagerdutyNotifier.getUrl(); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", url.toString()); + assertNull(actualPagerdutyNotifier.getClient()); + assertNull(actualPagerdutyNotifier.getServiceKey()); + assertNull(actualPagerdutyNotifier.getClientUrl()); + assertTrue(actualPagerdutyNotifier.isEnabled()); + assertSame(actualPagerdutyNotifier.DEFAULT_URI, url); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualPagerdutyNotifier.getIgnoreChanges()); + } + + /** + * Test {@link PagerdutyNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link PagerdutyNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(pagerdutyNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link PagerdutyNotifier#getDescription()}. + *

+ * Method under test: {@link PagerdutyNotifier#getDescription()} + */ + @Test + public void testGetDescription() { + // Arrange, Act and Assert + assertEquals("#{instance.registration.name}/#{instance.id} is #{instance.statusInfo.status}", + pagerdutyNotifier.getDescription()); + } + + /** + * Test {@link PagerdutyNotifier#getDescription(InstanceEvent, Instance)} with + * {@code InstanceEvent}, {@code Instance}. + *

+ * Method under test: + * {@link PagerdutyNotifier#getDescription(InstanceEvent, Instance)} + */ + @Test + public void testGetDescriptionWithInstanceEventInstance() { + // Arrange + PagerdutyNotifier pagerdutyNotifier = new PagerdutyNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + pagerdutyNotifier.setDescription("The characteristics of someone or something"); + + // Act and Assert + assertEquals("The characteristics of someone or something", + pagerdutyNotifier.getDescription(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link PagerdutyNotifier#setDescription(String)}. + *

+ * Method under test: {@link PagerdutyNotifier#setDescription(String)} + */ + @Test + public void testSetDescription() { + // Arrange and Act + pagerdutyNotifier.setDescription("The characteristics of someone or something"); + + // Assert + assertEquals("The characteristics of someone or something", pagerdutyNotifier.getDescription()); + } + + /** + * Test {@link PagerdutyNotifier#getDetails(InstanceEvent)}. + *

    + *
  • Given {@link InstanceId} with value is {@code 42}.
  • + *
  • Then return size is two.
  • + *
+ *

+ * Method under test: {@link PagerdutyNotifier#getDetails(InstanceEvent)} + */ + @Test + public void testGetDetails_givenInstanceIdWithValueIs42_thenReturnSizeIsTwo() { + // Arrange + InstanceStatusChangedEvent event = mock(InstanceStatusChangedEvent.class); + when(event.getInstance()).thenReturn(InstanceId.of("42")); + when(event.getStatusInfo()).thenReturn(null); + + // Act + Map actualDetails = pagerdutyNotifier.getDetails(event); + + // Assert + verify(event).getInstance(); + verify(event).getStatusInfo(); + assertEquals(2, actualDetails.size()); + assertEquals("UNKNOWN", actualDetails.get("from")); + assertNull(actualDetails.get("to")); + } + + /** + * Test {@link PagerdutyNotifier#getDetails(InstanceEvent)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
  • Then return Empty.
  • + *
+ *

+ * Method under test: {@link PagerdutyNotifier#getDetails(InstanceEvent)} + */ + @Test + public void testGetDetails_whenInstanceIdWithValueIs42_thenReturnEmpty() { + // Arrange, Act and Assert + assertTrue(pagerdutyNotifier.getDetails(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)).isEmpty()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link PagerdutyNotifier#setClient(String)} + *
  • {@link PagerdutyNotifier#setClientUrl(URI)} + *
  • {@link PagerdutyNotifier#setRestTemplate(RestTemplate)} + *
  • {@link PagerdutyNotifier#setServiceKey(String)} + *
  • {@link PagerdutyNotifier#setUrl(URI)} + *
  • {@link PagerdutyNotifier#getClient()} + *
  • {@link PagerdutyNotifier#getClientUrl()} + *
  • {@link PagerdutyNotifier#getServiceKey()} + *
  • {@link PagerdutyNotifier#getUrl()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + PagerdutyNotifier pagerdutyNotifier = new PagerdutyNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + pagerdutyNotifier.setClient("Client"); + pagerdutyNotifier.setClientUrl(PagerdutyNotifier.DEFAULT_URI); + pagerdutyNotifier.setRestTemplate(mock(RestTemplate.class)); + pagerdutyNotifier.setServiceKey("Service Key"); + URI url = PagerdutyNotifier.DEFAULT_URI; + pagerdutyNotifier.setUrl(url); + String actualClient = pagerdutyNotifier.getClient(); + URI actualClientUrl = pagerdutyNotifier.getClientUrl(); + String actualServiceKey = pagerdutyNotifier.getServiceKey(); + URI actualUrl = pagerdutyNotifier.getUrl(); + + // Assert + assertEquals("Client", actualClient); + assertEquals("Service Key", actualServiceKey); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualClientUrl.toString()); + assertSame(url, actualClientUrl); + assertSame(url, actualUrl); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/RemindingNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/RemindingNotifierDiffblueTest.java new file mode 100644 index 00000000000..92ec10865e0 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/RemindingNotifierDiffblueTest.java @@ -0,0 +1,151 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEndpointsDetectedEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.util.ArrayList; +import java.util.function.Function; +import org.junit.Test; +import org.mockito.Mockito; +import org.springframework.http.server.reactive.ChannelSendOperator; +import reactor.core.publisher.Flux; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class RemindingNotifierDiffblueTest { + + /** + * Test {@link RemindingNotifier#RemindingNotifier(Notifier, InstanceRepository)}. + *
    + *
  • When {@link Notifier}.
  • + *
  • Then return Enabled.
  • + *
+ *

+ * Method under test: + * {@link RemindingNotifier#RemindingNotifier(Notifier, InstanceRepository)} + */ + @Test + public void testNewRemindingNotifier_whenNotifier_thenReturnEnabled() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act and Assert + assertTrue(new RemindingNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore())) + .isEnabled()); + } + + /** + * Test {@link RemindingNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Then calls {@link Notifier#notify(InstanceEvent)}.
  • + *
+ *

+ * Method under test: {@link RemindingNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_thenCallsNotify() throws AssertionError { + // Arrange + Notifier delegate = mock(Notifier.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + when(delegate.notify(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + RemindingNotifier remindingNotifier = new RemindingNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(remindingNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectComplete().verify(); + verify(delegate).notify(isA(InstanceEvent.class)); + } + + /** + * Test {@link RemindingNotifier#sendReminders()}. + *

+ * Method under test: {@link RemindingNotifier#sendReminders()} + */ + @Test + public void testSendReminders() throws AssertionError { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new RemindingNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore())) + .sendReminders()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link RemindingNotifier#shouldStartReminder(InstanceEvent)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link RemindingNotifier#shouldStartReminder(InstanceEvent)} + */ + @Test + public void testShouldStartReminder_whenInstanceIdWithValueIs42_thenReturnFalse() { + // Arrange + Notifier delegate = mock(Notifier.class); + RemindingNotifier remindingNotifier = new RemindingNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + assertFalse(remindingNotifier.shouldStartReminder(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + } + + /** + * Test {@link RemindingNotifier#shouldEndReminder(InstanceEvent)}. + *

    + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link RemindingNotifier#shouldEndReminder(InstanceEvent)} + */ + @Test + public void testShouldEndReminder_thenReturnFalse() { + // Arrange + Notifier delegate = mock(Notifier.class); + RemindingNotifier remindingNotifier = new RemindingNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + InstanceId instance = InstanceId.of("42"); + + // Act and Assert + assertFalse(remindingNotifier + .shouldEndReminder(new InstanceEndpointsDetectedEvent(instance, 1L, Endpoints.empty()))); + } + + /** + * Test {@link RemindingNotifier#shouldEndReminder(InstanceEvent)}. + *

    + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link RemindingNotifier#shouldEndReminder(InstanceEvent)} + */ + @Test + public void testShouldEndReminder_thenReturnTrue() { + // Arrange + Notifier delegate = mock(Notifier.class); + RemindingNotifier remindingNotifier = new RemindingNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + assertTrue(remindingNotifier.shouldEndReminder(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/RocketChatNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/RocketChatNotifierDiffblueTest.java new file mode 100644 index 00000000000..efb7c721263 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/RocketChatNotifierDiffblueTest.java @@ -0,0 +1,714 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.convert.TypeDescriptor; +import org.springframework.expression.EvaluationException; +import org.springframework.expression.Expression; +import org.springframework.expression.common.CompositeStringExpression; +import org.springframework.expression.common.LiteralExpression; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { RocketChatNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class RocketChatNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + @Autowired + private RocketChatNotifier rocketChatNotifier; + + /** + * Test + * {@link RocketChatNotifier#RocketChatNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link RocketChatNotifier#RocketChatNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewRocketChatNotifier() throws EvaluationException { + // Arrange and Act + RocketChatNotifier actualRocketChatNotifier = new RocketChatNotifier(instanceRepository, + mock(RestTemplate.class)); + + // Assert + Expression message = actualRocketChatNotifier.getMessage(); + assertTrue(message instanceof CompositeStringExpression); + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + message.getExpressionString()); + assertNull(actualRocketChatNotifier.getRoomId()); + assertNull(actualRocketChatNotifier.getToken()); + assertNull(actualRocketChatNotifier.getUrl()); + assertNull(actualRocketChatNotifier.getUserId()); + assertEquals(7, ((CompositeStringExpression) message).getExpressions().length); + assertTrue(actualRocketChatNotifier.isEnabled()); + Class expectedValueType = String.class; + assertEquals(expectedValueType, message.getValueType()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualRocketChatNotifier.getIgnoreChanges()); + } + + /** + * Test {@link RocketChatNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_whenInstanceIdWithValueIs42() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(rocketChatNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link RocketChatNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42Value}.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_whenInstanceIdWithValueIs42Value() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(rocketChatNotifier + .doNotify(new InstanceDeregisteredEvent(InstanceId.of("42Value"), Long.MAX_VALUE), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link RocketChatNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • When {@link InstanceId} with value is {@code 424242}.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_whenInstanceIdWithValueIs424242() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(rocketChatNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("424242"), 0L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage() { + // Arrange + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(new ArrayList<>()); + eventStore.append(new ArrayList<>()); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage2() { + // Arrange + ArrayList events = new ArrayList<>(); + events.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 0L)); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(events); + eventStore.append(new ArrayList<>()); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage3() { + // Arrange + ArrayList events = new ArrayList<>(); + events.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 2L)); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(new ArrayList<>()); + eventStore.append(events); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage4() { + // Arrange + ArrayList events = new ArrayList<>(); + events.add(new InstanceDeregisteredEvent(InstanceId.of("42"), Long.MAX_VALUE)); + + ArrayList events2 = new ArrayList<>(); + events2.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 0L)); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(events2); + eventStore.append(events); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage5() { + // Arrange + ArrayList events = new ArrayList<>(); + events.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 2L)); + + ArrayList events2 = new ArrayList<>(); + events2.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 2L)); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(events2); + eventStore.append(events); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage6() { + // Arrange + ArrayList events = new ArrayList<>(); + InstanceId instance = InstanceId.of("42"); + events.add(new InstanceDeregisteredEvent(instance, 2L, + LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant())); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(new ArrayList<>()); + eventStore.append(events); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage7() { + // Arrange + ArrayList events = new ArrayList<>(); + events.add(new InstanceDeregisteredEvent(InstanceId.of("42"), Long.MAX_VALUE)); + + ArrayList events2 = new ArrayList<>(); + events2.add(new InstanceDeregisteredEvent(InstanceId.of("42"), -1L)); + events2.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 0L)); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(events2); + eventStore.append(events); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage8() { + // Arrange + ArrayList events = new ArrayList<>(); + InstanceId instance = InstanceId.of("42"); + events.add(new InstanceDeregisteredEvent(instance, -1L, + LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant())); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(new ArrayList<>()); + eventStore.append(events); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

    + *
  • Given {@link InMemoryEventStore#InMemoryEventStore()} append + * {@link ArrayList#ArrayList()}.
  • + *
  • Then return {@link Map}.
  • + *
+ *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage_givenInMemoryEventStoreAppendArrayList_thenReturnMap() { + // Arrange + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(new ArrayList<>()); + eventStore.append(new ArrayList<>()); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

    + *
  • Then return {@link Map}.
  • + *
+ *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage_thenReturnMap() { + // Arrange + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)}. + *

    + *
  • When {@link InstanceId} with {@code Value}.
  • + *
+ *

+ * Method under test: + * {@link RocketChatNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage_whenInstanceIdWithValue() { + // Arrange + ArrayList events = new ArrayList<>(); + events.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 2L)); + + InMemoryEventStore eventStore = new InMemoryEventStore(); + eventStore.append(new ArrayList<>()); + eventStore.append(events); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier(new EventsourcingInstanceRepository(eventStore), + mock(RestTemplate.class)); + rocketChatNotifier.setEnabled(true); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = rocketChatNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("Value"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(1, ((Map) actualCreateMessageResult).size()); + HashMap getResult = ((Map) actualCreateMessageResult).get("message"); + assertEquals(2, getResult.size()); + assertEquals("Not all who wander are lost", getResult.get("msg")); + assertNull(getResult.get("rid")); + } + + /** + * Test {@link RocketChatNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Given {@link IMap} {@link IMap#addEntryListener(MapListener, boolean)} return + * randomUUID.
  • + *
  • Then calls {@link IMap#addEntryListener(MapListener, boolean)}.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_givenIMapAddEntryListenerReturnRandomUUID_thenCallsAddEntryListener() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier( + new EventsourcingInstanceRepository(new HazelcastEventStore(eventLogs)), mock(RestTemplate.class)); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act + String actualText = rocketChatNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("Value"), 2L), null); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + assertEquals("Not all who wander are lost", actualText); + } + + /** + * Test {@link RocketChatNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Given {@link InMemoryEventStore#InMemoryEventStore(int)} with + * maxLogSizePerAggregate is three.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_givenInMemoryEventStoreWithMaxLogSizePerAggregateIsThree() { + // Arrange + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore(3)), mock(RestTemplate.class)); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + rocketChatNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42"), 2L), null)); + } + + /** + * Test {@link RocketChatNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • When + * {@link InstanceDeregisteredEvent#InstanceDeregisteredEvent(InstanceId, long)} with + * instance is {@link InstanceId} and version is one.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_whenInstanceDeregisteredEventWithInstanceIsInstanceIdAndVersionIsOne() { + // Arrange + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + rocketChatNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link RocketChatNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • When + * {@link InstanceDeregisteredEvent#InstanceDeregisteredEvent(InstanceId, long)} with + * instance is {@link InstanceId} and version is two.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_whenInstanceDeregisteredEventWithInstanceIsInstanceIdAndVersionIsTwo() { + // Arrange + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + rocketChatNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42"), 2L), null)); + } + + /** + * Test {@link RocketChatNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42UNKNOWN}.
  • + *
  • Then return {@code Not all who wander are lost}.
  • + *
+ *

+ * Method under test: {@link RocketChatNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_whenInstanceIdWithValueIs42unknown_thenReturnNotAllWhoWanderAreLost() { + // Arrange + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + rocketChatNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42UNKNOWN"), 2L), null)); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link RocketChatNotifier#setRestTemplate(RestTemplate)} + *
  • {@link RocketChatNotifier#setRoomId(String)} + *
  • {@link RocketChatNotifier#setToken(String)} + *
  • {@link RocketChatNotifier#setUrl(String)} + *
  • {@link RocketChatNotifier#setUserId(String)} + *
  • {@link RocketChatNotifier#getMessage()} + *
  • {@link RocketChatNotifier#getRoomId()} + *
  • {@link RocketChatNotifier#getToken()} + *
  • {@link RocketChatNotifier#getUrl()} + *
  • {@link RocketChatNotifier#getUserId()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + RocketChatNotifier rocketChatNotifier = new RocketChatNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + rocketChatNotifier.setRestTemplate(mock(RestTemplate.class)); + rocketChatNotifier.setRoomId("42"); + rocketChatNotifier.setToken("ABC123"); + rocketChatNotifier.setUrl("https://example.org/example"); + rocketChatNotifier.setUserId("42"); + Expression actualMessage = rocketChatNotifier.getMessage(); + String actualRoomId = rocketChatNotifier.getRoomId(); + String actualToken = rocketChatNotifier.getToken(); + String actualUrl = rocketChatNotifier.getUrl(); + + // Assert + assertTrue(actualMessage instanceof CompositeStringExpression); + assertEquals("42", actualRoomId); + assertEquals("42", rocketChatNotifier.getUserId()); + assertEquals("ABC123", actualToken); + assertEquals("https://example.org/example", actualUrl); + } + + /** + * Test {@link RocketChatNotifier#setMessage(String)}. + *

+ * Method under test: {@link RocketChatNotifier#setMessage(String)} + */ + @Test + public void testSetMessage() throws EvaluationException { + // Arrange and Act + rocketChatNotifier.setMessage("Not all who wander are lost"); + + // Assert + Expression message = rocketChatNotifier.getMessage(); + assertTrue(message instanceof LiteralExpression); + assertEquals("Not all who wander are lost", message.getExpressionString()); + assertEquals("Not all who wander are lost", message.getValue()); + TypeDescriptor valueTypeDescriptor = message.getValueTypeDescriptor(); + assertEquals("java.lang.String", valueTypeDescriptor.getName()); + assertNull(valueTypeDescriptor.getElementTypeDescriptor()); + assertEquals(0, valueTypeDescriptor.getAnnotations().length); + assertFalse(valueTypeDescriptor.isArray()); + assertFalse(valueTypeDescriptor.isCollection()); + assertFalse(valueTypeDescriptor.isMap()); + assertFalse(valueTypeDescriptor.isPrimitive()); + Class expectedValueType = String.class; + Class valueType = message.getValueType(); + assertEquals(expectedValueType, valueType); + assertSame(valueType, valueTypeDescriptor.getObjectType()); + assertSame(valueType, valueTypeDescriptor.getSource()); + assertSame(valueType, valueTypeDescriptor.getType()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/SlackNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/SlackNotifierDiffblueTest.java new file mode 100644 index 00000000000..48fdc92e21b --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/SlackNotifierDiffblueTest.java @@ -0,0 +1,327 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { SlackNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class SlackNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + @Autowired + private SlackNotifier slackNotifier; + + /** + * Test {@link SlackNotifier#SlackNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link SlackNotifier#SlackNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewSlackNotifier() { + // Arrange and Act + SlackNotifier actualSlackNotifier = new SlackNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + actualSlackNotifier.getMessage()); + assertEquals("Spring Boot Admin", actualSlackNotifier.getUsername()); + assertNull(actualSlackNotifier.getChannel()); + assertNull(actualSlackNotifier.getIcon()); + assertNull(actualSlackNotifier.getWebhookUrl()); + assertTrue(actualSlackNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualSlackNotifier.getIgnoreChanges()); + } + + /** + * Test {@link SlackNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link SlackNotifier} WebhookUrl is + * {@link PagerdutyNotifier#DEFAULT_URI}.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenSlackNotifierWebhookUrlIsDefault_uri() throws AssertionError { + // Arrange + slackNotifier.setWebhookUrl(PagerdutyNotifier.DEFAULT_URI); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(slackNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link SlackNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link SlackNotifier} WebhookUrl is {@code null}.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenSlackNotifierWebhookUrlIsNull() throws AssertionError { + // Arrange + slackNotifier.setWebhookUrl(null); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(slackNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link SlackNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Then return {@code Not all who wander are lost}.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_thenReturnNotAllWhoWanderAreLost() { + // Arrange + SlackNotifier slackNotifier = new SlackNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)); + slackNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + slackNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link SlackNotifier#getColor(InstanceEvent)}. + *

    + *
  • Given {@link IllegalStateException#IllegalStateException(String)} with + * {@code UP}.
  • + *
  • Then throw {@link IllegalStateException}.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#getColor(InstanceEvent)} + */ + @Test + public void testGetColor_givenIllegalStateExceptionWithUp_thenThrowIllegalStateException() { + // Arrange + InstanceStatusChangedEvent event = mock(InstanceStatusChangedEvent.class); + when(event.getStatusInfo()).thenThrow(new IllegalStateException("UP")); + + // Act and Assert + assertThrows(IllegalStateException.class, () -> slackNotifier.getColor(event)); + verify(event).getStatusInfo(); + } + + /** + * Test {@link SlackNotifier#getColor(InstanceEvent)}. + *

    + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
  • Then return {@code #439FE0}.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#getColor(InstanceEvent)} + */ + @Test + public void testGetColor_whenInstanceIdWithValueIs42_thenReturn439fe0() { + // Arrange, Act and Assert + assertEquals("#439FE0", slackNotifier.getColor(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link SlackNotifier#setChannel(String)} + *
  • {@link SlackNotifier#setIcon(String)} + *
  • {@link SlackNotifier#setRestTemplate(RestTemplate)} + *
  • {@link SlackNotifier#setUsername(String)} + *
  • {@link SlackNotifier#setWebhookUrl(URI)} + *
  • {@link SlackNotifier#getChannel()} + *
  • {@link SlackNotifier#getIcon()} + *
  • {@link SlackNotifier#getUsername()} + *
  • {@link SlackNotifier#getWebhookUrl()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + SlackNotifier slackNotifier = new SlackNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)); + + // Act + slackNotifier.setChannel("Channel"); + slackNotifier.setIcon("Icon"); + slackNotifier.setRestTemplate(mock(RestTemplate.class)); + slackNotifier.setUsername("janedoe"); + URI webhookUrl = PagerdutyNotifier.DEFAULT_URI; + slackNotifier.setWebhookUrl(webhookUrl); + String actualChannel = slackNotifier.getChannel(); + String actualIcon = slackNotifier.getIcon(); + String actualUsername = slackNotifier.getUsername(); + URI actualWebhookUrl = slackNotifier.getWebhookUrl(); + + // Assert + assertEquals("Channel", actualChannel); + assertEquals("Icon", actualIcon); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualWebhookUrl.toString()); + assertEquals("janedoe", actualUsername); + assertSame(webhookUrl, actualWebhookUrl); + } + + /** + * Test {@link SlackNotifier#getMessage()}. + *

+ * Method under test: {@link SlackNotifier#getMessage()} + */ + @Test + public void testGetMessage() { + // Arrange, Act and Assert + assertEquals("*#{instance.registration.name}* (#{instance.id}) is *#{event.statusInfo.status}*", + slackNotifier.getMessage()); + } + + /** + * Test {@link SlackNotifier#setMessage(String)}. + *

+ * Method under test: {@link SlackNotifier#setMessage(String)} + */ + @Test + public void testSetMessage() { + // Arrange and Act + slackNotifier.setMessage("Not all who wander are lostattachmentschannel"); + + // Assert + assertEquals("Not all who wander are lostattachmentschannel", slackNotifier.getMessage()); + } + + /** + * Test {@link SlackNotifier#setMessage(String)}. + *

+ * Method under test: {@link SlackNotifier#setMessage(String)} + */ + @Test + public void testSetMessage2() { + // Arrange and Act + slackNotifier.setMessage("Not all who wander are lostjava.lang.VoidMessage"); + + // Assert + assertEquals("Not all who wander are lostjava.lang.VoidMessage", slackNotifier.getMessage()); + } + + /** + * Test {@link SlackNotifier#setMessage(String)}. + *

    + *
  • Then {@link SlackNotifier} Message is + * {@code MessageNot all who wander are lost42}.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#setMessage(String)} + */ + @Test + public void testSetMessage_thenSlackNotifierMessageIsMessageNotAllWhoWanderAreLost42() { + // Arrange and Act + slackNotifier.setMessage("MessageNot all who wander are lost42"); + + // Assert + assertEquals("MessageNot all who wander are lost42", slackNotifier.getMessage()); + } + + /** + * Test {@link SlackNotifier#setMessage(String)}. + *

    + *
  • Then {@link SlackNotifier} Message is {@code Not all who wander are lost}.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#setMessage(String)} + */ + @Test + public void testSetMessage_thenSlackNotifierMessageIsNotAllWhoWanderAreLost() { + // Arrange and Act + slackNotifier.setMessage("Not all who wander are lost"); + + // Assert + assertEquals("Not all who wander are lost", slackNotifier.getMessage()); + } + + /** + * Test {@link SlackNotifier#setMessage(String)}. + *

    + *
  • When a string.
  • + *
  • Then {@link SlackNotifier} Message is a string.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#setMessage(String)} + */ + @Test + public void testSetMessage_whenAString_thenSlackNotifierMessageIsAString() { + // Arrange and Act + slackNotifier.setMessage( + "Not all who wander are lostde.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEventde" + + ".codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent"); + + // Assert + assertEquals( + "Not all who wander are lostde.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEventde" + + ".codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent", + slackNotifier.getMessage()); + } + + /** + * Test {@link SlackNotifier#setMessage(String)}. + *

    + *
  • When a string.
  • + *
  • Then {@link SlackNotifier} Message is a string.
  • + *
+ *

+ * Method under test: {@link SlackNotifier#setMessage(String)} + */ + @Test + public void testSetMessage_whenAString_thenSlackNotifierMessageIsAString2() { + // Arrange and Act + slackNotifier.setMessage( + "MessageNot all who wander are lostde.codecentric.boot.admin.server.domain.events.InstanceStatusCh" + + "angedEvent"); + + // Assert + assertEquals("MessageNot all who wander are lostde.codecentric.boot.admin.server.domain.events.InstanceStatusCh" + + "angedEvent", slackNotifier.getMessage()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/TelegramNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/TelegramNotifierDiffblueTest.java new file mode 100644 index 00000000000..b22720310ce --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/TelegramNotifierDiffblueTest.java @@ -0,0 +1,156 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { TelegramNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class TelegramNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + @Autowired + private TelegramNotifier telegramNotifier; + + /** + * Test {@link TelegramNotifier#TelegramNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link TelegramNotifier#TelegramNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewTelegramNotifier() { + // Arrange and Act + TelegramNotifier actualTelegramNotifier = new TelegramNotifier(instanceRepository, mock(RestTemplate.class)); + + // Assert + assertEquals("HTML", actualTelegramNotifier.getParseMode()); + assertEquals("https://api.telegram.org", actualTelegramNotifier.getApiUrl()); + assertNull(actualTelegramNotifier.getAuthToken()); + assertNull(actualTelegramNotifier.getChatId()); + assertFalse(actualTelegramNotifier.isDisableNotify()); + assertTrue(actualTelegramNotifier.isEnabled()); + assertArrayEquals(new String[] { "UNKNOWN:UP" }, actualTelegramNotifier.getIgnoreChanges()); + } + + /** + * Test {@link TelegramNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link TelegramNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(telegramNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link TelegramNotifier#buildUrl()}. + *

+ * Method under test: {@link TelegramNotifier#buildUrl()} + */ + @Test + public void testBuildUrl() { + // Arrange, Act and Assert + assertEquals( + "https://api.telegram.org/botnull/sendmessage?chat_id={chat_id}&text={text}&parse_mode={parse_mode}" + + "&disable_notification={disable_notification}", + telegramNotifier.buildUrl()); + } + + /** + * Test {@link TelegramNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Then return {@code Not all who wander are lost}.
  • + *
+ *

+ * Method under test: {@link TelegramNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_thenReturnNotAllWhoWanderAreLost() { + // Arrange + TelegramNotifier telegramNotifier = new TelegramNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + telegramNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + telegramNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link TelegramNotifier#setApiUrl(String)} + *
  • {@link TelegramNotifier#setAuthToken(String)} + *
  • {@link TelegramNotifier#setChatId(String)} + *
  • {@link TelegramNotifier#setDisableNotify(boolean)} + *
  • {@link TelegramNotifier#setParseMode(String)} + *
  • {@link TelegramNotifier#setRestTemplate(RestTemplate)} + *
  • {@link TelegramNotifier#getApiUrl()} + *
  • {@link TelegramNotifier#getAuthToken()} + *
  • {@link TelegramNotifier#getChatId()} + *
  • {@link TelegramNotifier#getParseMode()} + *
  • {@link TelegramNotifier#isDisableNotify()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + TelegramNotifier telegramNotifier = new TelegramNotifier( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(RestTemplate.class)); + + // Act + telegramNotifier.setApiUrl("https://example.org/example"); + telegramNotifier.setAuthToken("ABC123"); + telegramNotifier.setChatId("42"); + telegramNotifier.setDisableNotify(true); + telegramNotifier.setParseMode("Parse Mode"); + telegramNotifier.setRestTemplate(mock(RestTemplate.class)); + String actualApiUrl = telegramNotifier.getApiUrl(); + String actualAuthToken = telegramNotifier.getAuthToken(); + String actualChatId = telegramNotifier.getChatId(); + String actualParseMode = telegramNotifier.getParseMode(); + + // Assert + assertEquals("42", actualChatId); + assertEquals("ABC123", actualAuthToken); + assertEquals("Parse Mode", actualParseMode); + assertEquals("https://example.org/example", actualApiUrl); + assertTrue(telegramNotifier.isDisableNotify()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/WebexNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/WebexNotifierDiffblueTest.java new file mode 100644 index 00000000000..0f5014923c1 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/WebexNotifierDiffblueTest.java @@ -0,0 +1,376 @@ +package de.codecentric.boot.admin.server.notify; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.convert.TypeDescriptor; +import org.springframework.expression.EvaluationException; +import org.springframework.expression.Expression; +import org.springframework.expression.common.CompositeStringExpression; +import org.springframework.expression.common.LiteralExpression; +import org.springframework.expression.spel.standard.SpelExpression; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.RestTemplate; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { WebexNotifier.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class WebexNotifierDiffblueTest { + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private RestTemplate restTemplate; + + @Autowired + private WebexNotifier webexNotifier; + + /** + * Test {@link WebexNotifier#WebexNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link WebexNotifier#WebexNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewWebexNotifier() { + // Arrange, Act and Assert + Expression message = new WebexNotifier(instanceRepository, mock(RestTemplate.class)).getMessage(); + assertTrue(message instanceof CompositeStringExpression); + Expression[] expressions = ((CompositeStringExpression) message).getExpressions(); + assertTrue(expressions[0] instanceof LiteralExpression); + assertTrue(expressions[2] instanceof LiteralExpression); + assertTrue(expressions[4] instanceof LiteralExpression); + assertTrue(expressions[6] instanceof LiteralExpression); + assertTrue(expressions[3] instanceof SpelExpression); + assertTrue(expressions[5] instanceof SpelExpression); + assertEquals(7, expressions.length); + } + + /** + * Test {@link WebexNotifier#WebexNotifier(InstanceRepository, RestTemplate)}. + *

+ * Method under test: + * {@link WebexNotifier#WebexNotifier(InstanceRepository, RestTemplate)} + */ + @Test + public void testNewWebexNotifier2() { + // Arrange, Act and Assert + Expression message = new WebexNotifier(instanceRepository, restTemplate).getMessage(); + assertTrue(message instanceof CompositeStringExpression); + Expression[] expressions = ((CompositeStringExpression) message).getExpressions(); + assertTrue(expressions[0] instanceof LiteralExpression); + assertTrue(expressions[2] instanceof LiteralExpression); + assertTrue(expressions[4] instanceof LiteralExpression); + assertTrue(expressions[6] instanceof LiteralExpression); + assertTrue(expressions[3] instanceof SpelExpression); + assertTrue(expressions[5] instanceof SpelExpression); + assertEquals(7, expressions.length); + } + + /** + * Test {@link WebexNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link WebexNotifier} AuthToken is {@code 42}.
  • + *
  • When {@link InstanceId} with value is {@code Event: {}}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenWebexNotifierAuthTokenIs42_whenInstanceIdWithValueIsEvent() throws AssertionError { + // Arrange + webexNotifier.setAuthToken("42"); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(webexNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("Event: {}"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link WebexNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link WebexNotifier} AuthToken is {@code foo}.
  • + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenWebexNotifierAuthTokenIsFoo_whenInstanceIdWithValueIs42() throws AssertionError { + // Arrange + webexNotifier.setAuthToken("foo"); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(webexNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link WebexNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link WebexNotifier} AuthToken is {@code Void}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenWebexNotifierAuthTokenIsJavaLangVoid() throws AssertionError { + // Arrange + webexNotifier.setAuthToken("java.lang.Void"); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(webexNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("Event: {}"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link WebexNotifier#doNotify(InstanceEvent, Instance)}. + *

    + *
  • Given {@link WebexNotifier} AuthToken is {@code null}.
  • + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify_givenWebexNotifierAuthTokenIsNull_whenInstanceIdWithValueIs42() throws AssertionError { + // Arrange + webexNotifier.setAuthToken(null); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(webexNotifier.doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + createResult.expectError().verify(); + } + + /** + * Test {@link WebexNotifier#createMessage(InstanceEvent, Instance)}. + *

    + *
  • Then return {@link Map}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#createMessage(InstanceEvent, Instance)} + */ + @Test + public void testCreateMessage_thenReturnMap() { + // Arrange + WebexNotifier webexNotifier = new WebexNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)); + webexNotifier.setMessage("Not all who wander are lost"); + + // Act + Object actualCreateMessageResult = webexNotifier + .createMessage(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + assertTrue(actualCreateMessageResult instanceof Map); + assertEquals(2, ((Map) actualCreateMessageResult).size()); + assertEquals("Not all who wander are lost", ((Map) actualCreateMessageResult).get("markdown")); + assertNull(((Map) actualCreateMessageResult).get("roomId")); + } + + /** + * Test {@link WebexNotifier#getText(InstanceEvent, Instance)}. + *

+ * Method under test: {@link WebexNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText() { + // Arrange + WebexNotifier webexNotifier = new WebexNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)); + webexNotifier.setMessage("Not all who wander are lost"); + InstanceEvent event = mock(InstanceEvent.class); + when(event.getInstance()).thenThrow(new IllegalStateException("foo")); + + // Act and Assert + assertThrows(IllegalStateException.class, () -> webexNotifier.getText(event, null)); + verify(event).getInstance(); + } + + /** + * Test {@link WebexNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Given {@link IMap} {@link IMap#addEntryListener(MapListener, boolean)} return + * randomUUID.
  • + *
  • Then calls {@link IMap#addEntryListener(MapListener, boolean)}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_givenIMapAddEntryListenerReturnRandomUUID_thenCallsAddEntryListener() { + // Arrange + IMap> eventLog = mock(IMap.class); + when(eventLog.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + WebexNotifier webexNotifier = new WebexNotifier( + new EventsourcingInstanceRepository(new HazelcastEventStore(3, eventLog)), mock(RestTemplate.class)); + webexNotifier.setMessage("42"); + InstanceEvent event = mock(InstanceEvent.class); + when(event.getInstance()).thenThrow(new IllegalStateException("foo")); + + // Act and Assert + assertThrows(IllegalStateException.class, () -> webexNotifier.getText(event, null)); + verify(eventLog).addEntryListener(isA(MapListener.class), eq(true)); + verify(event).getInstance(); + } + + /** + * Test {@link WebexNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Given {@link IllegalStateException#IllegalStateException(String)} with + * {@code event}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_givenIllegalStateExceptionWithEvent() { + // Arrange + IMap> eventLog = mock(IMap.class); + when(eventLog.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + WebexNotifier webexNotifier = new WebexNotifier( + new EventsourcingInstanceRepository(new HazelcastEventStore(3, eventLog)), mock(RestTemplate.class)); + webexNotifier.setMessage("42"); + InstanceEvent event = mock(InstanceEvent.class); + when(event.getInstance()).thenThrow(new IllegalStateException("event")); + + // Act and Assert + assertThrows(IllegalStateException.class, () -> webexNotifier.getText(event, null)); + verify(eventLog).addEntryListener(isA(MapListener.class), eq(true)); + verify(event).getInstance(); + } + + /** + * Test {@link WebexNotifier#getText(InstanceEvent, Instance)}. + *

    + *
  • Then return {@code Not all who wander are lost}.
  • + *
+ *

+ * Method under test: {@link WebexNotifier#getText(InstanceEvent, Instance)} + */ + @Test + public void testGetText_thenReturnNotAllWhoWanderAreLost() { + // Arrange + WebexNotifier webexNotifier = new WebexNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)); + webexNotifier.setMessage("Not all who wander are lost"); + + // Act and Assert + assertEquals("Not all who wander are lost", + webexNotifier.getText(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link WebexNotifier#setAuthToken(String)} + *
  • {@link WebexNotifier#setRestTemplate(RestTemplate)} + *
  • {@link WebexNotifier#setRoomId(String)} + *
  • {@link WebexNotifier#setUrl(URI)} + *
  • {@link WebexNotifier#getAuthToken()} + *
  • {@link WebexNotifier#getMessage()} + *
  • {@link WebexNotifier#getRoomId()} + *
  • {@link WebexNotifier#getUrl()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + WebexNotifier webexNotifier = new WebexNotifier(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(RestTemplate.class)); + + // Act + webexNotifier.setAuthToken("ABC123"); + webexNotifier.setRestTemplate(mock(RestTemplate.class)); + webexNotifier.setRoomId("42"); + URI url = PagerdutyNotifier.DEFAULT_URI; + webexNotifier.setUrl(url); + String actualAuthToken = webexNotifier.getAuthToken(); + Expression actualMessage = webexNotifier.getMessage(); + String actualRoomId = webexNotifier.getRoomId(); + URI actualUrl = webexNotifier.getUrl(); + + // Assert + assertTrue(actualMessage instanceof CompositeStringExpression); + assertEquals("42", actualRoomId); + assertEquals("ABC123", actualAuthToken); + assertEquals("https://events.pagerduty.com/generic/2010-04-15/create_event.json", actualUrl.toString()); + assertSame(url, actualUrl); + } + + /** + * Test {@link WebexNotifier#setMessage(String)}. + *

+ * Method under test: {@link WebexNotifier#setMessage(String)} + */ + @Test + public void testSetMessage() throws EvaluationException { + // Arrange and Act + webexNotifier.setMessage("Not all who wander are lost"); + + // Assert + Expression message = webexNotifier.getMessage(); + assertTrue(message instanceof LiteralExpression); + assertEquals("Not all who wander are lost", message.getExpressionString()); + assertEquals("Not all who wander are lost", message.getValue()); + TypeDescriptor valueTypeDescriptor = message.getValueTypeDescriptor(); + assertEquals("java.lang.String", valueTypeDescriptor.getName()); + assertNull(valueTypeDescriptor.getElementTypeDescriptor()); + assertEquals(0, valueTypeDescriptor.getAnnotations().length); + assertFalse(valueTypeDescriptor.isArray()); + assertFalse(valueTypeDescriptor.isCollection()); + assertFalse(valueTypeDescriptor.isMap()); + assertFalse(valueTypeDescriptor.isPrimitive()); + Class expectedValueType = String.class; + Class valueType = message.getValueType(); + assertEquals(expectedValueType, valueType); + assertSame(valueType, valueTypeDescriptor.getObjectType()); + assertSame(valueType, valueTypeDescriptor.getSource()); + assertSame(valueType, valueTypeDescriptor.getType()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/ApplicationNameNotificationFilterDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/ApplicationNameNotificationFilterDiffblueTest.java new file mode 100644 index 00000000000..06a81cec5a4 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/ApplicationNameNotificationFilterDiffblueTest.java @@ -0,0 +1,58 @@ +package de.codecentric.boot.admin.server.notify.filter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class ApplicationNameNotificationFilterDiffblueTest { + + /** + * Test + * {@link ApplicationNameNotificationFilter#ApplicationNameNotificationFilter(String, Instant)}. + *

+ * Method under test: + * {@link ApplicationNameNotificationFilter#ApplicationNameNotificationFilter(String, Instant)} + */ + @Test + public void testNewApplicationNameNotificationFilter() { + // Arrange + Instant expiry = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + ApplicationNameNotificationFilter actualApplicationNameNotificationFilter = new ApplicationNameNotificationFilter( + "Application Name", expiry); + + // Assert + assertEquals("Application Name", actualApplicationNameNotificationFilter.getApplicationName()); + Instant expectedExpiry = expiry.EPOCH; + assertSame(expectedExpiry, actualApplicationNameNotificationFilter.getExpiry()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link ApplicationNameNotificationFilter#toString()} + *
  • {@link ApplicationNameNotificationFilter#getApplicationName()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + ApplicationNameNotificationFilter applicationNameNotificationFilter = new ApplicationNameNotificationFilter( + "Application Name", LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()); + + // Act + String actualToStringResult = applicationNameNotificationFilter.toString(); + + // Assert + assertEquals("Application Name", applicationNameNotificationFilter.getApplicationName()); + assertEquals("NotificationFilter [applicationName=Application Name, expiry=1970-01-01T00:00:00Z]", + actualToStringResult); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/ExpiringNotificationFilterDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/ExpiringNotificationFilterDiffblueTest.java new file mode 100644 index 00000000000..0c3a47e0b87 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/ExpiringNotificationFilterDiffblueTest.java @@ -0,0 +1,66 @@ +package de.codecentric.boot.admin.server.notify.filter; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class ExpiringNotificationFilterDiffblueTest { + + /** + * Test {@link ExpiringNotificationFilter#isExpired()}. + *
    + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link ExpiringNotificationFilter#isExpired()} + */ + @Test + public void testIsExpired_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(new ApplicationNameNotificationFilter("Application Name", null).isExpired()); + } + + /** + * Test {@link ExpiringNotificationFilter#filter(InstanceEvent, Instance)}. + *

    + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: + * {@link ExpiringNotificationFilter#filter(InstanceEvent, Instance)} + */ + @Test + public void testFilter_thenReturnFalse() { + // Arrange + ApplicationNameNotificationFilter applicationNameNotificationFilter = new ApplicationNameNotificationFilter( + "Application Name", LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()); + + // Act and Assert + assertFalse( + applicationNameNotificationFilter.filter(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link ExpiringNotificationFilter#getExpiry()}. + *

+ * Method under test: {@link ExpiringNotificationFilter#getExpiry()} + */ + @Test + public void testGetExpiry() { + // Arrange and Act + Instant actualExpiry = new ApplicationNameNotificationFilter("Application Name", + LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()) + .getExpiry(); + + // Assert + assertSame(actualExpiry.EPOCH, actualExpiry); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/FilteringNotifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/FilteringNotifierDiffblueTest.java new file mode 100644 index 00000000000..759b6fee79c --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/FilteringNotifierDiffblueTest.java @@ -0,0 +1,150 @@ +package de.codecentric.boot.admin.server.notify.filter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.notify.Notifier; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.function.Function; +import org.junit.Test; +import org.mockito.Mockito; +import org.springframework.http.server.reactive.ChannelSendOperator; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class FilteringNotifierDiffblueTest { + + /** + * Test {@link FilteringNotifier#FilteringNotifier(Notifier, InstanceRepository)}. + *

    + *
  • When {@link Notifier}.
  • + *
  • Then return Enabled.
  • + *
+ *

+ * Method under test: + * {@link FilteringNotifier#FilteringNotifier(Notifier, InstanceRepository)} + */ + @Test + public void testNewFilteringNotifier_whenNotifier_thenReturnEnabled() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act + FilteringNotifier actualFilteringNotifier = new FilteringNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Assert + assertTrue(actualFilteringNotifier.isEnabled()); + assertTrue(actualFilteringNotifier.getNotificationFilters().isEmpty()); + } + + /** + * Test {@link FilteringNotifier#shouldNotify(InstanceEvent, Instance)}. + *

    + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link FilteringNotifier#shouldNotify(InstanceEvent, Instance)} + */ + @Test + public void testShouldNotify_thenReturnTrue() { + // Arrange + Notifier delegate = mock(Notifier.class); + FilteringNotifier filteringNotifier = new FilteringNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act and Assert + assertTrue(filteringNotifier.shouldNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null)); + } + + /** + * Test {@link FilteringNotifier#doNotify(InstanceEvent, Instance)}. + *

+ * Method under test: {@link FilteringNotifier#doNotify(InstanceEvent, Instance)} + */ + @Test + public void testDoNotify() { + // Arrange + Notifier delegate = mock(Notifier.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + when(delegate.notify(Mockito.any())).thenReturn(channelSendOperator); + FilteringNotifier filteringNotifier = new FilteringNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act + Mono actualDoNotifyResult = filteringNotifier + .doNotify(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L), null); + + // Assert + verify(delegate).notify(isA(InstanceEvent.class)); + assertSame(channelSendOperator, actualDoNotifyResult); + } + + /** + * Test {@link FilteringNotifier#addFilter(NotificationFilter)}. + *

+ * Method under test: {@link FilteringNotifier#addFilter(NotificationFilter)} + */ + @Test + public void testAddFilter() { + // Arrange + Notifier delegate = mock(Notifier.class); + FilteringNotifier filteringNotifier = new FilteringNotifier(delegate, + new EventsourcingInstanceRepository(new InMemoryEventStore())); + + // Act + filteringNotifier.addFilter(new ApplicationNameNotificationFilter("Application Name", + LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant())); + + // Assert + assertEquals(1, filteringNotifier.getNotificationFilters().size()); + } + + /** + * Test {@link FilteringNotifier#removeFilter(String)}. + *

+ * Method under test: {@link FilteringNotifier#removeFilter(String)} + */ + @Test + public void testRemoveFilter() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act and Assert + assertNull(new FilteringNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore())) + .removeFilter("42")); + } + + /** + * Test {@link FilteringNotifier#getNotificationFilters()}. + *

+ * Method under test: {@link FilteringNotifier#getNotificationFilters()} + */ + @Test + public void testGetNotificationFilters() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act and Assert + assertTrue(new FilteringNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore())) + .getNotificationFilters() + .isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/InstanceIdNotificationFilterDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/InstanceIdNotificationFilterDiffblueTest.java new file mode 100644 index 00000000000..0d8bcba976c --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/InstanceIdNotificationFilterDiffblueTest.java @@ -0,0 +1,60 @@ +package de.codecentric.boot.admin.server.notify.filter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import org.junit.Test; + +public class InstanceIdNotificationFilterDiffblueTest { + + /** + * Test + * {@link InstanceIdNotificationFilter#InstanceIdNotificationFilter(InstanceId, Instant)}. + *

+ * Method under test: + * {@link InstanceIdNotificationFilter#InstanceIdNotificationFilter(InstanceId, Instant)} + */ + @Test + public void testNewInstanceIdNotificationFilter() { + // Arrange + InstanceId instanceId = InstanceId.of("42"); + Instant expiry = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + InstanceIdNotificationFilter actualInstanceIdNotificationFilter = new InstanceIdNotificationFilter(instanceId, + expiry); + + // Assert + assertSame(instanceId, actualInstanceIdNotificationFilter.getInstanceId()); + Instant expectedExpiry = expiry.EPOCH; + assertSame(expectedExpiry, actualInstanceIdNotificationFilter.getExpiry()); + } + + /** + * Test getters and setters. + *

+ * Methods under test: + *

    + *
  • {@link InstanceIdNotificationFilter#toString()} + *
  • {@link InstanceIdNotificationFilter#getInstanceId()} + *
+ */ + @Test + public void testGettersAndSetters() { + // Arrange + InstanceId instanceId = InstanceId.of("42"); + InstanceIdNotificationFilter instanceIdNotificationFilter = new InstanceIdNotificationFilter(instanceId, + LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()); + + // Act + String actualToStringResult = instanceIdNotificationFilter.toString(); + + // Assert + assertEquals("NotificationFilter [instanceId=42, expiry=1970-01-01T00:00:00Z]", actualToStringResult); + assertSame(instanceId, instanceIdNotificationFilter.getInstanceId()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/web/NotificationFilterControllerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/web/NotificationFilterControllerDiffblueTest.java new file mode 100644 index 00000000000..52bf81d5474 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/filter/web/NotificationFilterControllerDiffblueTest.java @@ -0,0 +1,341 @@ +package de.codecentric.boot.admin.server.notify.filter.web; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.notify.Notifier; +import de.codecentric.boot.admin.server.notify.filter.ApplicationNameNotificationFilter; +import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier; +import de.codecentric.boot.admin.server.notify.filter.InstanceIdNotificationFilter; +import de.codecentric.boot.admin.server.notify.filter.NotificationFilter; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.Collection; +import java.util.HashMap; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@ContextConfiguration(classes = { NotificationFilterController.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class NotificationFilterControllerDiffblueTest { + + @MockitoBean + private FilteringNotifier filteringNotifier; + + @Autowired + private NotificationFilterController notificationFilterController; + + /** + * Test + * {@link NotificationFilterController#NotificationFilterController(FilteringNotifier)}. + *

+ * Method under test: + * {@link NotificationFilterController#NotificationFilterController(FilteringNotifier)} + */ + @Test + public void testNewNotificationFilterController() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act and Assert + assertTrue(new NotificationFilterController( + new FilteringNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore()))) + .getFilters() + .isEmpty()); + } + + /** + * Test {@link NotificationFilterController#getFilters()}. + *

+ * Method under test: {@link NotificationFilterController#getFilters()} + */ + @Test + public void testGetFilters() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act and Assert + assertTrue(new NotificationFilterController( + new FilteringNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore()))) + .getFilters() + .isEmpty()); + } + + /** + * Test {@link NotificationFilterController#getFilters()}. + *

    + *
  • Then calls {@link FilteringNotifier#getNotificationFilters()}.
  • + *
+ *

+ * Method under test: {@link NotificationFilterController#getFilters()} + */ + @Test + public void testGetFilters_thenCallsGetNotificationFilters() { + // Arrange + when(filteringNotifier.getNotificationFilters()).thenReturn(new HashMap<>()); + + // Act + Collection actualFilters = notificationFilterController.getFilters(); + + // Assert + verify(filteringNotifier).getNotificationFilters(); + assertTrue(actualFilters.isEmpty()); + } + + /** + * Test {@link NotificationFilterController#addFilter(String, String, Long)}. + *

+ * Method under test: + * {@link NotificationFilterController#addFilter(String, String, Long)} + */ + @Test + public void testAddFilter() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act and Assert + Object body = new NotificationFilterController( + new FilteringNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore()))) + .addFilter("42", "Name", 1L) + .getBody(); + assertTrue(body instanceof InstanceIdNotificationFilter); + InstanceId instanceId = ((InstanceIdNotificationFilter) body).getInstanceId(); + assertEquals("42", instanceId.getValue()); + assertEquals("42", instanceId.toString()); + } + + /** + * Test {@link NotificationFilterController#addFilter(String, String, Long)}. + *

    + *
  • Given {@link FilteringNotifier}.
  • + *
  • When {@code null}.
  • + *
  • Then StatusCode return {@link HttpStatus}.
  • + *
+ *

+ * Method under test: + * {@link NotificationFilterController#addFilter(String, String, Long)} + */ + @Test + public void testAddFilter_givenFilteringNotifier_whenNull_thenStatusCodeReturnHttpStatus() { + // Arrange and Act + ResponseEntity actualAddFilterResult = notificationFilterController.addFilter(null, null, null); + + // Assert + HttpStatusCode statusCode = actualAddFilterResult.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals("Either 'instanceId' or 'applicationName' must be set", actualAddFilterResult.getBody()); + assertEquals(400, actualAddFilterResult.getStatusCodeValue()); + assertEquals(HttpStatus.BAD_REQUEST, statusCode); + } + + /** + * Test {@link NotificationFilterController#addFilter(String, String, Long)}. + *

    + *
  • When {@code 42}.
  • + *
  • Then return Body InstanceId Value is {@code 42}.
  • + *
+ *

+ * Method under test: + * {@link NotificationFilterController#addFilter(String, String, Long)} + */ + @Test + public void testAddFilter_when42_thenReturnBodyInstanceIdValueIs42() { + // Arrange + doNothing().when(filteringNotifier).addFilter(Mockito.any()); + + // Act + ResponseEntity actualAddFilterResult = notificationFilterController.addFilter("42", "Name", 1L); + + // Assert + verify(filteringNotifier).addFilter(isA(NotificationFilter.class)); + Object body = actualAddFilterResult.getBody(); + assertTrue(body instanceof InstanceIdNotificationFilter); + InstanceId instanceId = ((InstanceIdNotificationFilter) body).getInstanceId(); + assertEquals("42", instanceId.getValue()); + assertEquals("42", instanceId.toString()); + } + + /** + * Test {@link NotificationFilterController#addFilter(String, String, Long)}. + *

    + *
  • When minus one.
  • + *
  • Then return Body Expiry is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link NotificationFilterController#addFilter(String, String, Long)} + */ + @Test + public void testAddFilter_whenMinusOne_thenReturnBodyExpiryIsNull() { + // Arrange + doNothing().when(filteringNotifier).addFilter(Mockito.any()); + + // Act + ResponseEntity actualAddFilterResult = notificationFilterController.addFilter("42", "Name", -1L); + + // Assert + verify(filteringNotifier).addFilter(isA(NotificationFilter.class)); + Object body = actualAddFilterResult.getBody(); + assertTrue(body instanceof InstanceIdNotificationFilter); + InstanceId instanceId = ((InstanceIdNotificationFilter) body).getInstanceId(); + assertEquals("42", instanceId.getValue()); + assertEquals("42", instanceId.toString()); + assertNull(((InstanceIdNotificationFilter) body).getExpiry()); + } + + /** + * Test {@link NotificationFilterController#addFilter(String, String, Long)}. + *

    + *
  • When {@code not blank}.
  • + *
  • Then return Body InstanceId Value is {@code not blank}.
  • + *
+ *

+ * Method under test: + * {@link NotificationFilterController#addFilter(String, String, Long)} + */ + @Test + public void testAddFilter_whenNotBlank_thenReturnBodyInstanceIdValueIsNotBlank() { + // Arrange + doNothing().when(filteringNotifier).addFilter(Mockito.any()); + + // Act + ResponseEntity actualAddFilterResult = notificationFilterController.addFilter("not blank", "not blank", + null); + + // Assert + verify(filteringNotifier).addFilter(isA(NotificationFilter.class)); + Object body = actualAddFilterResult.getBody(); + assertTrue(body instanceof InstanceIdNotificationFilter); + InstanceId instanceId = ((InstanceIdNotificationFilter) body).getInstanceId(); + assertEquals("not blank", instanceId.getValue()); + assertEquals("not blank", instanceId.toString()); + assertNull(((InstanceIdNotificationFilter) body).getExpiry()); + } + + /** + * Test {@link NotificationFilterController#addFilter(String, String, Long)}. + *

    + *
  • When space.
  • + *
  • Then Body return {@link ApplicationNameNotificationFilter}.
  • + *
+ *

+ * Method under test: + * {@link NotificationFilterController#addFilter(String, String, Long)} + */ + @Test + public void testAddFilter_whenSpace_thenBodyReturnApplicationNameNotificationFilter() { + // Arrange + doNothing().when(filteringNotifier).addFilter(Mockito.any()); + + // Act + ResponseEntity actualAddFilterResult = notificationFilterController.addFilter(" ", "Name", 1L); + + // Assert + verify(filteringNotifier).addFilter(isA(NotificationFilter.class)); + Object body = actualAddFilterResult.getBody(); + assertTrue(body instanceof ApplicationNameNotificationFilter); + assertEquals("Name", ((ApplicationNameNotificationFilter) body).getApplicationName()); + } + + /** + * Test {@link NotificationFilterController#deleteFilter(String)}. + *

+ * Method under test: {@link NotificationFilterController#deleteFilter(String)} + */ + @Test + public void testDeleteFilter() { + // Arrange + Notifier delegate = mock(Notifier.class); + + // Act + ResponseEntity actualDeleteFilterResult = new NotificationFilterController( + new FilteringNotifier(delegate, new EventsourcingInstanceRepository(new InMemoryEventStore()))) + .deleteFilter("42"); + + // Assert + HttpStatusCode statusCode = actualDeleteFilterResult.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertNull(actualDeleteFilterResult.getBody()); + assertEquals(404, actualDeleteFilterResult.getStatusCodeValue()); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertFalse(actualDeleteFilterResult.hasBody()); + assertTrue(actualDeleteFilterResult.getHeaders().isEmpty()); + } + + /** + * Test {@link NotificationFilterController#deleteFilter(String)}. + *

    + *
  • Given {@link FilteringNotifier} {@link FilteringNotifier#removeFilter(String)} + * return {@code null}.
  • + *
+ *

+ * Method under test: {@link NotificationFilterController#deleteFilter(String)} + */ + @Test + public void testDeleteFilter_givenFilteringNotifierRemoveFilterReturnNull() { + // Arrange + when(filteringNotifier.removeFilter(Mockito.any())).thenReturn(null); + + // Act + ResponseEntity actualDeleteFilterResult = notificationFilterController.deleteFilter("42"); + + // Assert + verify(filteringNotifier).removeFilter(eq("42")); + HttpStatusCode statusCode = actualDeleteFilterResult.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertNull(actualDeleteFilterResult.getBody()); + assertEquals(404, actualDeleteFilterResult.getStatusCodeValue()); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertFalse(actualDeleteFilterResult.hasBody()); + assertTrue(actualDeleteFilterResult.getHeaders().isEmpty()); + } + + /** + * Test {@link NotificationFilterController#deleteFilter(String)}. + *

    + *
  • Then return StatusCodeValue is two hundred.
  • + *
+ *

+ * Method under test: {@link NotificationFilterController#deleteFilter(String)} + */ + @Test + public void testDeleteFilter_thenReturnStatusCodeValueIsTwoHundred() { + // Arrange + when(filteringNotifier.removeFilter(Mockito.any())).thenReturn(new ApplicationNameNotificationFilter( + "Application Name", LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant())); + + // Act + ResponseEntity actualDeleteFilterResult = notificationFilterController.deleteFilter("42"); + + // Assert + verify(filteringNotifier).removeFilter(eq("42")); + HttpStatusCode statusCode = actualDeleteFilterResult.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertNull(actualDeleteFilterResult.getBody()); + assertEquals(200, actualDeleteFilterResult.getStatusCodeValue()); + assertEquals(HttpStatus.OK, statusCode); + assertFalse(actualDeleteFilterResult.hasBody()); + assertTrue(actualDeleteFilterResult.getHeaders().isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/AbstractEventHandlerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/AbstractEventHandlerDiffblueTest.java new file mode 100644 index 00000000000..87319d3aef2 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/AbstractEventHandlerDiffblueTest.java @@ -0,0 +1,270 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertFalse; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.notify.FeiShuNotifier; +import de.codecentric.boot.admin.server.notify.HazelcastNotificationTrigger; +import de.codecentric.boot.admin.server.notify.NotificationTrigger; +import de.codecentric.boot.admin.server.notify.Notifier; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@ContextConfiguration(classes = { NotificationTrigger.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class AbstractEventHandlerDiffblueTest { + + @Autowired + private AbstractEventHandler abstractEventHandler; + + @MockitoBean + private Notifier notifier; + + @MockitoBean + private Publisher publisher; + + /** + * Test {@link AbstractEventHandler#start()}. + *

    + *
  • Given {@link ArrayList#ArrayList()} addAll {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Function#apply(Object)}.
  • + *
+ *

+ * Method under test: {@link AbstractEventHandler#start()} + */ + @Test + public void testStart_givenArrayListAddAllArrayList_thenCallsApply() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + ArrayList events = new ArrayList<>(); + events.addAll(new ArrayList<>()); + + HazelcastEventStore events2 = new HazelcastEventStore(eventLogs); + events2.append(events); + Function function = mock(Function.class); + when(function.apply(Mockito.any())).thenReturn(1L); + + ConcurrentHashMap sentNotifications = new ConcurrentHashMap<>(); + sentNotifications.computeIfAbsent(InstanceId.of("42"), function); + + // Act + new HazelcastNotificationTrigger(mock(FeiShuNotifier.class), events2, sentNotifications).start(); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + verify(function).apply(isA(InstanceId.class)); + } + + /** + * Test {@link AbstractEventHandler#start()}. + *

    + *
  • Given {@link ConcurrentHashMap#ConcurrentHashMap()} IfAbsent {@link InstanceId} + * with value is {@code 42} is one.
  • + *
+ *

+ * Method under test: {@link AbstractEventHandler#start()} + */ + @Test + public void testStart_givenConcurrentHashMapIfAbsentInstanceIdWithValueIs42IsOne() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + ArrayList events = new ArrayList<>(); + events.addAll(new ArrayList<>()); + + HazelcastEventStore events2 = new HazelcastEventStore(eventLogs); + events2.append(events); + + ConcurrentHashMap sentNotifications = new ConcurrentHashMap<>(); + sentNotifications.putIfAbsent(InstanceId.of("42"), 1L); + sentNotifications.putAll(new HashMap<>()); + sentNotifications.computeIfAbsent(InstanceId.of("42"), mock(Function.class)); + + // Act + new HazelcastNotificationTrigger(mock(FeiShuNotifier.class), events2, sentNotifications).start(); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + } + + /** + * Test {@link AbstractEventHandler#start()}. + *

    + *
  • Given {@link Function} {@link Function#apply(Object)} return + * {@link Long#MAX_VALUE}.
  • + *
  • Then calls {@link Function#apply(Object)}.
  • + *
+ *

+ * Method under test: {@link AbstractEventHandler#start()} + */ + @Test + public void testStart_givenFunctionApplyReturnMax_value_thenCallsApply() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + HazelcastEventStore events = new HazelcastEventStore(eventLogs); + events.append(new ArrayList<>()); + Function function = mock(Function.class); + when(function.apply(Mockito.any())).thenReturn(Long.MAX_VALUE); + + ConcurrentHashMap sentNotifications = new ConcurrentHashMap<>(); + sentNotifications.computeIfAbsent(InstanceId.of("42"), function); + + // Act + new HazelcastNotificationTrigger(mock(FeiShuNotifier.class), events, sentNotifications).start(); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + verify(function).apply(isA(InstanceId.class)); + } + + /** + * Test {@link AbstractEventHandler#start()}. + *

    + *
  • Given {@link Function} {@link Function#apply(Object)} return one.
  • + *
  • Then calls {@link Function#apply(Object)}.
  • + *
+ *

+ * Method under test: {@link AbstractEventHandler#start()} + */ + @Test + public void testStart_givenFunctionApplyReturnOne_thenCallsApply() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + HazelcastEventStore events = new HazelcastEventStore(eventLogs); + events.append(new ArrayList<>()); + Function function = mock(Function.class); + when(function.apply(Mockito.any())).thenReturn(1L); + + ConcurrentHashMap sentNotifications = new ConcurrentHashMap<>(); + sentNotifications.computeIfAbsent(InstanceId.of("42"), function); + + // Act + new HazelcastNotificationTrigger(mock(FeiShuNotifier.class), events, sentNotifications).start(); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + verify(function).apply(isA(InstanceId.class)); + } + + /** + * Test {@link AbstractEventHandler#start()}. + *

    + *
  • Given {@link HazelcastEventStore#HazelcastEventStore(IMap)} with eventLogs is + * {@link IMap} append {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link AbstractEventHandler#start()} + */ + @Test + public void testStart_givenHazelcastEventStoreWithEventLogsIsIMapAppendArrayList() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + HazelcastEventStore events = new HazelcastEventStore(eventLogs); + events.append(new ArrayList<>()); + FeiShuNotifier notifier = mock(FeiShuNotifier.class); + + // Act + new HazelcastNotificationTrigger(notifier, events, new ConcurrentHashMap<>()).start(); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + } + + /** + * Test {@link AbstractEventHandler#start()}. + *

    + *
  • Given {@link HazelcastEventStore#HazelcastEventStore(IMap)} with eventLogs is + * {@link IMap}.
  • + *
  • Then calls {@link IMap#addEntryListener(MapListener, boolean)}.
  • + *
+ *

+ * Method under test: {@link AbstractEventHandler#start()} + */ + @Test + public void testStart_givenHazelcastEventStoreWithEventLogsIsIMap_thenCallsAddEntryListener() { + // Arrange + IMap> eventLogs = mock(IMap.class); + when(eventLogs.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + HazelcastEventStore events = new HazelcastEventStore(eventLogs); + FeiShuNotifier notifier = mock(FeiShuNotifier.class); + + // Act + new HazelcastNotificationTrigger(notifier, events, new ConcurrentHashMap<>()).start(); + + // Assert + verify(eventLogs).addEntryListener(isA(MapListener.class), eq(true)); + } + + /** + * Test {@link AbstractEventHandler#start()}. + *

    + *
  • Given {@link InMemoryEventStore#InMemoryEventStore()} append + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Function#apply(Object)}.
  • + *
+ *

+ * Method under test: {@link AbstractEventHandler#start()} + */ + @Test + public void testStart_givenInMemoryEventStoreAppendArrayList_thenCallsApply() { + // Arrange + InMemoryEventStore events = new InMemoryEventStore(); + events.append(new ArrayList<>()); + Function function = mock(Function.class); + when(function.apply(Mockito.any())).thenReturn(Long.MAX_VALUE); + + ConcurrentHashMap sentNotifications = new ConcurrentHashMap<>(); + sentNotifications.computeIfAbsent(InstanceId.of("42"), function); + + // Act + new HazelcastNotificationTrigger(mock(FeiShuNotifier.class), events, sentNotifications).start(); + + // Assert + verify(function).apply(isA(InstanceId.class)); + } + + /** + * Test {@link AbstractEventHandler#createScheduler()}. + *

+ * Method under test: {@link AbstractEventHandler#createScheduler()} + */ + @Test + public void testCreateScheduler() { + // Arrange, Act and Assert + assertFalse(abstractEventHandler.createScheduler().isDisposed()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/ApiMediaTypeHandlerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/ApiMediaTypeHandlerDiffblueTest.java new file mode 100644 index 00000000000..ab02d5109de --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/ApiMediaTypeHandlerDiffblueTest.java @@ -0,0 +1,27 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertFalse; +import org.junit.Test; +import org.springframework.http.MediaType; + +public class ApiMediaTypeHandlerDiffblueTest { + + /** + * Test {@link ApiMediaTypeHandler#isApiMediaType(MediaType)}. + *

    + *
  • When {@link MediaType#MediaType(String)} with {@code Type}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link ApiMediaTypeHandler#isApiMediaType(MediaType)} + */ + @Test + public void testIsApiMediaType_whenMediaTypeWithType_thenReturnFalse() { + // Arrange + ApiMediaTypeHandler apiMediaTypeHandler = new ApiMediaTypeHandler(); + + // Act and Assert + assertFalse(apiMediaTypeHandler.isApiMediaType(new MediaType("Type"))); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/ApplicationRegistryDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/ApplicationRegistryDiffblueTest.java new file mode 100644 index 00000000000..5c4e0d0fd98 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/ApplicationRegistryDiffblueTest.java @@ -0,0 +1,1112 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.Application; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.publisher.DirectProcessor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.GroupedFlux; +import reactor.core.publisher.Mono; +import reactor.core.publisher.UnicastProcessor; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { ApplicationRegistry.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class ApplicationRegistryDiffblueTest { + + @Autowired + private ApplicationRegistry applicationRegistry; + + @MockitoBean + private InstanceEventPublisher instanceEventPublisher; + + @MockitoBean + private InstanceRegistry instanceRegistry; + + /** + * Test + * {@link ApplicationRegistry#ApplicationRegistry(InstanceRegistry, InstanceEventPublisher)}. + *

+ * Method under test: + * {@link ApplicationRegistry#ApplicationRegistry(InstanceRegistry, InstanceEventPublisher)} + */ + @Test + public void testNewApplicationRegistry() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationRegistry( + new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.getApplications()); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(); + verify(flux).filter(isA(Predicate.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return {@link Flux}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenFluxFlatMapReturnFlux_thenCallsFlatMap() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function, int)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function, int)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap() + throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any(), anyInt())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + when(instanceRegistry.getInstances()).thenReturn(flux3); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.getApplications()); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(); + verify(flux3).filter(isA(Predicate.class)); + verify(flux).flatMap(isA(Function.class), eq(2147483647)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap2() + throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenFluxGroupByReturnFromIterableArrayList_thenCallsFilter() + throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + when(instanceRegistry.getInstances()).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.getApplications()); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link ConcurrentMapEventStore#findAll()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenFluxGroupByReturnFromIterableArrayList_thenCallsFindAll() + throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances()} return + * create.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenInstanceRegistryGetInstancesReturnCreate() { + // Arrange + DirectProcessor createResult = DirectProcessor.create(); + when(instanceRegistry.getInstances()).thenReturn(createResult); + + // Act + applicationRegistry.getApplications(); + + // Assert + verify(instanceRegistry).getInstances(); + } + + /** + * Test {@link ApplicationRegistry#getApplications()}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances()} return + * fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplications()} + */ + @Test + public void testGetApplications_givenInstanceRegistryGetInstancesReturnFromIterableArrayList() + throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.getApplications()); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplication("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationRegistry( + new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplication("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux2); + + // Act + applicationRegistry.getApplication("Name"); + + // Assert + verify(instanceRegistry).getInstances(eq("Name")); + verify(flux).collectList(); + verify(flux2).filter(isA(Predicate.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenFluxFilterReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.getApplication("Name")); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Name")); + verify(flux).filter(isA(Predicate.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return {@link Flux}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenFluxFlatMapReturnFlux_thenCallsFlatMap() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplication("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return {@link Flux}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenFluxFlatMapReturnFlux_thenCallsFlatMap2() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux> flux3 = mock(Flux.class); + when(flux3.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.groupBy(Mockito.>any())).thenReturn(flux3); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux4); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplication("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux3).flatMap(isA(Function.class)); + verify(flux4).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap() + throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplication("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act + new ApplicationRegistry(new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), mock(InstanceEventPublisher.class)) + .getApplication("Name"); + + // Assert + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .getApplication("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances(String)} + * return create.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenInstanceRegistryGetInstancesReturnCreate() { + // Arrange + DirectProcessor createResult = DirectProcessor.create(); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(createResult); + + // Act + applicationRegistry.getApplication("Name"); + + // Assert + verify(instanceRegistry).getInstances(eq("Name")); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances(String)} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenInstanceRegistryGetInstancesReturnFromIterableArrayList() { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(fromIterableResult); + + // Act + applicationRegistry.getApplication("Name"); + + // Assert + verify(instanceRegistry).getInstances(eq("Name")); + } + + /** + * Test {@link ApplicationRegistry#getApplication(String)}. + *

    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#map(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getApplication(String)} + */ + @Test + public void testGetApplication_givenMonoMapReturnJustData_thenCallsMap() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.getApplication("Name")); + createResult.expectError().verify(); + verify(instanceRegistry).getInstances(eq("Name")); + verify(flux).collectList(); + verify(flux2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .deregister("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationRegistry( + new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .deregister("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return {@link Flux}.
  • + *
  • When {@code Name}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_givenFluxFilterReturnFlux_whenName_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux> flux3 = mock(Flux.class); + when(flux3.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.groupBy(Mockito.>any())).thenReturn(flux3); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux4); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .deregister("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux3).flatMap(isA(Function.class)); + verify(flux4).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .deregister("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return create.
  • + *
  • When empty string.
  • + *
  • Then return create.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_givenFluxFlatMapReturnCreate_whenEmptyString_thenReturnCreate() { + // Arrange + Flux flux = mock(Flux.class); + UnicastProcessor createResult = UnicastProcessor.create(); + when(flux.flatMap(Mockito.>>any())).thenReturn(createResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + + // Act + Flux actualDeregisterResult = applicationRegistry.deregister(""); + + // Assert + verify(instanceRegistry).getInstances(eq("")); + verify(flux).flatMap(isA(Function.class)); + assertSame(createResult, actualDeregisterResult); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_givenFluxFlatMapReturnFromIterableArrayList_thenCallsGroupBy() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .deregister("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .deregister("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)) + .deregister("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances(String)} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_givenInstanceRegistryGetInstancesReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.deregister("Name")); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Name")); + } + + /** + * Test {@link ApplicationRegistry#deregister(String)}. + *

    + *
  • Then return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#deregister(String)} + */ + @Test + public void testDeregister_thenReturnFromIterableArrayList() { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + + // Act + Flux actualDeregisterResult = applicationRegistry.deregister("Name"); + + // Assert + verify(instanceRegistry).getInstances(eq("Name")); + verify(flux).flatMap(isA(Function.class)); + assertSame(fromIterableResult, actualDeregisterResult); + } + + /** + * Test {@link ApplicationRegistry#toApplication(String, Flux)}. + *
    + *
  • Given just {@link ArrayList#ArrayList()}.
  • + *
  • When {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#toApplication(String, Flux)} + */ + @Test + public void testToApplication_givenJustArrayList_whenFluxCollectListReturnJustArrayList() throws AssertionError { + // Arrange + Flux instances = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(instances.collectList()).thenReturn(justResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.toApplication("Name", instances)); + createResult.assertNext(a -> { + Application application = a; + assertNull(application.getBuildVersion()); + assertTrue(application.getInstances().isEmpty()); + assertEquals("Name", application.getName()); + assertEquals("UNKNOWN", application.getStatus()); + Instant statusTimestamp = application.getStatusTimestamp(); + assertEquals(0L, statusTimestamp.getEpochSecond()); + assertEquals(0, statusTimestamp.getNano()); + return; + }).expectComplete().verify(); + verify(instances).collectList(); + } + + /** + * Test {@link ApplicationRegistry#toApplication(String, Flux)}. + *

    + *
  • When fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#toApplication(String, Flux)} + */ + @Test + public void testToApplication_whenFromIterableArrayList() throws AssertionError { + // Arrange + Flux instances = Flux.fromIterable(new ArrayList<>()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationRegistry.toApplication("Name", instances)); + createResult.assertNext(a -> { + Application application = a; + assertNull(application.getBuildVersion()); + assertTrue(application.getInstances().isEmpty()); + assertEquals("Name", application.getName()); + assertEquals("UNKNOWN", application.getStatus()); + Instant statusTimestamp = application.getStatusTimestamp(); + assertEquals(0L, statusTimestamp.getEpochSecond()); + assertEquals(0, statusTimestamp.getNano()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link ApplicationRegistry#getBuildVersion(List)}. + *

+ * Method under test: {@link ApplicationRegistry#getBuildVersion(List)} + */ + @Test + public void testGetBuildVersion() { + // Arrange, Act and Assert + assertNull(applicationRegistry.getBuildVersion(new ArrayList<>())); + } + + /** + * Test {@link ApplicationRegistry#getStatus(List)}. + *

+ * Method under test: {@link ApplicationRegistry#getStatus(List)} + */ + @Test + public void testGetStatus() { + // Arrange, Act and Assert + List toListResult = applicationRegistry.getStatus(new ArrayList<>()).toList(); + assertEquals(2, toListResult.size()); + Object getResult = toListResult.get(1); + assertTrue(getResult instanceof Instant); + assertEquals("UNKNOWN", toListResult.get(0)); + assertEquals(0, ((Instant) getResult).getNano()); + assertEquals(0L, ((Instant) getResult).getEpochSecond()); + } + + /** + * Test {@link ApplicationRegistry#getMax(Instant, Instant)}. + *
    + *
  • When {@link LocalDate} with {@code 1970} and one and one atStartOfDay atZone + * {@link ZoneOffset#UTC} toInstant.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getMax(Instant, Instant)} + */ + @Test + public void testGetMax_whenLocalDateWith1970AndOneAndOneAtStartOfDayAtZoneUtcToInstant() { + // Arrange + Instant t1 = LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + Instant actualMax = applicationRegistry.getMax(t1, + LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()); + + // Assert + assertSame(actualMax.EPOCH, actualMax); + } + + /** + * Test {@link ApplicationRegistry#getMax(Instant, Instant)}. + *

    + *
  • When ofYearDay one and one atStartOfDay atZone {@link ZoneOffset#UTC} + * toInstant.
  • + *
+ *

+ * Method under test: {@link ApplicationRegistry#getMax(Instant, Instant)} + */ + @Test + public void testGetMax_whenOfYearDayOneAndOneAtStartOfDayAtZoneUtcToInstant() { + // Arrange + Instant t1 = LocalDate.ofYearDay(1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant(); + + // Act + Instant actualMax = applicationRegistry.getMax(t1, + LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()); + + // Assert + assertSame(actualMax.EPOCH, actualMax); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/CloudFoundryInstanceIdGeneratorDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/CloudFoundryInstanceIdGeneratorDiffblueTest.java new file mode 100644 index 00000000000..96f1e94b9aa --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/CloudFoundryInstanceIdGeneratorDiffblueTest.java @@ -0,0 +1,114 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class CloudFoundryInstanceIdGeneratorDiffblueTest { + + @InjectMocks + private CloudFoundryInstanceIdGenerator cloudFoundryInstanceIdGenerator; + + @Mock + private InstanceIdGenerator instanceIdGenerator; + + /** + * Test {@link CloudFoundryInstanceIdGenerator#generateId(Registration)}. + *

+ * Method under test: {@link CloudFoundryInstanceIdGenerator#generateId(Registration)} + */ + @Test + public void testGenerateId() { + // Arrange + InstanceIdGenerator fallbackIdGenerator = mock(InstanceIdGenerator.class); + InstanceId ofResult = InstanceId.of("42"); + when(fallbackIdGenerator.generateId(Mockito.any())).thenReturn(ofResult); + CloudFoundryInstanceIdGenerator cloudFoundryInstanceIdGenerator = new CloudFoundryInstanceIdGenerator( + new CloudFoundryInstanceIdGenerator(fallbackIdGenerator)); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act + InstanceId actualGenerateIdResult = cloudFoundryInstanceIdGenerator.generateId(registration); + + // Assert + verify(fallbackIdGenerator).generateId(isA(Registration.class)); + assertSame(ofResult, actualGenerateIdResult); + } + + /** + * Test {@link CloudFoundryInstanceIdGenerator#generateId(Registration)}. + *

    + *
  • Then return {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link CloudFoundryInstanceIdGenerator#generateId(Registration)} + */ + @Test + public void testGenerateId_thenReturnInstanceIdWithValueIs42() { + // Arrange + InstanceId ofResult = InstanceId.of("42"); + when(instanceIdGenerator.generateId(Mockito.any())).thenReturn(ofResult); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act + InstanceId actualGenerateIdResult = cloudFoundryInstanceIdGenerator.generateId(registration); + + // Assert + verify(instanceIdGenerator).generateId(isA(Registration.class)); + assertSame(ofResult, actualGenerateIdResult); + } + + /** + * Test {@link CloudFoundryInstanceIdGenerator#generateId(Registration)}. + *

    + *
  • Then return Value is {@code 504149e8a3fa}.
  • + *
+ *

+ * Method under test: {@link CloudFoundryInstanceIdGenerator#generateId(Registration)} + */ + @Test + public void testGenerateId_thenReturnValueIs504149e8a3fa() { + // Arrange + CloudFoundryInstanceIdGenerator cloudFoundryInstanceIdGenerator = new CloudFoundryInstanceIdGenerator( + new HashingInstanceUrlIdGenerator()); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act + InstanceId actualGenerateIdResult = cloudFoundryInstanceIdGenerator.generateId(registration); + + // Assert + assertEquals("504149e8a3fa", actualGenerateIdResult.getValue()); + assertEquals("504149e8a3fa", actualGenerateIdResult.toString()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/EndpointDetectionTriggerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/EndpointDetectionTriggerDiffblueTest.java new file mode 100644 index 00000000000..24aac5604a5 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/EndpointDetectionTriggerDiffblueTest.java @@ -0,0 +1,1475 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import com.sun.security.auth.UserPrincipal; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceDeregisteredEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.notify.PagerdutyNotifier; +import de.codecentric.boot.admin.server.services.endpoints.EndpointDetectionStrategy; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.ClientEndpointConfig.Builder; +import jakarta.websocket.ClientEndpointConfig.Configurator; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Extension; +import java.security.NoSuchAlgorithmException; +import java.security.Principal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.net.ssl.SSLContext; +import org.apache.tomcat.InstanceManager; +import org.apache.tomcat.websocket.AsyncChannelWrapperNonSecure; +import org.apache.tomcat.websocket.EndpointClassHolder; +import org.apache.tomcat.websocket.EndpointHolder; +import org.apache.tomcat.websocket.WsRemoteEndpointImplClient; +import org.apache.tomcat.websocket.WsSession; +import org.apache.tomcat.websocket.WsWebSocketContainer; +import org.apache.tomcat.websocket.pojo.PojoEndpointServer; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.buffer.DataBufferFactory; +import org.springframework.core.io.buffer.DefaultDataBufferFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.reactive.socket.HandshakeInfo; +import org.springframework.web.reactive.socket.adapter.StandardWebSocketSession; +import reactor.core.Scannable; +import reactor.core.publisher.DirectProcessor; +import reactor.core.publisher.EmitterProcessor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { EndpointDetectionTrigger.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class EndpointDetectionTriggerDiffblueTest { + + @Autowired + private EndpointDetectionTrigger endpointDetectionTrigger; + + @MockitoBean + private EndpointDetector endpointDetector; + + @MockitoBean + private Publisher publisher; + + /** + * Test + * {@link EndpointDetectionTrigger#EndpointDetectionTrigger(EndpointDetector, Publisher)}. + *

+ * Method under test: + * {@link EndpointDetectionTrigger#EndpointDetectionTrigger(EndpointDetector, Publisher)} + */ + @Test + public void testNewEndpointDetectionTrigger() { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new EventsourcingInstanceRepository(new InMemoryEventStore(3)), mock(EndpointDetectionStrategy.class)); + + IMap> eventLog = mock(IMap.class); + when(eventLog.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + // Act + new EndpointDetectionTrigger(endpointDetector, new HazelcastEventStore(Integer.MIN_VALUE, eventLog)); + + // Assert + verify(eventLog).addEntryListener(isA(MapListener.class), eq(true)); + } + + /** + * Test + * {@link EndpointDetectionTrigger#EndpointDetectionTrigger(EndpointDetector, Publisher)}. + *

+ * Method under test: + * {@link EndpointDetectionTrigger#EndpointDetectionTrigger(EndpointDetector, Publisher)} + */ + @Test + public void testNewEndpointDetectionTrigger2() { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new EventsourcingInstanceRepository(new InMemoryEventStore(Integer.MIN_VALUE)), + mock(EndpointDetectionStrategy.class)); + + IMap> eventLog = mock(IMap.class); + when(eventLog.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + + // Act + new EndpointDetectionTrigger(endpointDetector, new HazelcastEventStore(1, eventLog)); + + // Assert + verify(eventLog).addEntryListener(isA(MapListener.class), eq(true)); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Function, Publisher> writeFunction = mock(Function.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(writeFunction.apply(Mockito.>any())).thenReturn(fromIterableResult); + Flux source = Flux.fromIterable(new ArrayList<>()); + when(endpointDetector.detectEndpoints(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, writeFunction)); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult2 = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult2); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(writeFunction).apply(isA(Publisher.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle2() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Function, Publisher> writeFunction = mock(Function.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(writeFunction.apply(Mockito.>any())).thenReturn(fromIterableResult); + Mono source = Mono.just("Data"); + when(endpointDetector.detectEndpoints(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, writeFunction)); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult2 = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult2); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(writeFunction).apply(isA(Publisher.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle3() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Publisher source = mock(Publisher.class); + doNothing().when(source).subscribe(Mockito.>any()); + when(endpointDetector.detectEndpoints(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(source).subscribe(isA(Subscriber.class)); + verify(publisher2).filter(isA(Predicate.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle4() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Function, Publisher> writeFunction = mock(Function.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(writeFunction.apply(Mockito.>any())).thenReturn(fromIterableResult); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(new ChannelSendOperator<>(source, writeFunction)); + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(channelSendOperator); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult2 = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult2); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(writeFunction).apply(isA(Publisher.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle5() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Function, Publisher> writeFunction = mock(Function.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(writeFunction.apply(Mockito.>any())).thenReturn(fromIterableResult); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator source2 = new ChannelSendOperator<>(source, writeFunction); + + Function, Publisher> writeFunction2 = mock(Function.class); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(writeFunction2.apply(Mockito.>any())).thenReturn(fromIterableResult2); + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(new ChannelSendOperator<>(source2, writeFunction2)); + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(channelSendOperator); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult3 = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult3); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(writeFunction).apply(isA(Publisher.class)); + verify(writeFunction2).apply(isA(Publisher.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle6() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Function, Publisher> writeFunction = mock(Function.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(writeFunction.apply(Mockito.>any())).thenReturn(fromIterableResult); + Mono source = Mono.just("Data"); + ChannelSendOperator source2 = new ChannelSendOperator<>(source, writeFunction); + + Function, Publisher> writeFunction2 = mock(Function.class); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(writeFunction2.apply(Mockito.>any())).thenReturn(fromIterableResult2); + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(new ChannelSendOperator<>(source2, writeFunction2)); + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(channelSendOperator); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult3 = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult3); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(writeFunction).apply(isA(Publisher.class)); + verify(writeFunction2).apply(isA(Publisher.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle7() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + when(channelSendOperator.onErrorResume(Mockito.>>any())).thenReturn( + new ChannelSendOperator<>(new ChannelSendOperator<>(new InMemoryEventStore(), mock(Function.class)), + mock(Function.class))); + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(channelSendOperator); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle8() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Function, Publisher> writeFunction = mock(Function.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(writeFunction.apply(Mockito.>any())).thenReturn(fromIterableResult); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator source2 = new ChannelSendOperator<>(source, writeFunction); + + Function, Publisher> writeFunction2 = mock(Function.class); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(writeFunction2.apply(Mockito.>any())).thenReturn(fromIterableResult2); + ChannelSendOperator source3 = new ChannelSendOperator<>(source2, writeFunction2); + + Function, Publisher> writeFunction3 = mock(Function.class); + Flux fromIterableResult3 = Flux.fromIterable(new ArrayList<>()); + when(writeFunction3.apply(Mockito.>any())).thenReturn(fromIterableResult3); + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(new ChannelSendOperator<>(source3, writeFunction3)); + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(channelSendOperator); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult4 = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult4); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(writeFunction).apply(isA(Publisher.class)); + verify(writeFunction2).apply(isA(Publisher.class)); + verify(writeFunction3).apply(isA(Publisher.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle9() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Publisher source = mock(Publisher.class); + doNothing().when(source).subscribe(Mockito.>any()); + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(new ChannelSendOperator<>(new ChannelSendOperator<>( + new ChannelSendOperator<>(new ChannelSendOperator<>(source, mock(Function.class)), + mock(Function.class)), + mock(Function.class)), mock(Function.class))); + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(channelSendOperator); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(source).subscribe(isA(Subscriber.class)); + verify(publisher2).filter(isA(Predicate.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle10() { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + Flux publisher2 = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult); + + // Act + endpointDetectionTrigger.handle(publisher2); + + // Assert + verify(publisher2).filter(isA(Predicate.class)); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code 42}.
  • + *
  • Then calls {@link Function#apply(Object)}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_givenArrayListAdd42_thenCallsApply() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + ArrayList it = new ArrayList<>(); + it.add("42"); + Flux source = Flux.fromIterable(it); + Function, Publisher> writeFunction = mock(Function.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(writeFunction.apply(Mockito.>any())).thenReturn(fromIterableResult); + when(endpointDetector.detectEndpoints(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, writeFunction)); + + ArrayList it2 = new ArrayList<>(); + it2.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult2 = Flux.fromIterable(it2); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult2); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(writeFunction).apply(isA(Publisher.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *
    + *
  • Given {@link EndpointDetector}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_givenEndpointDetector() throws DeploymentException, NoSuchAlgorithmException { + // Arrange + Flux publisher2 = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

    + *
  • Given {@link EndpointDetector} + * {@link EndpointDetector#detectEndpoints(InstanceId)} return {@code null}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_givenEndpointDetectorDetectEndpointsReturnNull() + throws DeploymentException, NoSuchAlgorithmException { + // Arrange + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(null); + + ArrayList it = new ArrayList<>(); + it.add(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + Flux fromIterableResult = Flux.fromIterable(it); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(fromIterableResult); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(clientEndpointHolder).getInstance(isNull()); + verify(publisher2).filter(isA(Predicate.class)); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

    + *
  • Given {@link EndpointDetector}.
  • + *
  • When create.
  • + *
  • Then create Error is {@code null}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_givenEndpointDetector_whenCreate_thenCreateErrorIsNull() + throws DeploymentException, NoSuchAlgorithmException { + // Arrange + DirectProcessor publisher2 = DirectProcessor.create(); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointHolder clientEndpointHolder = new EndpointHolder(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertNull(publisher2.getError()); + assertFalse(publisher2.isDisposed()); + assertFalse(publisher2.isTerminated()); + assertFalse(publisher2.hasCompleted()); + assertFalse(publisher2.hasError()); + assertFalse(publisher2.isSerialized()); + Stream actualsResult = publisher2.actuals(); + assertTrue(actualsResult.limit(5).collect(Collectors.toList()).isEmpty()); + Stream parentsResult = publisher2.parents(); + assertTrue(parentsResult.limit(5).collect(Collectors.toList()).isEmpty()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertTrue(publisher2.isScanAvailable()); + assertTrue(publisher2.hasDownstreams()); + assertEquals(Integer.MAX_VALUE, publisher2.getPrefetch()); + assertEquals(Integer.MAX_VALUE, publisher2.getBufferSize()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

    + *
  • Given {@link EndpointDetector}.
  • + *
  • When fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_givenEndpointDetector_whenFromIterableArrayList() throws AssertionError { + // Arrange + Flux publisher2 = Flux.fromIterable(new ArrayList<>()); + + // Act + endpointDetectionTrigger.handle(publisher2); + + // Assert that nothing has changed + FirstStep createResult = StepVerifier.create(publisher2); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

    + *
  • Given {@link EndpointDetector}.
  • + *
  • When fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_givenEndpointDetector_whenFromIterableArrayList2() + throws DeploymentException, AssertionError, NoSuchAlgorithmException { + // Arrange + Flux publisher2 = Flux.fromIterable(new ArrayList<>()); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(clientEndpointHolder).getInstance(isNull()); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertFalse(bufferFactoryResult.isDirect()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + FirstStep createResult2 = StepVerifier.create(publisher2); + createResult2.expectComplete().verify(); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *

    + *
  • Then return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_thenReturnFromIterableArrayList() { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + Flux publisher2 = mock(Flux.class); + when(publisher2.filter(Mockito.>any())).thenReturn(flux); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + + // Assert + verify(publisher2).filter(isA(Predicate.class)); + verify(flux).flatMap(isA(Function.class)); + assertSame(fromIterableResult, actualHandleResult); + } + + /** + * Test {@link EndpointDetectionTrigger#handle(Flux)}. + *
    + *
  • When create three and {@code true}.
  • + *
  • Then create three and {@code true} Pending is zero.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#handle(Flux)} + */ + @Test + public void testHandle_whenCreateThreeAndTrue_thenCreateThreeAndTruePendingIsZero() + throws DeploymentException, NoSuchAlgorithmException { + // Arrange + EmitterProcessor publisher2 = EmitterProcessor.create(3, true); + + // Act + Publisher actualHandleResult = endpointDetectionTrigger.handle(publisher2); + EndpointClassHolder clientEndpointHolder = mock(EndpointClassHolder.class); + when(clientEndpointHolder.getInstance(Mockito.any())) + .thenReturn(new PojoEndpointServer(new HashMap<>(), "Pojo")); + WsRemoteEndpointImplClient wsRemoteEndpoint = new WsRemoteEndpointImplClient( + new AsyncChannelWrapperNonSecure(null)); + WsWebSocketContainer wsWebSocketContainer = new WsWebSocketContainer(); + ArrayList negotiatedExtensions = new ArrayList<>(); + HashMap pathParameters = new HashMap<>(); + Builder createResult = Builder.create(); + Builder configuratorResult = createResult.configurator(new Configurator()); + Builder decodersResult = configuratorResult.decoders(new ArrayList<>()); + Builder encodersResult = decodersResult.encoders(new ArrayList<>()); + Builder extensionsResult = encodersResult.extensions(new ArrayList<>()); + Builder preferredSubprotocolsResult = extensionsResult.preferredSubprotocols(new ArrayList<>()); + ClientEndpointConfig clientEndpointConfig = preferredSubprotocolsResult.sslContext(SSLContext.getDefault()) + .build(); + WsSession session = new WsSession(clientEndpointHolder, wsRemoteEndpoint, wsWebSocketContainer, + negotiatedExtensions, "Sub Protocol", pathParameters, true, clientEndpointConfig); + + HttpHeaders headers = new HttpHeaders(); + Mono principal = Mono.just(new UserPrincipal("data")); + HandshakeInfo info = new HandshakeInfo(PagerdutyNotifier.DEFAULT_URI, headers, principal, "Protocol"); + + DefaultDataBufferFactory factory = new DefaultDataBufferFactory(); + StandardWebSocketSession standardWebSocketSession = new StandardWebSocketSession(session, info, factory); + + actualHandleResult.subscribe(standardWebSocketSession); + + // Assert that nothing has changed + verify(clientEndpointHolder).getInstance(isNull()); + DataBufferFactory bufferFactoryResult = standardWebSocketSession.bufferFactory(); + assertTrue(bufferFactoryResult instanceof DefaultDataBufferFactory); + assertEquals(0, publisher2.getPending()); + assertEquals(3, publisher2.getBufferSize()); + assertEquals(3, publisher2.getPrefetch()); + assertFalse(publisher2.isDisposed()); + assertFalse(publisher2.isTerminated()); + assertFalse(publisher2.hasCompleted()); + assertFalse(publisher2.hasError()); + assertFalse(publisher2.isSerialized()); + Stream actualsResult = publisher2.actuals(); + assertTrue(actualsResult.limit(5).collect(Collectors.toList()).isEmpty()); + Stream parentsResult = publisher2.parents(); + assertTrue(parentsResult.limit(5).collect(Collectors.toList()).isEmpty()); + assertTrue(standardWebSocketSession.getAttributes().isEmpty()); + assertTrue(standardWebSocketSession.isOpen()); + assertTrue(publisher2.isScanAvailable()); + assertSame(factory, bufferFactoryResult); + assertSame(info, standardWebSocketSession.getHandshakeInfo()); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints() { + // Arrange + Flux source = Flux.fromIterable(new ArrayList<>()); + when(endpointDetector.detectEndpoints(Mockito.any())) + .thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + + // Act + endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints2() { + // Arrange + ChannelSendOperator channelSendOperator = mock(ChannelSendOperator.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator2 = new ChannelSendOperator<>(source, mock(Function.class)); + + when(channelSendOperator.onErrorResume(Mockito.>>any())) + .thenReturn(channelSendOperator2); + when(endpointDetector.detectEndpoints(Mockito.any())).thenReturn(channelSendOperator); + + // Act + Mono actualDetectEndpointsResult = endpointDetectionTrigger + .detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(endpointDetector).detectEndpoints(isA(InstanceId.class)); + verify(channelSendOperator).onErrorResume(isA(Function.class)); + assertSame(channelSendOperator2, actualDetectEndpointsResult); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints3() throws AssertionError { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints4() throws AssertionError { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new SnapshottingInstanceRepository(new InMemoryEventStore()), mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() + throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *

    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#map(Function)}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints_givenMonoMapReturnJustData_thenCallsMap() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)}. + *
    + *
  • Then calls + * {@link EventsourcingInstanceRepository#computeIfPresent(InstanceId, BiFunction)}.
  • + *
+ *

+ * Method under test: {@link EndpointDetectionTrigger#detectEndpoints(InstanceEvent)} + */ + @Test + public void testDetectEndpoints_thenCallsComputeIfPresent() { + // Arrange + Mono mono = mock(Mono.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + when(mono.then()).thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + EventsourcingInstanceRepository repository = mock(EventsourcingInstanceRepository.class); + when(repository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + EndpointDetector endpointDetector = new EndpointDetector(repository, mock(EndpointDetectionStrategy.class)); + + Flux publisher = Flux.fromIterable(new ArrayList<>()); + EndpointDetectionTrigger endpointDetectionTrigger = new EndpointDetectionTrigger(endpointDetector, publisher); + + // Act + endpointDetectionTrigger.detectEndpoints(new InstanceDeregisteredEvent(InstanceId.of("42"), 1L)); + + // Assert + verify(repository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/EndpointDetectorDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/EndpointDetectorDiffblueTest.java new file mode 100644 index 00000000000..9f67be842ef --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/EndpointDetectorDiffblueTest.java @@ -0,0 +1,227 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertSame; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.services.endpoints.EndpointDetectionStrategy; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { EndpointDetector.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class EndpointDetectorDiffblueTest { + + @MockitoBean + private EndpointDetectionStrategy endpointDetectionStrategy; + + @Autowired + private EndpointDetector endpointDetector; + + @MockitoBean + private InstanceRepository instanceRepository; + + /** + * Test {@link EndpointDetector#detectEndpoints(InstanceId)}. + *

+ * Method under test: {@link EndpointDetector#detectEndpoints(InstanceId)} + */ + @Test + public void testDetectEndpoints() { + // Arrange + Mono mono = mock(Mono.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + when(mono.then()).thenReturn(channelSendOperator); + when(instanceRepository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + + // Act + Mono actualDetectEndpointsResult = endpointDetector.detectEndpoints(InstanceId.of("42")); + + // Assert + verify(instanceRepository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + assertSame(channelSendOperator, actualDetectEndpointsResult); + } + + /** + * Test {@link EndpointDetector#detectEndpoints(InstanceId)}. + *

+ * Method under test: {@link EndpointDetector#detectEndpoints(InstanceId)} + */ + @Test + public void testDetectEndpoints2() throws AssertionError { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(EndpointDetectionStrategy.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(endpointDetector.detectEndpoints(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EndpointDetector#detectEndpoints(InstanceId)}. + *

+ * Method under test: {@link EndpointDetector#detectEndpoints(InstanceId)} + */ + @Test + public void testDetectEndpoints3() throws AssertionError { + // Arrange + EndpointDetector endpointDetector = new EndpointDetector( + new SnapshottingInstanceRepository(new InMemoryEventStore()), mock(EndpointDetectionStrategy.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(endpointDetector.detectEndpoints(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link EndpointDetector#detectEndpoints(InstanceId)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link EndpointDetector#detectEndpoints(InstanceId)} + */ + @Test + public void testDetectEndpoints_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() + throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(endpointDetector.detectEndpoints(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + } + + /** + * Test {@link EndpointDetector#detectEndpoints(InstanceId)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link EndpointDetector#detectEndpoints(InstanceId)} + */ + @Test + public void testDetectEndpoints_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(endpointDetector.detectEndpoints(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + } + + /** + * Test {@link EndpointDetector#detectEndpoints(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link EndpointDetector#detectEndpoints(InstanceId)} + */ + @Test + public void testDetectEndpoints_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(endpointDetector.detectEndpoints(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link EndpointDetector#detectEndpoints(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#map(Function)}.
  • + *
+ *

+ * Method under test: {@link EndpointDetector#detectEndpoints(InstanceId)} + */ + @Test + public void testDetectEndpoints_givenMonoMapReturnJustData_thenCallsMap() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EndpointDetector endpointDetector = new EndpointDetector(new EventsourcingInstanceRepository(eventStore), + mock(EndpointDetectionStrategy.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(endpointDetector.detectEndpoints(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/HashingInstanceUrlIdGeneratorDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/HashingInstanceUrlIdGeneratorDiffblueTest.java new file mode 100644 index 00000000000..a98981df92b --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/HashingInstanceUrlIdGeneratorDiffblueTest.java @@ -0,0 +1,46 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertEquals; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@ContextConfiguration(classes = { HashingInstanceUrlIdGenerator.class }) +@RunWith(SpringJUnit4ClassRunner.class) +public class HashingInstanceUrlIdGeneratorDiffblueTest { + + @Autowired + private HashingInstanceUrlIdGenerator hashingInstanceUrlIdGenerator; + + /** + * Test {@link HashingInstanceUrlIdGenerator#generateId(Registration)}. + *
    + *
  • Then return Value is {@code 504149e8a3fa}.
  • + *
+ *

+ * Method under test: {@link HashingInstanceUrlIdGenerator#generateId(Registration)} + */ + @Test + public void testGenerateId_thenReturnValueIs504149e8a3fa() { + // Arrange + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act + InstanceId actualGenerateIdResult = hashingInstanceUrlIdGenerator.generateId(registration); + + // Assert + assertEquals("504149e8a3fa", actualGenerateIdResult.getValue()); + assertEquals("504149e8a3fa", actualGenerateIdResult.toString()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/InfoUpdaterDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/InfoUpdaterDiffblueTest.java new file mode 100644 index 00000000000..4ec0599166c --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/InfoUpdaterDiffblueTest.java @@ -0,0 +1,423 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.hazelcast.map.IMap; +import com.hazelcast.map.listener.MapListener; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.Info; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.reactive.function.client.ClientResponse; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import org.springframework.web.reactive.function.client.support.ClientResponseWrapper; +import org.springframework.web.reactive.function.client.support.ClientResponseWrapper.HeadersWrapper; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { InfoUpdater.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class InfoUpdaterDiffblueTest { + + @MockitoBean + private ApiMediaTypeHandler apiMediaTypeHandler; + + @Autowired + private InfoUpdater infoUpdater; + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private InstanceWebClient instanceWebClient; + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo() { + // Arrange + Mono mono = mock(Mono.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + when(mono.then()).thenReturn(channelSendOperator); + when(instanceRepository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + + // Act + Mono actualUpdateInfoResult = infoUpdater.updateInfo(InstanceId.of("42")); + + // Assert + verify(instanceRepository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + assertSame(channelSendOperator, actualUpdateInfoResult); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo2() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + InfoUpdater infoUpdater = new InfoUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(infoUpdater.updateInfo(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo3() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + SnapshottingInstanceRepository repository = new SnapshottingInstanceRepository(new InMemoryEventStore()); + InfoUpdater infoUpdater = new InfoUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(infoUpdater.updateInfo(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *

    + *
  • Given {@link ArrayList#ArrayList()} add {@code 42}.
  • + *
  • When {@link InstanceId} with value is {@code 4242}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo_givenArrayListAdd42_whenInstanceIdWithValueIs4242() { + // Arrange + ArrayList objectList = new ArrayList<>(); + objectList.addAll(new ArrayList<>()); + objectList.add("42"); + + ArrayList it = new ArrayList<>(); + it.addAll(objectList); + Flux source = Flux.fromIterable(it); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + Mono mono = mock(Mono.class); + when(mono.then()).thenReturn(channelSendOperator); + when(instanceRepository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + + // Act + Mono actualUpdateInfoResult = infoUpdater.updateInfo(InstanceId.of("4242")); + + // Assert + verify(instanceRepository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + assertSame(channelSendOperator, actualUpdateInfoResult); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *
    + *
  • Given {@link ArrayList#ArrayList()} addAll {@link ArrayList#ArrayList()}.
  • + *
  • When {@link InstanceId} with value is {@code 4242}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo_givenArrayListAddAllArrayList_whenInstanceIdWithValueIs4242() { + // Arrange + ArrayList it = new ArrayList<>(); + it.addAll(new ArrayList<>()); + Flux source = Flux.fromIterable(it); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + Mono mono = mock(Mono.class); + when(mono.then()).thenReturn(channelSendOperator); + when(instanceRepository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + + // Act + Mono actualUpdateInfoResult = infoUpdater.updateInfo(InstanceId.of("4242")); + + // Assert + verify(instanceRepository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + assertSame(channelSendOperator, actualUpdateInfoResult); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *
    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InfoUpdater infoUpdater = new InfoUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(infoUpdater.updateInfo(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + verify(flux).collectList(); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InfoUpdater infoUpdater = new InfoUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(infoUpdater.updateInfo(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InfoUpdater infoUpdater = new InfoUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(infoUpdater.updateInfo(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#map(Function)}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo_givenMonoMapReturnJustData_thenCallsMap() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InfoUpdater infoUpdater = new InfoUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(infoUpdater.updateInfo(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link InfoUpdater#updateInfo(InstanceId)}. + *
    + *
  • When {@link InstanceId} with value is {@code 4242}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#updateInfo(InstanceId)} + */ + @Test + public void testUpdateInfo_whenInstanceIdWithValueIs4242() { + // Arrange + Mono mono = mock(Mono.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + when(mono.then()).thenReturn(channelSendOperator); + when(instanceRepository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + + // Act + Mono actualUpdateInfoResult = infoUpdater.updateInfo(InstanceId.of("4242")); + + // Assert + verify(instanceRepository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + assertSame(channelSendOperator, actualUpdateInfoResult); + } + + /** + * Test {@link InfoUpdater#convertInfo(Instance, Throwable)} with {@code instance}, + * {@code ex}. + *

+ * Method under test: {@link InfoUpdater#convertInfo(Instance, Throwable)} + */ + @Test + public void testConvertInfoWithInstanceEx() { + // Arrange, Act and Assert + assertTrue(infoUpdater.convertInfo(null, new Throwable()).getValues().isEmpty()); + } + + /** + * Test {@link InfoUpdater#convertInfo(Instance, ClientResponse)} with + * {@code instance}, {@code response}. + *

    + *
  • Given just {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link InfoUpdater#convertInfo(Instance, ClientResponse)} + */ + @Test + public void testConvertInfoWithInstanceResponse_givenJustHashMap() throws AssertionError { + // Arrange + IMap> eventLog = mock(IMap.class); + when(eventLog.addEntryListener(Mockito.any(), anyBoolean())).thenReturn(UUID.randomUUID()); + new ChannelSendOperator<>(new HazelcastEventStore(3, eventLog), mock(Function.class)); + + MediaType mediaType = mock(MediaType.class); + when(mediaType.isCompatibleWith(Mockito.any())).thenReturn(true); + Optional ofResult = Optional.of(mediaType); + HeadersWrapper headersWrapper = mock(HeadersWrapper.class); + when(headersWrapper.contentType()).thenReturn(ofResult); + ClientResponseWrapper delegate = mock(ClientResponseWrapper.class); + Mono> justResult = Mono.just(new HashMap<>()); + when(delegate.bodyToMono(Mockito.>>any())) + .thenReturn(justResult); + when(delegate.headers()).thenReturn(headersWrapper); + when(delegate.statusCode()).thenReturn(HttpStatus.OK); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(infoUpdater.convertInfo(null, new ClientResponseWrapper(delegate))); + createResult.assertNext(i -> { + assertTrue(i.getValues().isEmpty()); + return; + }).expectComplete().verify(); + verify(eventLog).addEntryListener(isA(MapListener.class), eq(true)); + verify(mediaType).isCompatibleWith(isA(MediaType.class)); + verify(delegate).bodyToMono(isA(ParameterizedTypeReference.class)); + verify(delegate).headers(); + verify(delegate).statusCode(); + verify(headersWrapper).contentType(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/InstanceRegistryDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/InstanceRegistryDiffblueTest.java new file mode 100644 index 00000000000..f6892edf739 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/InstanceRegistryDiffblueTest.java @@ -0,0 +1,995 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.Registration; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.publisher.DirectProcessor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.GroupedFlux; +import reactor.core.publisher.Mono; +import reactor.core.publisher.ReplayProcessor; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { InstanceRegistry.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class InstanceRegistryDiffblueTest { + + @MockitoBean + private InstanceFilter instanceFilter; + + @MockitoBean + private InstanceIdGenerator instanceIdGenerator; + + @Autowired + private InstanceRegistry instanceRegistry; + + @MockitoBean + private InstanceRepository instanceRepository; + + /** + * Test + * {@link InstanceRegistry#InstanceRegistry(InstanceRepository, InstanceIdGenerator, InstanceFilter)}. + *

+ * Method under test: + * {@link InstanceRegistry#InstanceRegistry(InstanceRepository, InstanceIdGenerator, InstanceFilter)} + */ + @Test + public void testNewInstanceRegistry() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#register(Registration)}. + *

+ * Method under test: {@link InstanceRegistry#register(Registration)} + */ + @Test + public void testRegister() throws AssertionError { + // Arrange + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + String value = "42"; + InstanceId ofResult = InstanceId.of(value); + when(generator.generateId(Mockito.any())).thenReturn(ofResult); + InstanceRegistry instanceRegistry = new InstanceRegistry( + new EventsourcingInstanceRepository(new InMemoryEventStore()), generator, mock(InstanceFilter.class)); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.register(registration)); + createResult.assertNext(i -> { + assertSame(ofResult, i); + return; + }).expectComplete().verify(); + verify(generator).generateId(isA(Registration.class)); + } + + /** + * Test {@link InstanceRegistry#register(Registration)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#register(Registration)} + */ + @Test + public void testRegister_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry instanceRegistry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.register(registration)); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + } + + /** + * Test {@link InstanceRegistry#register(Registration)}. + *

    + *
  • Given {@link InstanceEventStore} {@link InstanceEventStore#find(InstanceId)} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#register(Registration)} + */ + @Test + public void testRegister_givenInstanceEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + InstanceEventStore eventStore = mock(InstanceEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry instanceRegistry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.register(registration)); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + } + + /** + * Test {@link InstanceRegistry#register(Registration)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#register(Registration)} + */ + @Test + public void testRegister_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry instanceRegistry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.register(registration)); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstanceRegistry#register(Registration)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return {@link Mono}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#register(Registration)} + */ + @Test + public void testRegister_givenMonoFilterReturnMono_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry instanceRegistry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.register(registration)); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link InstanceRegistry#register(Registration)}. + *
    + *
  • Given {@link Mono} {@link Mono#flatMap(Function)} return just + * {@code Data}.
  • + *
  • Then calls {@link Mono#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#register(Registration)} + */ + @Test + public void testRegister_givenMonoFlatMapReturnJustData_thenCallsFlatMap() throws AssertionError { + // Arrange + Mono mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.flatMap(Mockito.>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.map(Mockito., Object>>any())).thenReturn(mono); + Mono> mono3 = mock(Mono.class); + when(mono3.filter(Mockito.>>any())).thenReturn(mono2); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono3); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + InstanceIdGenerator generator = mock(InstanceIdGenerator.class); + when(generator.generateId(Mockito.any())).thenReturn(InstanceId.of("42")); + InstanceRegistry instanceRegistry = new InstanceRegistry(repository, generator, mock(InstanceFilter.class)); + Registration registration = Registration.builder() + .healthUrl("https://example.org/example") + .managementUrl("https://example.org/example") + .name("Name") + .serviceUrl("https://example.org/example") + .source("Source") + .build(); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.register(registration)); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(generator).generateId(isA(Registration.class)); + verify(flux).collectList(); + verify(mono3).filter(isA(Predicate.class)); + verify(mono).flatMap(isA(Function.class)); + verify(mono2).map(isA(Function.class)); + } + + /** + * Test {@link InstanceRegistry#getInstances()}. + *

+ * Method under test: {@link InstanceRegistry#getInstances()} + */ + @Test + public void testGetInstances() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#getInstances()}. + *

+ * Method under test: {@link InstanceRegistry#getInstances()} + */ + @Test + public void testGetInstances2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findByName(Mockito.any())).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstances("Name")); + createResult.expectComplete().verify(); + verify(instanceRepository).findByName(eq("Name")); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString3() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString4() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString_givenFluxFilterReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceRepository.findByName(Mockito.any())).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstances("Name")); + createResult.expectComplete().verify(); + verify(instanceRepository).findByName(eq("Name")); + verify(flux).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString_givenFluxGroupByReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

    + *
  • Given {@link InstanceRepository} {@link InstanceRepository#findByName(String)} + * return create.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString_givenInstanceRepositoryFindByNameReturnCreate() { + // Arrange + DirectProcessor createResult = DirectProcessor.create(); + when(instanceRepository.findByName(Mockito.any())).thenReturn(createResult); + + // Act + instanceRegistry.getInstances("Name"); + + // Assert + verify(instanceRepository).findByName(eq("Name")); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *

    + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString_thenCallsFlatMap() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceRegistry#getInstances(String)} with {@code String}. + *
    + *
  • Then return create zero and {@code true}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances(String)} + */ + @Test + public void testGetInstancesWithString_thenReturnCreateZeroAndTrue() { + // Arrange + Flux flux = mock(Flux.class); + ReplayProcessor createResult = ReplayProcessor.create(0, true); + when(flux.filter(Mockito.>any())).thenReturn(createResult); + when(instanceRepository.findByName(Mockito.any())).thenReturn(flux); + + // Act + Flux actualInstances = instanceRegistry.getInstances("Name"); + + // Assert + verify(instanceRepository).findByName(eq("Name")); + verify(flux).filter(isA(Predicate.class)); + assertSame(createResult, actualInstances); + } + + /** + * Test {@link InstanceRegistry#getInstances()}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances()} + */ + @Test + public void testGetInstances_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceRepository.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstances()); + createResult.expectComplete().verify(); + verify(instanceRepository).findAll(); + verify(flux).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstanceRegistry#getInstances()}. + *

    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances()} + */ + @Test + public void testGetInstances_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstanceRegistry#getInstances()}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances()} + */ + @Test + public void testGetInstances_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)) + .getInstances()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link InstanceRegistry#getInstances()}. + *

    + *
  • Given {@link InstanceRepository} {@link InstanceRepository#findAll()} return + * create.
  • + *
  • Then calls {@link InstanceRepository#findAll()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances()} + */ + @Test + public void testGetInstances_givenInstanceRepositoryFindAllReturnCreate_thenCallsFindAll() { + // Arrange + DirectProcessor createResult = DirectProcessor.create(); + when(instanceRepository.findAll()).thenReturn(createResult); + + // Act + instanceRegistry.getInstances(); + + // Assert + verify(instanceRepository).findAll(); + } + + /** + * Test {@link InstanceRegistry#getInstances()}. + *

    + *
  • Given {@link InstanceRepository} {@link InstanceRepository#findAll()} return + * fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstances()} + */ + @Test + public void testGetInstances_givenInstanceRepositoryFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRepository.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstances()); + createResult.expectComplete().verify(); + verify(instanceRepository).findAll(); + } + + /** + * Test {@link InstanceRegistry#getInstance(InstanceId)}. + *

+ * Method under test: {@link InstanceRegistry#getInstance(InstanceId)} + */ + @Test + public void testGetInstance() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = new InstanceRegistry( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstance(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#getInstance(InstanceId)}. + *

+ * Method under test: {@link InstanceRegistry#getInstance(InstanceId)} + */ + @Test + public void testGetInstance2() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = new InstanceRegistry( + new SnapshottingInstanceRepository(new InMemoryEventStore()), mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstance(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#getInstance(InstanceId)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstance(InstanceId)} + */ + @Test + public void testGetInstance_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstance(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + } + + /** + * Test {@link InstanceRegistry#getInstance(InstanceId)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstance(InstanceId)} + */ + @Test + public void testGetInstance_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstance(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + } + + /** + * Test {@link InstanceRegistry#getInstance(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstance(InstanceId)} + */ + @Test + public void testGetInstance_givenMonoFilterReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.getInstance(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstanceRegistry#getInstance(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return {@code null}.
  • + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#getInstance(InstanceId)} + */ + @Test + public void testGetInstance_givenMonoFilterReturnNull_thenReturnNull() { + // Arrange + Mono mono = mock(Mono.class); + when(mono.filter(Mockito.>any())).thenReturn(null); + when(instanceRepository.find(Mockito.any())).thenReturn(mono); + + // Act + Mono actualInstance = instanceRegistry.getInstance(InstanceId.of("42")); + + // Assert + verify(instanceRepository).find(isA(InstanceId.class)); + verify(mono).filter(isA(Predicate.class)); + assertNull(actualInstance); + } + + /** + * Test {@link InstanceRegistry#deregister(InstanceId)}. + *

+ * Method under test: {@link InstanceRegistry#deregister(InstanceId)} + */ + @Test + public void testDeregister() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = new InstanceRegistry( + new EventsourcingInstanceRepository(new InMemoryEventStore()), mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.deregister(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#deregister(InstanceId)}. + *

+ * Method under test: {@link InstanceRegistry#deregister(InstanceId)} + */ + @Test + public void testDeregister2() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = new InstanceRegistry( + new SnapshottingInstanceRepository(new InMemoryEventStore()), mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.deregister(InstanceId.of("42"))); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstanceRegistry#deregister(InstanceId)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#deregister(InstanceId)} + */ + @Test + public void testDeregister_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.deregister(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + } + + /** + * Test {@link InstanceRegistry#deregister(InstanceId)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#deregister(InstanceId)} + */ + @Test + public void testDeregister_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.deregister(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + } + + /** + * Test {@link InstanceRegistry#deregister(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#deregister(InstanceId)} + */ + @Test + public void testDeregister_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.deregister(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstanceRegistry#deregister(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#flatMap(Function)} return just + * {@code Data}.
  • + *
  • Then calls {@link Mono#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#deregister(InstanceId)} + */ + @Test + public void testDeregister_givenMonoFlatMapReturnJustData_thenCallsFlatMap() throws AssertionError { + // Arrange + Mono mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.flatMap(Mockito.>>any())).thenReturn(justResult); + Mono mono2 = mock(Mono.class); + when(mono2.flatMap(Mockito.>>any())).thenReturn(mono); + Mono> mono3 = mock(Mono.class); + when(mono3.map(Mockito., Object>>any())).thenReturn(mono2); + Mono> mono4 = mock(Mono.class); + when(mono4.filter(Mockito.>>any())).thenReturn(mono3); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono4); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.deregister(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono4).filter(isA(Predicate.class)); + verify(mono2).flatMap(isA(Function.class)); + verify(mono).flatMap(isA(Function.class)); + verify(mono3).map(isA(Function.class)); + } + + /** + * Test {@link InstanceRegistry#deregister(InstanceId)}. + *
    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstanceRegistry#deregister(InstanceId)} + */ + @Test + public void testDeregister_givenMonoMapReturnJustData_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry instanceRegistry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instanceRegistry.deregister(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/StatusUpdaterDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/StatusUpdaterDiffblueTest.java new file mode 100644 index 00000000000..41ae6243f07 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/StatusUpdaterDiffblueTest.java @@ -0,0 +1,396 @@ +package de.codecentric.boot.admin.server.services; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.domain.values.StatusInfo; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { StatusUpdater.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class StatusUpdaterDiffblueTest { + + @MockitoBean + private ApiMediaTypeHandler apiMediaTypeHandler; + + @MockitoBean + private InstanceRepository instanceRepository; + + @MockitoBean + private InstanceWebClient instanceWebClient; + + @Autowired + private StatusUpdater statusUpdater; + + /** + * Test {@link StatusUpdater#timeout(Duration)}. + *

+ * Method under test: {@link StatusUpdater#timeout(Duration)} + */ + @Test + public void testTimeout() { + // Arrange + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(mock(Builder.class)).build(); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + assertSame(statusUpdater, statusUpdater.timeout(null)); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus() { + // Arrange + Mono mono = mock(Mono.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + ChannelSendOperator channelSendOperator = new ChannelSendOperator<>(source, mock(Function.class)); + + when(mono.then()).thenReturn(channelSendOperator); + when(instanceRepository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + + // Act + Mono actualUpdateStatusResult = statusUpdater.updateStatus(InstanceId.of("42")); + + // Assert + verify(instanceRepository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + assertSame(channelSendOperator, actualUpdateStatusResult); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus2() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore()); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(statusUpdater.updateStatus(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus3() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + SnapshottingInstanceRepository repository = new SnapshottingInstanceRepository(new InMemoryEventStore()); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(statusUpdater.updateStatus(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(statusUpdater.updateStatus(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + verify(flux).collectList(); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(statusUpdater.updateStatus(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus_givenMonoFilterReturnJustArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(statusUpdater.updateStatus(InstanceId.of("42"))); + createResult.expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *

    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Mono#map(Function)}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus_givenMonoMapReturnJustData_thenCallsMap() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + EventsourcingInstanceRepository repository = new EventsourcingInstanceRepository(eventStore); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + StatusUpdater statusUpdater = new StatusUpdater(repository, instanceWebClient, new ApiMediaTypeHandler()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(statusUpdater.updateStatus(InstanceId.of("42"))); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(builder).build(); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link StatusUpdater#updateStatus(InstanceId)}. + *
    + *
  • Given {@link Mono} {@link Mono#then()} return {@code null}.
  • + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#updateStatus(InstanceId)} + */ + @Test + public void testUpdateStatus_givenMonoThenReturnNull_thenReturnNull() { + // Arrange + Mono mono = mock(Mono.class); + when(mono.then()).thenReturn(null); + when(instanceRepository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + + // Act + Mono actualUpdateStatusResult = statusUpdater.updateStatus(InstanceId.of("4242")); + + // Assert + verify(instanceRepository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).then(); + assertNull(actualUpdateStatusResult); + } + + /** + * Test {@link StatusUpdater#handleError(Throwable)}. + *

    + *
  • Given {@link Throwable#Throwable()}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#handleError(Throwable)} + */ + @Test + public void testHandleError_givenThrowable() throws AssertionError { + // Arrange + AbstractMethodError abstractMethodError = new AbstractMethodError("message"); + abstractMethodError.addSuppressed(new Throwable()); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(statusUpdater.handleError(new Throwable("message", abstractMethodError))); + createResult.assertNext(s -> { + StatusInfo statusInfo = s; + Map details = statusInfo.getDetails(); + assertEquals(2, details.size()); + Object getResult = details.get("exception"); + assertEquals("java.lang.Throwable", getResult); + assertEquals("message", details.get("message")); + assertEquals("OFFLINE", statusInfo.getStatus()); + assertFalse(statusInfo.isDown()); + assertTrue(statusInfo.isOffline()); + assertFalse(statusInfo.isUnknown()); + assertFalse(statusInfo.isUp()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link StatusUpdater#handleError(Throwable)}. + *

    + *
  • When {@link Throwable#Throwable()}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#handleError(Throwable)} + */ + @Test + public void testHandleError_whenThrowable() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(statusUpdater.handleError(new Throwable())); + createResult.assertNext(s -> { + StatusInfo statusInfo = s; + Map details = statusInfo.getDetails(); + assertEquals(2, details.size()); + Object getResult = details.get("exception"); + assertEquals("java.lang.Throwable", getResult); + assertNull(details.get("message")); + assertEquals("OFFLINE", statusInfo.getStatus()); + assertFalse(statusInfo.isDown()); + assertTrue(statusInfo.isOffline()); + assertFalse(statusInfo.isUnknown()); + assertFalse(statusInfo.isUp()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link StatusUpdater#handleError(Throwable)}. + *

    + *
  • When {@link Throwable#Throwable(String, Throwable)} with {@code message} and + * {@link Throwable#Throwable()}.
  • + *
+ *

+ * Method under test: {@link StatusUpdater#handleError(Throwable)} + */ + @Test + public void testHandleError_whenThrowableWithMessageAndThrowable() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(statusUpdater.handleError(new Throwable("message", new Throwable()))); + createResult.assertNext(s -> { + StatusInfo statusInfo = s; + Map details = statusInfo.getDetails(); + assertEquals(2, details.size()); + Object getResult = details.get("exception"); + assertEquals("java.lang.Throwable", getResult); + assertEquals("message", details.get("message")); + assertEquals("OFFLINE", statusInfo.getStatus()); + assertFalse(statusInfo.isDown()); + assertTrue(statusInfo.isOffline()); + assertFalse(statusInfo.isUnknown()); + assertFalse(statusInfo.isUp()); + return; + }).expectComplete().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/ChainingStrategyDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/ChainingStrategyDiffblueTest.java new file mode 100644 index 00000000000..5ed0408f7a7 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/ChainingStrategyDiffblueTest.java @@ -0,0 +1,44 @@ +package de.codecentric.boot.admin.server.services.endpoints; + +import static org.junit.Assert.assertSame; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import org.junit.Test; +import org.mockito.Mockito; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class ChainingStrategyDiffblueTest { + + /** + * Test {@link ChainingStrategy#detectEndpoints(Instance)}. + *

    + *
  • Then calls {@link EndpointDetectionStrategy#detectEndpoints(Instance)}.
  • + *
+ *

+ * Method under test: {@link ChainingStrategy#detectEndpoints(Instance)} + */ + @Test + public void testDetectEndpoints_thenCallsDetectEndpoints() throws AssertionError { + // Arrange + EndpointDetectionStrategy endpointDetectionStrategy = mock(EndpointDetectionStrategy.class); + Endpoints emptyResult = Endpoints.empty(); + Mono justResult = Mono.just(emptyResult); + when(endpointDetectionStrategy.detectEndpoints(Mockito.any())).thenReturn(justResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ChainingStrategy(endpointDetectionStrategy).detectEndpoints(null)); + createResult.assertNext(e -> { + assertSame(emptyResult, e); + return; + }).expectComplete().verify(); + verify(endpointDetectionStrategy).detectEndpoints(isNull()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategyDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategyDiffblueTest.java new file mode 100644 index 00000000000..d8609180bbd --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategyDiffblueTest.java @@ -0,0 +1,246 @@ +package de.codecentric.boot.admin.server.services.endpoints; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.values.Endpoint; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.notify.PagerdutyNotifier; +import de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.DetectedEndpoint; +import de.codecentric.boot.admin.server.services.endpoints.ProbeEndpointsStrategy.EndpointDefinition; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import java.net.URI; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.Test; +import org.springframework.http.HttpStatus; +import org.springframework.http.server.reactive.ChannelSendOperator; +import org.springframework.web.reactive.function.client.ClientResponse; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import org.springframework.web.reactive.function.client.support.ClientResponseWrapper; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class ProbeEndpointsStrategyDiffblueTest { + + /** + * Test {@link ProbeEndpointsStrategy#convert(List)} with {@code endpoints}. + *

    + *
  • Given {@link EndpointDefinition#EndpointDefinition(String, String)} with id is + * {@code 42} and {@code Path}.
  • + *
  • Then calls {@link Builder#build()}.
  • + *
+ *

+ * Method under test: {@link ProbeEndpointsStrategy#convert(List)} + */ + @Test + public void testConvertWithEndpoints_givenEndpointDefinitionWithIdIs42AndPath_thenCallsBuild() + throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + ProbeEndpointsStrategy probeEndpointsStrategy = new ProbeEndpointsStrategy(instanceWebClient, + new String[] { "https://config.us-east-2.amazonaws.com" }); + + ArrayList endpoints = new ArrayList<>(); + EndpointDefinition definition = new EndpointDefinition("42", "Path"); + + String id = "42"; + String url = "https://example.org/example"; + Endpoint endpoint = Endpoint.of(id, url); + endpoints.add(new DetectedEndpoint(definition, endpoint)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(probeEndpointsStrategy.convert(endpoints)); + createResult.assertNext(e -> { + Endpoints endpoints2 = e; + Iterator iteratorResult = endpoints2.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertFalse(iteratorResult.hasNext()); + assertEquals("42", nextResult.getId()); + assertSame(endpoint, nextResult); + Stream streamResult = endpoints2.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(1, collectResult.size()); + assertSame(endpoint, collectResult.get(0)); + return; + }).expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link ProbeEndpointsStrategy#convert(List)} with {@code endpoints}. + *

    + *
  • Given {@link EndpointDefinition#EndpointDefinition(String, String)} with id is + * {@code 42} and {@code Path}.
  • + *
  • Then calls {@link Builder#build()}.
  • + *
+ *

+ * Method under test: {@link ProbeEndpointsStrategy#convert(List)} + */ + @Test + public void testConvertWithEndpoints_givenEndpointDefinitionWithIdIs42AndPath_thenCallsBuild2() + throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + ProbeEndpointsStrategy probeEndpointsStrategy = new ProbeEndpointsStrategy(instanceWebClient, + new String[] { "https://config.us-east-2.amazonaws.com" }); + + ArrayList endpoints = new ArrayList<>(); + EndpointDefinition definition = new EndpointDefinition("42", "Path"); + + String id = "42"; + String url = "https://example.org/example"; + Endpoint endpoint = Endpoint.of(id, url); + endpoints.add(new DetectedEndpoint(definition, endpoint)); + EndpointDefinition definition2 = new EndpointDefinition("42", "Path"); + + endpoints.add(new DetectedEndpoint(definition2, Endpoint.of("42", "https://example.org/example"))); + + // Act and Assert + FirstStep createResult = StepVerifier.create(probeEndpointsStrategy.convert(endpoints)); + createResult.assertNext(e -> { + Endpoints endpoints2 = e; + Iterator iteratorResult = endpoints2.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertFalse(iteratorResult.hasNext()); + assertEquals("42", nextResult.getId()); + assertSame(endpoint, nextResult); + Stream streamResult = endpoints2.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(1, collectResult.size()); + assertSame(endpoint, collectResult.get(0)); + return; + }).expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link ProbeEndpointsStrategy#convert(List)} with {@code endpoints}. + *

    + *
  • Given {@link Endpoint} with {@code Id} and url is + * {@code https://example.org/example}.
  • + *
+ *

+ * Method under test: {@link ProbeEndpointsStrategy#convert(List)} + */ + @Test + public void testConvertWithEndpoints_givenEndpointWithIdAndUrlIsHttpsExampleOrgExample() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + ProbeEndpointsStrategy probeEndpointsStrategy = new ProbeEndpointsStrategy(instanceWebClient, + new String[] { "https://config.us-east-2.amazonaws.com" }); + + ArrayList endpoints = new ArrayList<>(); + EndpointDefinition definition = new EndpointDefinition("42", "Path"); + + String id = "Id"; + String url = "https://example.org/example"; + Endpoint endpoint = Endpoint.of(id, url); + endpoints.add(new DetectedEndpoint(definition, endpoint)); + EndpointDefinition definition2 = new EndpointDefinition("https", "Path"); + + String id2 = "42"; + String url2 = "https://example.org/example"; + Endpoint endpoint2 = Endpoint.of(id2, url2); + endpoints.add(new DetectedEndpoint(definition2, endpoint2)); + + // Act and Assert + FirstStep createResult = StepVerifier.create(probeEndpointsStrategy.convert(endpoints)); + createResult.assertNext(e -> { + Endpoints endpoints2 = e; + Iterator iteratorResult = endpoints2.iterator(); + Endpoint nextResult = iteratorResult.next(); + Endpoint actualNextResult = iteratorResult.next(); + assertFalse(iteratorResult.hasNext()); + assertEquals("Id", nextResult.getId()); + assertSame(endpoint, nextResult); + assertSame(endpoint2, actualNextResult); + Stream streamResult = endpoints2.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(2, collectResult.size()); + assertSame(endpoint, collectResult.get(0)); + assertSame(endpoint2, collectResult.get(1)); + return; + }).expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link ProbeEndpointsStrategy#convert(List)} with {@code endpoints}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Builder#build()}.
  • + *
+ *

+ * Method under test: {@link ProbeEndpointsStrategy#convert(List)} + */ + @Test + public void testConvertWithEndpoints_whenArrayList_thenCallsBuild() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + ProbeEndpointsStrategy probeEndpointsStrategy = new ProbeEndpointsStrategy(instanceWebClient, + new String[] { "https://config.us-east-2.amazonaws.com" }); + + // Act and Assert + FirstStep createResult = StepVerifier.create(probeEndpointsStrategy.convert(new ArrayList<>())); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link ProbeEndpointsStrategy#convert(InstanceId, EndpointDefinition, URI)} + * with {@code instanceId}, {@code endpointDefinition}, {@code uri}. + *

    + *
  • Then calls {@link ClientResponse#releaseBody()}.
  • + *
+ *

+ * Method under test: + * {@link ProbeEndpointsStrategy#convert(InstanceId, EndpointDefinition, URI)} + */ + @Test + public void testConvertWithInstanceIdEndpointDefinitionUri_thenCallsReleaseBody() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + ProbeEndpointsStrategy probeEndpointsStrategy = new ProbeEndpointsStrategy(instanceWebClient, + new String[] { "https://config.us-east-2.amazonaws.com" }); + InstanceId instanceId = InstanceId.of("42"); + + // Act + Function> actualConvertResult = probeEndpointsStrategy + .convert(instanceId, new EndpointDefinition("42", "Path"), PagerdutyNotifier.DEFAULT_URI); + ClientResponse delegate = mock(ClientResponse.class); + Flux source = Flux.fromIterable(new ArrayList<>()); + when(delegate.releaseBody()).thenReturn(new ChannelSendOperator<>(source, mock(Function.class))); + when(delegate.statusCode()).thenReturn(HttpStatus.OK); + Mono actualPublisher = actualConvertResult.apply(new ClientResponseWrapper(delegate)); + + // Assert + verify(delegate).releaseBody(); + verify(delegate).statusCode(); + verify(builder).build(); + FirstStep createResult = StepVerifier.create(actualPublisher); + createResult.expectError().verify(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategyDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategyDiffblueTest.java new file mode 100644 index 00000000000..d5d9c1a69cf --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategyDiffblueTest.java @@ -0,0 +1,317 @@ +package de.codecentric.boot.admin.server.services.endpoints; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.values.Endpoint; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.services.ApiMediaTypeHandler; +import de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.Response; +import de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy.Response.EndpointRef; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.Test; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class QueryIndexEndpointStrategyDiffblueTest { + + /** + * Test {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)}. + *

+ * Method under test: + * {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)} + */ + @Test + public void testAlignWithManagementUrl() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + // Act + Function actualAlignWithManagementUrlResult = queryIndexEndpointStrategy + .alignWithManagementUrl(InstanceId.of("42"), "https://example.org/example"); + Endpoints singleResult = Endpoints.single("42", "https://example.org/example"); + Endpoints actualApplyResult = actualAlignWithManagementUrlResult.apply(singleResult); + + // Assert + verify(builder).build(); + assertSame(singleResult, actualApplyResult); + } + + /** + * Test {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)}. + *

    + *
  • Then return apply empty is empty.
  • + *
+ *

+ * Method under test: + * {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)} + */ + @Test + public void testAlignWithManagementUrl_thenReturnApplyEmptyIsEmpty() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + // Act + Function actualAlignWithManagementUrlResult = queryIndexEndpointStrategy + .alignWithManagementUrl(InstanceId.of("42"), "https://example.org/example"); + Endpoints emptyResult = Endpoints.empty(); + Endpoints actualApplyResult = actualAlignWithManagementUrlResult.apply(emptyResult); + + // Assert + verify(builder).build(); + assertSame(emptyResult, actualApplyResult); + } + + /** + * Test {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)}. + *

    + *
  • Then return apply single {@code 42} and {@code http:} iterator next Id is + * {@code 42}.
  • + *
+ *

+ * Method under test: + * {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)} + */ + @Test + public void testAlignWithManagementUrl_thenReturnApplySingle42AndHttpIteratorNextIdIs42() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + // Act + Function actualAlignWithManagementUrlResult = queryIndexEndpointStrategy + .alignWithManagementUrl(InstanceId.of("42"), "https://example.org/example"); + Endpoints actualApplyResult = actualAlignWithManagementUrlResult.apply(Endpoints.single("42", "http:")); + + // Assert + verify(builder).build(); + Iterator iteratorResult = actualApplyResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertEquals("42", nextResult.getId()); + assertEquals("https:", nextResult.getUrl()); + Stream streamResult = actualApplyResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(1, collectResult.size()); + assertFalse(iteratorResult.hasNext()); + assertSame(nextResult, collectResult.get(0)); + } + + /** + * Test {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)}. + *

    + *
  • When {@code Management Url}.
  • + *
  • Then return apply empty is empty.
  • + *
+ *

+ * Method under test: + * {@link QueryIndexEndpointStrategy#alignWithManagementUrl(InstanceId, String)} + */ + @Test + public void testAlignWithManagementUrl_whenManagementUrl_thenReturnApplyEmptyIsEmpty() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + // Act + Function actualAlignWithManagementUrlResult = queryIndexEndpointStrategy + .alignWithManagementUrl(InstanceId.of("42"), "Management Url"); + Endpoints emptyResult = Endpoints.empty(); + Endpoints actualApplyResult = actualAlignWithManagementUrlResult.apply(emptyResult); + + // Assert + verify(builder).build(); + assertSame(emptyResult, actualApplyResult); + } + + /** + * Test {@link QueryIndexEndpointStrategy#convertResponse(Response)}. + *

+ * Method under test: {@link QueryIndexEndpointStrategy#convertResponse(Response)} + */ + @Test + public void testConvertResponse() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + HashMap links = new HashMap<>(); + links.put("42", new EndpointRef("Href", true)); + links.putIfAbsent("foo", new EndpointRef("Href", true)); + + Response response = new Response(); + response.setLinks(links); + + // Act and Assert + FirstStep createResult = StepVerifier.create(queryIndexEndpointStrategy.convertResponse(response)); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link QueryIndexEndpointStrategy#convertResponse(Response)}. + *

+ * Method under test: {@link QueryIndexEndpointStrategy#convertResponse(Response)} + */ + @Test + public void testConvertResponse2() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + HashMap links = new HashMap<>(); + links.put("42", new EndpointRef("Href", true)); + links.putIfAbsent("self", new EndpointRef("Href", true)); + + Response response = new Response(); + response.setLinks(links); + + // Act and Assert + FirstStep createResult = StepVerifier.create(queryIndexEndpointStrategy.convertResponse(response)); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link QueryIndexEndpointStrategy#convertResponse(Response)}. + *

+ * Method under test: {@link QueryIndexEndpointStrategy#convertResponse(Response)} + */ + @Test + public void testConvertResponse3() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + HashMap links = new HashMap<>(); + links.put("42", new EndpointRef("Href", true)); + links.putIfAbsent("foo", new EndpointRef("Href", false)); + + Response response = new Response(); + response.setLinks(links); + + // Act and Assert + FirstStep createResult = StepVerifier.create(queryIndexEndpointStrategy.convertResponse(response)); + createResult.assertNext(e -> { + Endpoints endpoints = e; + Iterator iteratorResult = endpoints.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertFalse(iteratorResult.hasNext()); + assertEquals("foo", nextResult.getId()); + assertEquals("Href", nextResult.getUrl()); + Stream streamResult = endpoints.stream(); + assertEquals(1, streamResult.limit(5).collect(Collectors.toList()).size()); + return; + }).expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link QueryIndexEndpointStrategy#convertResponse(Response)}. + *

    + *
  • Given {@link HashMap#HashMap()} {@code foo} is + * {@link EndpointRef#EndpointRef(String, boolean)} with {@code Href} and templated is + * {@code true}.
  • + *
+ *

+ * Method under test: {@link QueryIndexEndpointStrategy#convertResponse(Response)} + */ + @Test + public void testConvertResponse_givenHashMapFooIsEndpointRefWithHrefAndTemplatedIsTrue() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + HashMap links = new HashMap<>(); + links.put("foo", new EndpointRef("Href", true)); + + Response response = new Response(); + response.setLinks(links); + + // Act and Assert + FirstStep createResult = StepVerifier.create(queryIndexEndpointStrategy.convertResponse(response)); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test {@link QueryIndexEndpointStrategy#convertResponse(Response)}. + *

    + *
  • Given {@link HashMap#HashMap()}.
  • + *
  • Then calls {@link Builder#build()}.
  • + *
+ *

+ * Method under test: {@link QueryIndexEndpointStrategy#convertResponse(Response)} + */ + @Test + public void testConvertResponse_givenHashMap_thenCallsBuild() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + QueryIndexEndpointStrategy queryIndexEndpointStrategy = new QueryIndexEndpointStrategy(instanceWebClient, + new ApiMediaTypeHandler()); + + Response response = new Response(); + response.setLinks(new HashMap<>()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(queryIndexEndpointStrategy.convertResponse(response)); + createResult.expectComplete().verify(); + verify(builder).build(); + } + + /** + * Test Response_EndpointRef {@link EndpointRef#EndpointRef(String, boolean)}. + *

+ * Method under test: {@link EndpointRef#EndpointRef(String, boolean)} + */ + @Test + public void testResponse_EndpointRefNewEndpointRef() { + // Arrange and Act + EndpointRef actualEndpointRef = new EndpointRef("Href", true); + + // Assert + assertEquals("Href", actualEndpointRef.getHref()); + assertTrue(actualEndpointRef.isTemplated()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/AdminServerModuleDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/AdminServerModuleDiffblueTest.java new file mode 100644 index 00000000000..a40ddbd9f8f --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/AdminServerModuleDiffblueTest.java @@ -0,0 +1,48 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.Module; +import java.util.List; +import org.junit.Test; + +public class AdminServerModuleDiffblueTest { + + /** + * Test {@link AdminServerModule#AdminServerModule(String[])}. + *

+ * Method under test: {@link AdminServerModule#AdminServerModule(String[])} + */ + @Test + public void testNewAdminServerModule() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange and Act + AdminServerModule actualAdminServerModule = new AdminServerModule(new String[] { "Metadata Key Patterns" }); + + // Assert + Iterable dependencies = actualAdminServerModule.getDependencies(); + assertTrue(dependencies instanceof List); + Version versionResult = actualAdminServerModule.version(); + assertEquals("", versionResult.getArtifactId()); + assertEquals("", versionResult.getGroupId()); + assertEquals("//0.0.0", versionResult.toFullString()); + assertEquals("de.codecentric.boot.admin.server.utils.jackson.AdminServerModule", + actualAdminServerModule.getModuleName()); + assertEquals("de.codecentric.boot.admin.server.utils.jackson.AdminServerModule", + actualAdminServerModule.getTypeId()); + assertEquals(0, versionResult.getMajorVersion()); + assertEquals(0, versionResult.getMinorVersion()); + assertEquals(0, versionResult.getPatchLevel()); + assertFalse(versionResult.isSnapshot()); + assertTrue(versionResult.isUknownVersion()); + assertTrue(versionResult.isUnknownVersion()); + assertTrue(((List) dependencies).isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/BuildVersionMixinDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/BuildVersionMixinDiffblueTest.java new file mode 100644 index 00000000000..1e347889467 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/BuildVersionMixinDiffblueTest.java @@ -0,0 +1,47 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import de.codecentric.boot.admin.server.domain.values.BuildVersion; +import org.junit.Test; + +public class BuildVersionMixinDiffblueTest { + + /** + * Test {@link BuildVersionMixin#valueOf(String)}. + *

    + *
  • When {@code foo}.
  • + *
  • Then return Value is {@code foo}.
  • + *
+ *

+ * Method under test: {@link BuildVersionMixin#valueOf(String)} + */ + @Test + public void testValueOf_whenFoo_thenReturnValueIsFoo() { + // Arrange and Act + BuildVersion actualValueOfResult = BuildVersionMixin.valueOf("foo"); + + // Assert + assertEquals("foo", actualValueOfResult.getValue()); + assertEquals("foo", actualValueOfResult.toString()); + } + + /** + * Test {@link BuildVersionMixin#valueOf(String)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return Value is {@code UNKNOWN}.
  • + *
+ *

+ * Method under test: {@link BuildVersionMixin#valueOf(String)} + */ + @Test + public void testValueOf_whenNull_thenReturnValueIsUnknown() { + // Arrange and Act + BuildVersion actualValueOfResult = BuildVersionMixin.valueOf(null); + + // Assert + assertEquals("UNKNOWN", actualValueOfResult.getValue()); + assertEquals("UNKNOWN", actualValueOfResult.toString()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/EndpointMixinDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/EndpointMixinDiffblueTest.java new file mode 100644 index 00000000000..3014c81401d --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/EndpointMixinDiffblueTest.java @@ -0,0 +1,28 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import de.codecentric.boot.admin.server.domain.values.Endpoint; +import org.junit.Test; + +public class EndpointMixinDiffblueTest { + + /** + * Test {@link EndpointMixin#of(String, String)}. + *

    + *
  • When {@code 42}.
  • + *
  • Then return Id is {@code 42}.
  • + *
+ *

+ * Method under test: {@link EndpointMixin#of(String, String)} + */ + @Test + public void testOf_when42_thenReturnIdIs42() { + // Arrange and Act + Endpoint actualOfResult = EndpointMixin.of("42", "https://example.org/example"); + + // Assert + assertEquals("42", actualOfResult.getId()); + assertEquals("https://example.org/example", actualOfResult.getUrl()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/EndpointsMixinDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/EndpointsMixinDiffblueTest.java new file mode 100644 index 00000000000..44f2eaa9980 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/EndpointsMixinDiffblueTest.java @@ -0,0 +1,126 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import de.codecentric.boot.admin.server.domain.values.Endpoint; +import de.codecentric.boot.admin.server.domain.values.Endpoints; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.Test; + +public class EndpointsMixinDiffblueTest { + + /** + * Test {@link EndpointsMixin#of(Collection)}. + *

    + *
  • Then return iterator next Id is {@code 42}.
  • + *
+ *

+ * Method under test: {@link EndpointsMixin#of(Collection)} + */ + @Test + public void testOf_thenReturnIteratorNextIdIs42() { + // Arrange + ArrayList endpoints = new ArrayList<>(); + Endpoint ofResult = Endpoint.of("42", "https://example.org/example"); + endpoints.add(ofResult); + + // Act + Endpoints actualOfResult = EndpointsMixin.of(endpoints); + + // Assert + Iterator iteratorResult = actualOfResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + assertEquals("42", nextResult.getId()); + Stream streamResult = actualOfResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(1, collectResult.size()); + assertFalse(iteratorResult.hasNext()); + assertSame(ofResult, nextResult); + assertSame(ofResult, collectResult.get(0)); + } + + /** + * Test {@link EndpointsMixin#of(Collection)}. + *

    + *
  • Then return iterator next Id is {@code Id}.
  • + *
+ *

+ * Method under test: {@link EndpointsMixin#of(Collection)} + */ + @Test + public void testOf_thenReturnIteratorNextIdIsId() { + // Arrange + Endpoint ofResult = Endpoint.of("Id", "https://example.org/example"); + + ArrayList endpoints = new ArrayList<>(); + endpoints.add(ofResult); + Endpoint ofResult2 = Endpoint.of("42", "https://example.org/example"); + endpoints.add(ofResult2); + + // Act + Endpoints actualOfResult = EndpointsMixin.of(endpoints); + + // Assert + Iterator iteratorResult = actualOfResult.iterator(); + Endpoint nextResult = iteratorResult.next(); + Endpoint actualNextResult = iteratorResult.next(); + boolean actualHasNextResult = iteratorResult.hasNext(); + assertEquals("Id", nextResult.getId()); + Stream streamResult = actualOfResult.stream(); + List collectResult = streamResult.limit(5).collect(Collectors.toList()); + assertEquals(2, collectResult.size()); + assertFalse(actualHasNextResult); + assertSame(ofResult2, actualNextResult); + assertSame(ofResult2, collectResult.get(1)); + assertSame(ofResult, nextResult); + assertSame(ofResult, collectResult.get(0)); + } + + /** + * Test {@link EndpointsMixin#of(Collection)}. + *

    + *
  • When {@link ArrayList#ArrayList()}.
  • + *
  • Then return stream limit five collect toList Empty.
  • + *
+ *

+ * Method under test: {@link EndpointsMixin#of(Collection)} + */ + @Test + public void testOf_whenArrayList_thenReturnStreamLimitFiveCollectToListEmpty() { + // Arrange and Act + Endpoints actualOfResult = EndpointsMixin.of(new ArrayList<>()); + + // Assert + assertFalse(actualOfResult.iterator().hasNext()); + Stream streamResult = actualOfResult.stream(); + assertTrue(streamResult.limit(5).collect(Collectors.toList()).isEmpty()); + } + + /** + * Test {@link EndpointsMixin#of(Collection)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return stream limit five collect toList Empty.
  • + *
+ *

+ * Method under test: {@link EndpointsMixin#of(Collection)} + */ + @Test + public void testOf_whenNull_thenReturnStreamLimitFiveCollectToListEmpty() { + // Arrange and Act + Endpoints actualOfResult = EndpointsMixin.of(null); + + // Assert + assertFalse(actualOfResult.iterator().hasNext()); + Stream streamResult = actualOfResult.stream(); + assertTrue(streamResult.limit(5).collect(Collectors.toList()).isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/InfoMixinDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/InfoMixinDiffblueTest.java new file mode 100644 index 00000000000..a5e43fd6828 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/InfoMixinDiffblueTest.java @@ -0,0 +1,61 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class InfoMixinDiffblueTest { + + /** + * Test {@link InfoMixin#from(Map)}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code 42}.
  • + *
  • Then return Values is {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link InfoMixin#from(Map)} + */ + @Test + public void testFrom_givenFoo_whenHashMapFooIs42_thenReturnValuesIsHashMap() { + // Arrange + HashMap values = new HashMap<>(); + values.put("foo", "42"); + + // Act and Assert + assertEquals(values, InfoMixin.from(values).getValues()); + } + + /** + * Test {@link InfoMixin#from(Map)}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link InfoMixin#from(Map)} + */ + @Test + public void testFrom_whenHashMap_thenReturnValuesEmpty() { + // Arrange, Act and Assert + assertTrue(InfoMixin.from(new HashMap<>()).getValues().isEmpty()); + } + + /** + * Test {@link InfoMixin#from(Map)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link InfoMixin#from(Map)} + */ + @Test + public void testFrom_whenNull_thenReturnValuesEmpty() { + // Arrange, Act and Assert + assertTrue(InfoMixin.from(null).getValues().isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/InstanceIdMixinDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/InstanceIdMixinDiffblueTest.java new file mode 100644 index 00000000000..71f13a2bf99 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/InstanceIdMixinDiffblueTest.java @@ -0,0 +1,28 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import org.junit.Test; + +public class InstanceIdMixinDiffblueTest { + + /** + * Test {@link InstanceIdMixin#of(String)}. + *

    + *
  • When {@code 42}.
  • + *
  • Then return Value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link InstanceIdMixin#of(String)} + */ + @Test + public void testOf_when42_thenReturnValueIs42() { + // Arrange and Act + InstanceId actualOfResult = InstanceIdMixin.of("42"); + + // Assert + assertEquals("42", actualOfResult.getValue()); + assertEquals("42", actualOfResult.toString()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/RegistrationBeanSerializerModifierDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/RegistrationBeanSerializerModifierDiffblueTest.java new file mode 100644 index 00000000000..9ca4189ecc0 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/RegistrationBeanSerializerModifierDiffblueTest.java @@ -0,0 +1,135 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.fasterxml.jackson.core.Base64Variant; +import com.fasterxml.jackson.core.Base64Variants; +import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectMapper.DefaultTypeResolverBuilder; +import com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping; +import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.SerializationConfig; +import com.fasterxml.jackson.databind.cfg.BaseSettings; +import com.fasterxml.jackson.databind.cfg.ConfigOverrides; +import com.fasterxml.jackson.databind.introspect.BasicClassIntrospector; +import com.fasterxml.jackson.databind.introspect.ClassIntrospector; +import com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver; +import com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy; +import com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy.Provider; +import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.jsontype.DefaultBaseTypeLimitingValidator; +import com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver; +import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; +import com.fasterxml.jackson.databind.type.TypeFactory; +import com.fasterxml.jackson.databind.util.RootNameLookup; +import de.codecentric.boot.admin.server.domain.values.Registration; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.TimeZone; +import org.junit.Test; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.http.converter.json.SpringHandlerInstantiator; + +public class RegistrationBeanSerializerModifierDiffblueTest { + + /** + * Test + * {@link RegistrationBeanSerializerModifier#changeProperties(SerializationConfig, BeanDescription, List)}. + *

    + *
  • Given {@code Registration}.
  • + *
+ *

+ * Method under test: + * {@link RegistrationBeanSerializerModifier#changeProperties(SerializationConfig, BeanDescription, List)} + */ + @Test + public void testChangeProperties_givenDeCodecentricBootAdminServerDomainValuesRegistration() { + // Arrange + RegistrationBeanSerializerModifier registrationBeanSerializerModifier = new RegistrationBeanSerializerModifier( + new SanitizingMapSerializer(new String[] { "Patterns" })); + BasicClassIntrospector ci = new BasicClassIntrospector(); + JacksonAnnotationIntrospector ai = new JacksonAnnotationIntrospector(); + PropertyNamingStrategy pns = new PropertyNamingStrategy(); + TypeFactory tf = TypeFactory.createDefaultInstance(); + DefaultTypeResolverBuilder typer = new DefaultTypeResolverBuilder(DefaultTyping.JAVA_LANG_OBJECT); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/mm/dd"); + SpringHandlerInstantiator hi = new SpringHandlerInstantiator(new DefaultListableBeanFactory()); + Locale locale = Locale.getDefault(); + TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles"); + Base64Variant defaultBase64 = Base64Variants.getDefaultVariant(); + DefaultBaseTypeLimitingValidator ptv = new DefaultBaseTypeLimitingValidator(); + BaseSettings base = new BaseSettings(ci, ai, pns, tf, typer, dateFormat, hi, locale, tz, defaultBase64, ptv, + new Provider()); + + StdSubtypeResolver str = new StdSubtypeResolver(); + SimpleMixInResolver mixins = new SimpleMixInResolver(mock(MixInResolver.class)); + RootNameLookup rootNames = new RootNameLookup(); + SerializationConfig config = new SerializationConfig(base, str, mixins, rootNames, new ConfigOverrides()); + + BeanDescription beanDesc = mock(BeanDescription.class); + Class forNameResult = Registration.class; + org.mockito.Mockito.>when(beanDesc.getBeanClass()).thenReturn(forNameResult); + + // Act + List actualChangePropertiesResult = registrationBeanSerializerModifier + .changeProperties(config, beanDesc, new ArrayList<>()); + + // Assert + verify(beanDesc).getBeanClass(); + assertTrue(actualChangePropertiesResult.isEmpty()); + } + + /** + * Test + * {@link RegistrationBeanSerializerModifier#changeProperties(SerializationConfig, BeanDescription, List)}. + *

    + *
  • Given {@code Object}.
  • + *
+ *

+ * Method under test: + * {@link RegistrationBeanSerializerModifier#changeProperties(SerializationConfig, BeanDescription, List)} + */ + @Test + public void testChangeProperties_givenJavaLangObject() { + // Arrange + RegistrationBeanSerializerModifier registrationBeanSerializerModifier = new RegistrationBeanSerializerModifier( + new SanitizingMapSerializer(new String[] { "Patterns" })); + BasicClassIntrospector ci = new BasicClassIntrospector(); + JacksonAnnotationIntrospector ai = new JacksonAnnotationIntrospector(); + PropertyNamingStrategy pns = new PropertyNamingStrategy(); + TypeFactory tf = TypeFactory.createDefaultInstance(); + DefaultTypeResolverBuilder typer = new DefaultTypeResolverBuilder(DefaultTyping.JAVA_LANG_OBJECT); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/mm/dd"); + SpringHandlerInstantiator hi = new SpringHandlerInstantiator(new DefaultListableBeanFactory()); + Locale locale = Locale.getDefault(); + TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles"); + Base64Variant defaultBase64 = Base64Variants.getDefaultVariant(); + DefaultBaseTypeLimitingValidator ptv = new DefaultBaseTypeLimitingValidator(); + BaseSettings base = new BaseSettings(ci, ai, pns, tf, typer, dateFormat, hi, locale, tz, defaultBase64, ptv, + new Provider()); + + StdSubtypeResolver str = new StdSubtypeResolver(); + SimpleMixInResolver mixins = new SimpleMixInResolver(mock(MixInResolver.class)); + RootNameLookup rootNames = new RootNameLookup(); + SerializationConfig config = new SerializationConfig(base, str, mixins, rootNames, new ConfigOverrides()); + + BeanDescription beanDesc = mock(BeanDescription.class); + Class forNameResult = Object.class; + org.mockito.Mockito.>when(beanDesc.getBeanClass()).thenReturn(forNameResult); + + // Act + List actualChangePropertiesResult = registrationBeanSerializerModifier + .changeProperties(config, beanDesc, new ArrayList<>()); + + // Assert + verify(beanDesc).getBeanClass(); + assertTrue(actualChangePropertiesResult.isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/RegistrationDeserializerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/RegistrationDeserializerDiffblueTest.java new file mode 100644 index 00000000000..48808fc83a2 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/RegistrationDeserializerDiffblueTest.java @@ -0,0 +1,27 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import de.codecentric.boot.admin.server.domain.values.Registration; +import org.junit.Test; + +public class RegistrationDeserializerDiffblueTest { + + /** + * Test new {@link RegistrationDeserializer} (default constructor). + *

+ * Method under test: default or parameterless constructor of + * {@link RegistrationDeserializer} + */ + @Test + public void testNewRegistrationDeserializer() { + // Arrange and Act + RegistrationDeserializer actualRegistrationDeserializer = new RegistrationDeserializer(); + + // Assert + assertNull(actualRegistrationDeserializer.getValueType()); + Class expectedValueClass = Registration.class; + assertEquals(expectedValueClass, actualRegistrationDeserializer.getValueClass()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/SanitizingMapSerializerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/SanitizingMapSerializerDiffblueTest.java new file mode 100644 index 00000000000..bde242ac642 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/SanitizingMapSerializerDiffblueTest.java @@ -0,0 +1,377 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonStreamContext; +import com.fasterxml.jackson.core.filter.FilteringGeneratorDelegate; +import com.fasterxml.jackson.core.filter.TokenFilter; +import com.fasterxml.jackson.core.filter.TokenFilter.Inclusion; +import com.fasterxml.jackson.core.filter.TokenFilterContext; +import com.fasterxml.jackson.core.util.JsonGeneratorDelegate; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; +import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; +import org.mockito.Mockito; + +public class SanitizingMapSerializerDiffblueTest { + + /** + * Test {@link SanitizingMapSerializer#SanitizingMapSerializer(String[])}. + *

+ * Method under test: + * {@link SanitizingMapSerializer#SanitizingMapSerializer(String[])} + */ + @Test + public void testNewSanitizingMapSerializer() { + // Arrange and Act + SanitizingMapSerializer actualSanitizingMapSerializer = new SanitizingMapSerializer( + new String[] { "Patterns" }); + + // Assert + assertNull(actualSanitizingMapSerializer.getDelegatee()); + assertFalse(actualSanitizingMapSerializer.isUnwrappingSerializer()); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer(new String[] {}); + + HashMap value = new HashMap<>(); + value.put("foo", "foo"); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeFieldName(Mockito.any()); + doNothing().when(d).writeString(Mockito.any()); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + JsonGeneratorDelegate gen = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeFieldName(eq("foo")); + verify(d).writeStartObject(); + verify(d).writeString(eq("foo")); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider2() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer( + new String[] { "Patterns", "java.util.Map" }); + + HashMap value = new HashMap<>(); + value.put("foo", "foo"); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeFieldName(Mockito.any()); + doNothing().when(d).writeString(Mockito.any()); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + JsonGeneratorDelegate gen = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeFieldName(eq("foo")); + verify(d).writeStartObject(); + verify(d).writeString(eq("foo")); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider3() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer(new String[] { "Patterns" }); + + HashMap value = new HashMap<>(); + value.put("foo", "foo"); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeString(Mockito.any()); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + JsonGeneratorDelegate d2 = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + TokenFilter tokenFilter = mock(TokenFilter.class); + when(tokenFilter.includeString(Mockito.any())).thenReturn(true); + TokenFilter tokenFilter2 = mock(TokenFilter.class); + when(tokenFilter2.includeEmptyObject(anyBoolean())).thenReturn(true); + when(tokenFilter2.includeProperty(Mockito.any())).thenReturn(tokenFilter); + doNothing().when(tokenFilter2).filterFinishObject(); + TokenFilter tokenFilter3 = mock(TokenFilter.class); + when(tokenFilter3.filterStartObject()).thenReturn(tokenFilter2); + TokenFilter f = mock(TokenFilter.class); + when(f.includeRootValue(anyInt())).thenReturn(tokenFilter3); + FilteringGeneratorDelegate gen = new FilteringGeneratorDelegate(d2, f, Inclusion.ONLY_INCLUDE_ALL, true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeStartObject(); + verify(d).writeString(eq("foo")); + verify(tokenFilter2).filterFinishObject(); + verify(tokenFilter3).filterStartObject(); + verify(tokenFilter2).includeEmptyObject(eq(true)); + verify(tokenFilter2).includeProperty(eq("foo")); + verify(f).includeRootValue(eq(0)); + verify(tokenFilter).includeString(eq("foo")); + JsonStreamContext filterContext = gen.getFilterContext(); + assertTrue(filterContext instanceof TokenFilterContext); + assertEquals(1, filterContext.getEntryCount()); + assertEquals(1, gen.getMatchCount()); + assertTrue(filterContext.hasCurrentIndex()); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider4() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer(new String[] { "patterns" }); + + HashMap value = new HashMap<>(); + value.put("foo", "foo"); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + doNothing().when(d).writeString(Mockito.any()); + JsonGeneratorDelegate d2 = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + TokenFilter tokenFilter = mock(TokenFilter.class); + when(tokenFilter.includeEmptyObject(anyBoolean())).thenReturn(true); + doNothing().when(tokenFilter).filterFinishObject(); + TokenFilter tokenFilter2 = mock(TokenFilter.class); + when(tokenFilter2.includeString(Mockito.any())).thenReturn(true); + when(tokenFilter2.filterStartObject()).thenReturn(tokenFilter); + TokenFilter f = mock(TokenFilter.class); + when(f.includeRootValue(anyInt())).thenReturn(tokenFilter2); + JsonGeneratorDelegate d3 = new JsonGeneratorDelegate( + new FilteringGeneratorDelegate(d2, f, Inclusion.ONLY_INCLUDE_ALL, true), true); + + TokenFilter tokenFilter3 = mock(TokenFilter.class); + when(tokenFilter3.includeString(Mockito.any())).thenReturn(true); + TokenFilter tokenFilter4 = mock(TokenFilter.class); + when(tokenFilter4.includeEmptyObject(anyBoolean())).thenReturn(true); + when(tokenFilter4.includeProperty(Mockito.any())).thenReturn(tokenFilter3); + doNothing().when(tokenFilter4).filterFinishObject(); + TokenFilter tokenFilter5 = mock(TokenFilter.class); + when(tokenFilter5.filterStartObject()).thenReturn(tokenFilter4); + TokenFilter f2 = mock(TokenFilter.class); + when(f2.includeRootValue(anyInt())).thenReturn(tokenFilter5); + FilteringGeneratorDelegate gen = new FilteringGeneratorDelegate(d3, f2, Inclusion.ONLY_INCLUDE_ALL, true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeStartObject(); + verify(d).writeString(eq("foo")); + verify(tokenFilter).filterFinishObject(); + verify(tokenFilter4).filterFinishObject(); + verify(tokenFilter2).filterStartObject(); + verify(tokenFilter5).filterStartObject(); + verify(tokenFilter).includeEmptyObject(eq(false)); + verify(tokenFilter4).includeEmptyObject(eq(true)); + verify(tokenFilter4).includeProperty(eq("foo")); + verify(f, atLeast(1)).includeRootValue(anyInt()); + verify(f2).includeRootValue(eq(0)); + verify(tokenFilter2).includeString(eq("foo")); + verify(tokenFilter3).includeString(eq("foo")); + JsonGenerator delegateResult = gen.delegate(); + JsonGenerator delegateResult2 = ((JsonGeneratorDelegate) delegateResult).delegate(); + assertTrue(delegateResult2 instanceof FilteringGeneratorDelegate); + JsonStreamContext outputContext = delegateResult.getOutputContext(); + assertTrue(outputContext instanceof TokenFilterContext); + assertTrue(delegateResult instanceof JsonGeneratorDelegate); + assertEquals(1, outputContext.getCurrentIndex()); + assertEquals(1, ((FilteringGeneratorDelegate) delegateResult2).getMatchCount()); + assertEquals(2, outputContext.getEntryCount()); + assertTrue(outputContext.hasCurrentIndex()); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

    + *
  • Given {@code patterns}.
  • + *
+ *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider_givenPatterns() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer(new String[] { "Patterns" }); + + HashMap value = new HashMap<>(); + value.put("patterns", "foo"); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeFieldName(Mockito.any()); + doNothing().when(d).writeString(Mockito.any()); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + JsonGeneratorDelegate gen = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeFieldName(eq("patterns")); + verify(d).writeStartObject(); + verify(d).writeString(eq("******")); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

    + *
  • Then calls {@link JsonGenerator#writeFieldName(String)}.
  • + *
+ *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider_thenCallsWriteFieldName() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer(new String[] { "Patterns" }); + + HashMap value = new HashMap<>(); + value.put("foo", "foo"); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeFieldName(Mockito.any()); + doNothing().when(d).writeString(Mockito.any()); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + JsonGeneratorDelegate gen = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeFieldName(eq("foo")); + verify(d).writeStartObject(); + verify(d).writeString(eq("foo")); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider_whenHashMap() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer(new String[] { "Patterns" }); + HashMap value = new HashMap<>(); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + JsonGeneratorDelegate gen = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeStartObject(); + } + + /** + * Test + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + * with {@code Map}, {@code JsonGenerator}, {@code SerializerProvider}. + *

    + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link SanitizingMapSerializer#serialize(Map, JsonGenerator, SerializerProvider)} + */ + @Test + public void testSerializeWithMapJsonGeneratorSerializerProvider_whenHashMapFooIsNull() throws IOException { + // Arrange + SanitizingMapSerializer sanitizingMapSerializer = new SanitizingMapSerializer(new String[] { "Patterns" }); + + HashMap value = new HashMap<>(); + value.put("foo", null); + JsonGenerator d = mock(JsonGenerator.class); + doNothing().when(d).writeFieldName(Mockito.any()); + doNothing().when(d).writeString(Mockito.any()); + doNothing().when(d).writeEndObject(); + doNothing().when(d).writeStartObject(); + JsonGeneratorDelegate gen = new JsonGeneratorDelegate(new JsonGeneratorDelegate(d), true); + + // Act + sanitizingMapSerializer.serialize(value, gen, new Impl()); + + // Assert + verify(d).writeEndObject(); + verify(d).writeFieldName(eq("foo")); + verify(d).writeStartObject(); + verify(d).writeString((String) isNull()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/StatusInfoMixinDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/StatusInfoMixinDiffblueTest.java new file mode 100644 index 00000000000..355916fb590 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/StatusInfoMixinDiffblueTest.java @@ -0,0 +1,59 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import de.codecentric.boot.admin.server.domain.values.StatusInfo; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class StatusInfoMixinDiffblueTest { + + /** + * Test {@link StatusInfoMixin#valueOf(String, Map)}. + *

    + *
  • When {@code not blank}.
  • + *
  • Then return Status is {@code NOT BLANK}.
  • + *
+ *

+ * Method under test: {@link StatusInfoMixin#valueOf(String, Map)} + */ + @Test + public void testValueOf_whenNotBlank_thenReturnStatusIsNotBlank() { + // Arrange and Act + StatusInfo actualValueOfResult = StatusInfoMixin.valueOf("not blank", null); + + // Assert + assertEquals("NOT BLANK", actualValueOfResult.getStatus()); + assertFalse(actualValueOfResult.isDown()); + assertFalse(actualValueOfResult.isOffline()); + assertFalse(actualValueOfResult.isUnknown()); + assertFalse(actualValueOfResult.isUp()); + assertTrue(actualValueOfResult.getDetails().isEmpty()); + } + + /** + * Test {@link StatusInfoMixin#valueOf(String, Map)}. + *

    + *
  • When {@code Status Code}.
  • + *
  • Then return Status is {@code STATUS CODE}.
  • + *
+ *

+ * Method under test: {@link StatusInfoMixin#valueOf(String, Map)} + */ + @Test + public void testValueOf_whenStatusCode_thenReturnStatusIsStatusCode() { + // Arrange and Act + StatusInfo actualValueOfResult = StatusInfoMixin.valueOf("Status Code", new HashMap<>()); + + // Assert + assertEquals("STATUS CODE", actualValueOfResult.getStatus()); + assertFalse(actualValueOfResult.isDown()); + assertFalse(actualValueOfResult.isOffline()); + assertFalse(actualValueOfResult.isUnknown()); + assertFalse(actualValueOfResult.isUp()); + assertTrue(actualValueOfResult.getDetails().isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/TagsMixinDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/TagsMixinDiffblueTest.java new file mode 100644 index 00000000000..94cd81fb02c --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/utils/jackson/TagsMixinDiffblueTest.java @@ -0,0 +1,94 @@ +package de.codecentric.boot.admin.server.utils.jackson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class TagsMixinDiffblueTest { + + /** + * Test {@link TagsMixin#from(Map)}. + *

    + *
  • Given {@code 42}.
  • + *
  • When {@link HashMap#HashMap()} {@code 42} is {@code 42}.
  • + *
  • Then return Values is {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link TagsMixin#from(Map)} + */ + @Test + public void testFrom_given42_whenHashMap42Is42_thenReturnValuesIsHashMap() { + // Arrange + HashMap map = new HashMap<>(); + map.put("42", "42"); + map.put("foo", "42"); + + // Act and Assert + assertEquals(map, TagsMixin.from(map).getValues()); + } + + /** + * Test {@link TagsMixin#from(Map)}. + *

    + *
  • Given {@code foo}.
  • + *
  • When {@link HashMap#HashMap()} {@code foo} is {@code 42}.
  • + *
  • Then return Values size is one.
  • + *
+ *

+ * Method under test: {@link TagsMixin#from(Map)} + */ + @Test + public void testFrom_givenFoo_whenHashMapFooIs42_thenReturnValuesSizeIsOne() { + // Arrange + HashMap map = new HashMap<>(); + map.put("foo", "42"); + + // Act and Assert + Map values = TagsMixin.from(map).getValues(); + assertEquals(1, values.size()); + assertEquals("42", values.get("foo")); + } + + /** + * Test {@link TagsMixin#from(Map)}. + *

    + *
  • Given {@link HashMap#HashMap()} {@code null} is {@link HashMap#HashMap()}.
  • + *
  • When {@link HashMap#HashMap()} {@code null} is {@link HashMap#HashMap()}.
  • + *
+ *

+ * Method under test: {@link TagsMixin#from(Map)} + */ + @Test + public void testFrom_givenHashMapNullIsHashMap_whenHashMapNullIsHashMap() { + // Arrange + HashMap objectObjectMap = new HashMap<>(); + objectObjectMap.put(null, new HashMap<>()); + + HashMap objectObjectMap2 = new HashMap<>(); + objectObjectMap2.put(null, objectObjectMap); + + HashMap map = new HashMap<>(); + map.put(null, objectObjectMap2); + + // Act and Assert + assertTrue(TagsMixin.from(map).getValues().isEmpty()); + } + + /** + * Test {@link TagsMixin#from(Map)}. + *

    + *
  • When {@link HashMap#HashMap()}.
  • + *
  • Then return Values Empty.
  • + *
+ *

+ * Method under test: {@link TagsMixin#from(Map)} + */ + @Test + public void testFrom_whenHashMap_thenReturnValuesEmpty() { + // Arrange, Act and Assert + assertTrue(TagsMixin.from(new HashMap<>()).getValues().isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/ApplicationsControllerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/ApplicationsControllerDiffblueTest.java new file mode 100644 index 00000000000..77e606595bb --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/ApplicationsControllerDiffblueTest.java @@ -0,0 +1,1469 @@ +package de.codecentric.boot.admin.server.web; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.Application; +import de.codecentric.boot.admin.server.domain.entities.Application.Builder; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.BuildVersion; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventPublisher; +import de.codecentric.boot.admin.server.services.ApplicationRegistry; +import de.codecentric.boot.admin.server.services.InstanceFilter; +import de.codecentric.boot.admin.server.services.InstanceIdGenerator; +import de.codecentric.boot.admin.server.services.InstanceRegistry; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; +import org.springframework.http.ResponseEntity; +import org.springframework.http.codec.ServerSentEvent; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.publisher.Flux; +import reactor.core.publisher.GroupedFlux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { ApplicationsController.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class ApplicationsControllerDiffblueTest { + + @Mock + private ApplicationEventPublisher applicationEventPublisher; + + @MockitoBean + private ApplicationRegistry applicationRegistry; + + @Autowired + private ApplicationsController applicationsController; + + /** + * Test + * {@link ApplicationsController#ApplicationsController(ApplicationRegistry, ApplicationEventPublisher)}. + *

+ * Method under test: + * {@link ApplicationsController#ApplicationsController(ApplicationRegistry, ApplicationEventPublisher)} + */ + @Test + public void testNewApplicationsController() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationsController#applications()}. + *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationsController#applications()}. + *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications2() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link ApplicationsController#applications()}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#applications()}. + *
    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter2() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux> flux3 = mock(Flux.class); + when(flux3.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.groupBy(Mockito.>any())).thenReturn(flux3); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux4); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux3).flatMap(isA(Function.class)); + verify(flux4).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#applications()}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#applications()}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function, int)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function, int)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap2() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any(), anyInt())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.filter(Mockito.>any())).thenReturn(flux3); + Flux> flux5 = mock(Flux.class); + when(flux5.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux4); + Flux flux6 = mock(Flux.class); + when(flux6.groupBy(Mockito.>any())).thenReturn(flux5); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux6); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux4).filter(isA(Predicate.class)); + verify(flux3).filter(isA(Predicate.class)); + verify(flux5).flatMap(isA(Function.class)); + verify(flux).flatMap(isA(Function.class), eq(2147483647)); + verify(flux6).groupBy(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#applications()}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_givenFluxGroupByReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + Flux> flux4 = mock(Flux.class); + when(flux4.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux3); + Flux flux5 = mock(Flux.class); + when(flux5.groupBy(Mockito.>any())).thenReturn(flux4); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux5); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux3).filter(isA(Predicate.class)); + verify(flux2).filter(isA(Predicate.class)); + verify(flux4).flatMap(isA(Function.class)); + verify(flux5).groupBy(isA(Function.class)); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#applications()}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#applications()}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link ApplicationsController#applications()}. + *

    + *
  • Then calls {@link ApplicationRegistry#getApplications()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_thenCallsGetApplications() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(applicationRegistry.getApplications()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(applicationsController.applications()); + createResult.expectComplete().verify(); + verify(applicationRegistry).getApplications(); + } + + /** + * Test {@link ApplicationsController#applications()}. + *

    + *
  • Then calls {@link InstanceRegistry#getInstances()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applications()} + */ + @Test + public void testApplications_thenCallsGetInstances() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = mock(InstanceRegistry.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(new ApplicationsController( + new ApplicationRegistry(instanceRegistry, mock(InstanceEventPublisher.class)), + mock(ApplicationEventPublisher.class)) + .applications()); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(); + } + + /** + * Test {@link ApplicationsController#refreshApplications()}. + *

+ * Method under test: {@link ApplicationsController#refreshApplications()} + */ + @Test + public void testRefreshApplications() { + // Arrange + doNothing().when(applicationEventPublisher).publishEvent(Mockito.any()); + + // Act + new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), applicationEventPublisher) + .refreshApplications(); + + // Assert + verify(applicationEventPublisher).publishEvent(isA(ApplicationEvent.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication() throws AssertionError { + // Arrange + Builder builderResult = Application.builder(); + String s = "foo"; + BuildVersion buildVersion = BuildVersion.valueOf(s); + Builder buildVersionResult = builderResult.buildVersion(buildVersion); + Builder statusResult = buildVersionResult.instances(new ArrayList<>()).name("Name").status("Status"); + Application buildResult = statusResult + .statusTimestamp(LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC).toInstant()) + .build(); + Mono justResult = Mono.just(buildResult); + when(applicationRegistry.getApplication(Mockito.any())).thenReturn(justResult); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(applicationsController.application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + Application body = responseEntity.getBody(); + assertSame(buildVersion, body.getBuildVersion()); + assertTrue(body.getInstances().isEmpty()); + assertEquals("Name", body.getName()); + assertEquals("Status", body.getStatus()); + Instant statusTimestamp = body.getStatusTimestamp(); + assertEquals(0L, statusTimestamp.getEpochSecond()); + assertEquals(0, statusTimestamp.getNano()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.OK, statusCode); + assertEquals(200, responseEntity.getStatusCodeValue()); + assertTrue(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(applicationRegistry).getApplication(eq("Name")); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication2() throws AssertionError { + // Arrange, Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication3() throws AssertionError { + // Arrange, Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.filter(Mockito.>any())).thenReturn(flux3); + Flux> flux5 = mock(Flux.class); + when(flux5.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux4); + Flux flux6 = mock(Flux.class); + when(flux6.groupBy(Mockito.>any())).thenReturn(flux5); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux6); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).collectList(); + verify(flux4).filter(isA(Predicate.class)); + verify(flux3).filter(isA(Predicate.class)); + verify(flux2).filter(isA(Predicate.class)); + verify(flux5).flatMap(isA(Function.class)); + verify(flux6).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter2() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux> flux3 = mock(Flux.class); + when(flux3.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.groupBy(Mockito.>any())).thenReturn(flux3); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux4); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux3).flatMap(isA(Function.class)); + verify(flux4).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter3() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + Flux> flux4 = mock(Flux.class); + when(flux4.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux3); + Flux flux5 = mock(Flux.class); + when(flux5.groupBy(Mockito.>any())).thenReturn(flux4); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux5); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux3).filter(isA(Predicate.class)); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux4).flatMap(isA(Function.class)); + verify(flux5).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@code Data}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenMonoFilterReturnJustData_thenCallsFilter() throws AssertionError { + // Arrange + Mono mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.filter(Mockito.>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.map(Mockito., Object>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.filter(Mockito.>any())).thenReturn(flux3); + Flux> flux5 = mock(Flux.class); + when(flux5.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux4); + Flux flux6 = mock(Flux.class); + when(flux6.groupBy(Mockito.>any())).thenReturn(flux5); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux6); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.expectError().verify(); + verify(eventStore).findAll(); + verify(flux).collectList(); + verify(flux4).filter(isA(Predicate.class)); + verify(flux3).filter(isA(Predicate.class)); + verify(flux2).filter(isA(Predicate.class)); + verify(flux5).flatMap(isA(Function.class)); + verify(flux6).groupBy(isA(Function.class)); + verify(mono).filter(isA(Predicate.class)); + verify(mono2).map(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *
    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_givenMonoMapReturnJustData_thenCallsCollectList() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.filter(Mockito.>any())).thenReturn(flux3); + Flux> flux5 = mock(Flux.class); + when(flux5.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux4); + Flux flux6 = mock(Flux.class); + when(flux6.groupBy(Mockito.>any())).thenReturn(flux5); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux6); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.expectError().verify(); + verify(eventStore).findAll(); + verify(flux).collectList(); + verify(flux4).filter(isA(Predicate.class)); + verify(flux3).filter(isA(Predicate.class)); + verify(flux2).filter(isA(Predicate.class)); + verify(flux5).flatMap(isA(Function.class)); + verify(flux6).groupBy(isA(Function.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#application(String)}. + *
    + *
  • Then calls {@link InstanceRegistry#getInstances(String)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#application(String)} + */ + @Test + public void testApplication_thenCallsGetInstances() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = mock(InstanceRegistry.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep> createResult = StepVerifier.create(new ApplicationsController( + new ApplicationRegistry(instanceRegistry, mock(InstanceEventPublisher.class)), + mock(ApplicationEventPublisher.class)) + .application("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Name")); + } + + /** + * Test {@link ApplicationsController#applicationsStream()}. + *

    + *
  • Then calls {@link Flux#mergeWith(Publisher)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#applicationsStream()} + */ + @Test + public void testApplicationsStream_thenCallsMergeWith() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.mergeWith(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.map(Mockito.>any())).thenReturn(flux); + when(applicationRegistry.getApplicationStream()).thenReturn(flux2); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(applicationsController.applicationsStream()); + createResult.expectComplete().verify(); + verify(applicationRegistry).getApplicationStream(); + verify(flux2).map(isA(Function.class)); + verify(flux).mergeWith(isA(Publisher.class)); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister() throws AssertionError { + // Arrange, Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister2() throws AssertionError { + // Arrange, Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *

    + *
  • Given {@link ApplicationRegistry} + * {@link ApplicationRegistry#deregister(String)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenApplicationRegistryDeregisterReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(applicationRegistry.deregister(Mockito.any())).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep> createResult = StepVerifier.create(applicationsController.unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(applicationRegistry).deregister(eq("Name")); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + when(applicationRegistry.deregister(Mockito.any())).thenReturn(flux); + + // Act and Assert + FirstStep> createResult = StepVerifier.create(applicationsController.unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(applicationRegistry).deregister(eq("Name")); + verify(flux).collectList(); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenFluxFilterReturnFromIterableArrayList_thenCallsFilter2() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux> flux3 = mock(Flux.class); + when(flux3.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.groupBy(Mockito.>any())).thenReturn(flux3); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux4); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux3).flatMap(isA(Function.class)); + verify(flux4).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.filter(Mockito.>any())).thenReturn(flux2); + Flux> flux4 = mock(Flux.class); + when(flux4.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux3); + Flux flux5 = mock(Flux.class); + when(flux5.groupBy(Mockito.>any())).thenReturn(flux4); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux5); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux3).filter(isA(Predicate.class)); + verify(flux2).filter(isA(Predicate.class)); + verify(flux4).flatMap(isA(Function.class)); + verify(flux).flatMap(isA(Function.class)); + verify(flux5).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new ApplicationsController(new ApplicationRegistry( + new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + mock(InstanceEventPublisher.class)), mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link ApplicationsController#unregister(String)}. + *

    + *
  • Then calls {@link InstanceRegistry#getInstances(String)}.
  • + *
+ *

+ * Method under test: {@link ApplicationsController#unregister(String)} + */ + @Test + public void testUnregister_thenCallsGetInstances() throws AssertionError { + // Arrange + InstanceRegistry instanceRegistry = mock(InstanceRegistry.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep> createResult = StepVerifier.create(new ApplicationsController( + new ApplicationRegistry(instanceRegistry, mock(InstanceEventPublisher.class)), + mock(ApplicationEventPublisher.class)) + .unregister("Name")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Name")); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/HttpHeaderFilterDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/HttpHeaderFilterDiffblueTest.java new file mode 100644 index 00000000000..a5e703d0d17 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/HttpHeaderFilterDiffblueTest.java @@ -0,0 +1,88 @@ +package de.codecentric.boot.admin.server.web; + +import static org.junit.Assert.assertEquals; +import java.util.HashSet; +import java.util.List; +import org.junit.Test; +import org.springframework.http.HttpHeaders; + +public class HttpHeaderFilterDiffblueTest { + + /** + * Test {@link HttpHeaderFilter#filterHeaders(HttpHeaders)}. + *

    + *
  • Given {@code Header Name}.
  • + *
  • Then return size is two.
  • + *
+ *

+ * Method under test: {@link HttpHeaderFilter#filterHeaders(HttpHeaders)} + */ + @Test + public void testFilterHeaders_givenHeaderName_thenReturnSizeIsTwo() { + // Arrange + HttpHeaderFilter httpHeaderFilter = new HttpHeaderFilter(new HashSet<>()); + + HttpHeaders headers = new HttpHeaders(); + headers.add("Header Name", "42"); + headers.add("https://example.org/example", "https://example.org/example"); + + // Act + HttpHeaders actualFilterHeadersResult = httpHeaderFilter.filterHeaders(headers); + + // Assert + assertEquals(2, actualFilterHeadersResult.size()); + List getResult = actualFilterHeadersResult.get("Header Name"); + assertEquals(1, getResult.size()); + assertEquals("42", getResult.get(0)); + List getResult2 = actualFilterHeadersResult.get("https://example.org/example"); + assertEquals(1, getResult2.size()); + assertEquals("https://example.org/example", getResult2.get(0)); + } + + /** + * Test {@link HttpHeaderFilter#filterHeaders(HttpHeaders)}. + *

    + *
  • Given {@code https://example.org/example}.
  • + *
  • Then return size is one.
  • + *
+ *

+ * Method under test: {@link HttpHeaderFilter#filterHeaders(HttpHeaders)} + */ + @Test + public void testFilterHeaders_givenHttpsExampleOrgExample_thenReturnSizeIsOne() { + // Arrange + HttpHeaderFilter httpHeaderFilter = new HttpHeaderFilter(new HashSet<>()); + + HttpHeaders headers = new HttpHeaders(); + headers.add("https://example.org/example", "https://example.org/example"); + + // Act + HttpHeaders actualFilterHeadersResult = httpHeaderFilter.filterHeaders(headers); + + // Assert + assertEquals(1, actualFilterHeadersResult.size()); + List getResult = actualFilterHeadersResult.get("https://example.org/example"); + assertEquals(1, getResult.size()); + assertEquals("https://example.org/example", getResult.get(0)); + } + + /** + * Test {@link HttpHeaderFilter#filterHeaders(HttpHeaders)}. + *

    + *
  • When {@link HttpHeaders#HttpHeaders()}.
  • + *
  • Then return {@link HttpHeaders#HttpHeaders()}.
  • + *
+ *

+ * Method under test: {@link HttpHeaderFilter#filterHeaders(HttpHeaders)} + */ + @Test + public void testFilterHeaders_whenHttpHeaders_thenReturnHttpHeaders() { + // Arrange + HttpHeaderFilter httpHeaderFilter = new HttpHeaderFilter(new HashSet<>()); + HttpHeaders headers = new HttpHeaders(); + + // Act and Assert + assertEquals(headers, httpHeaderFilter.filterHeaders(headers)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/InstanceWebProxyDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/InstanceWebProxyDiffblueTest.java new file mode 100644 index 00000000000..d274b09ee0b --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/InstanceWebProxyDiffblueTest.java @@ -0,0 +1,48 @@ +package de.codecentric.boot.admin.server.web; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.notify.PagerdutyNotifier; +import de.codecentric.boot.admin.server.web.InstanceWebProxy.ForwardRequest; +import de.codecentric.boot.admin.server.web.InstanceWebProxy.InstanceResponse; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import java.util.ArrayList; +import org.junit.Test; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.web.reactive.function.BodyInserter; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import reactor.core.publisher.Flux; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class InstanceWebProxyDiffblueTest { + + /** + * Test {@link InstanceWebProxy#forward(Flux, ForwardRequest)} with {@code instances}, + * {@code forwardRequest}. + *

+ * Method under test: {@link InstanceWebProxy#forward(Flux, ForwardRequest)} + */ + @Test + public void testForwardWithInstancesForwardRequest() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InstanceWebProxy instanceWebProxy = new InstanceWebProxy(instanceWebClient); + Flux instances = Flux.fromIterable(new ArrayList<>()); + HttpMethod method = HttpMethod.valueOf("https://example.org/example"); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(instanceWebProxy.forward(instances, new ForwardRequest(PagerdutyNotifier.DEFAULT_URI, method, + new HttpHeaders(), mock(BodyInserter.class)))); + createResult.expectComplete().verify(); + verify(builder).build(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/InstancesControllerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/InstancesControllerDiffblueTest.java new file mode 100644 index 00000000000..9ee69f9157e --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/InstancesControllerDiffblueTest.java @@ -0,0 +1,1101 @@ +package de.codecentric.boot.admin.server.web; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.eventstore.ConcurrentMapEventStore; +import de.codecentric.boot.admin.server.eventstore.HazelcastEventStore; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import de.codecentric.boot.admin.server.services.InstanceFilter; +import de.codecentric.boot.admin.server.services.InstanceIdGenerator; +import de.codecentric.boot.admin.server.services.InstanceRegistry; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.publisher.DirectProcessor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.GroupedFlux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { InstancesController.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class InstancesControllerDiffblueTest { + + @MockitoBean + private InstanceEventStore instanceEventStore; + + @MockitoBean + private InstanceRegistry instanceRegistry; + + @Autowired + private InstancesController instancesController; + + /** + * Test + * {@link InstancesController#InstancesController(InstanceRegistry, InstanceEventStore)}. + *

+ * Method under test: + * {@link InstancesController#InstancesController(InstanceRegistry, InstanceEventStore)} + */ + @Test + public void testNewInstancesController() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).events()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstancesController#instances()}. + *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstancesController#instances()}. + *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances2() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instancesController.instances("Name")); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Name")); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString2() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString3() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString4() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances("Name")); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *

    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return {@link Flux}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString_givenFluxFilterReturnFlux_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux> flux3 = mock(Flux.class); + when(flux3.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.groupBy(Mockito.>any())).thenReturn(flux3); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux4); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux3).flatMap(isA(Function.class)); + verify(flux4).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return {@link Flux}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString_givenFluxFlatMapReturnFlux_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString_givenFluxFlatMapReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString_givenFluxGroupByReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances("Name")); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances(String)} + * return create.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString_givenInstanceRegistryGetInstancesReturnCreate() { + // Arrange + DirectProcessor createResult = DirectProcessor.create(); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(createResult); + + // Act + instancesController.instances("Name"); + + // Assert + verify(instanceRegistry).getInstances(eq("Name")); + } + + /** + * Test {@link InstancesController#instances(String)} with {@code String}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances(String)} + * return {@link Flux}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances(String)} + */ + @Test + public void testInstancesWithString_givenInstanceRegistryGetInstancesReturnFlux() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instancesController.instances("Name")); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Name")); + verify(flux).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstancesController#instances()}. + *

    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return {@link Flux}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances_givenFluxFlatMapReturnFlux_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instances()}. + *
    + *
  • Given {@link Flux} {@link Flux#flatMap(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#flatMap(Function)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances_givenFluxFlatMapReturnFromIterableArrayList_thenCallsFlatMap() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instances()}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#groupBy(Function)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances_givenFluxGroupByReturnFromIterableArrayList_thenCallsGroupBy() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instances()}. + *

    + *
  • Given {@link HazelcastEventStore} {@link ConcurrentMapEventStore#findAll()} + * return fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances_givenHazelcastEventStoreFindAllReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instances()); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + } + + /** + * Test {@link InstancesController#instances()}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances()} return + * create.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances_givenInstanceRegistryGetInstancesReturnCreate() { + // Arrange + DirectProcessor createResult = DirectProcessor.create(); + when(instanceRegistry.getInstances()).thenReturn(createResult); + + // Act + instancesController.instances(); + + // Assert + verify(instanceRegistry).getInstances(); + } + + /** + * Test {@link InstancesController#instances()}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances()} return + * {@link Flux}.
  • + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances_givenInstanceRegistryGetInstancesReturnFlux_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances()).thenReturn(flux); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instancesController.instances()); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(); + verify(flux).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstancesController#instances()}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#getInstances()} return + * fromIterable {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instances()} + */ + @Test + public void testInstances_givenInstanceRegistryGetInstancesReturnFromIterableArrayList() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instancesController.instances()); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(); + } + + /** + * Test {@link InstancesController#instance(String)}. + *

+ * Method under test: {@link InstancesController#instance(String)} + */ + @Test + public void testInstance() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instance("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link InstancesController#instance(String)}. + *

+ * Method under test: {@link InstancesController#instance(String)} + */ + @Test + public void testInstance2() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instance("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link InstancesController#instance(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • When {@code 42}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instance(String)} + */ + @Test + public void testInstance_givenFluxCollectListReturnJustArrayList_when42_thenCallsCollectList() + throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instance("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + } + + /** + * Test {@link InstancesController#instance(String)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instance(String)} + */ + @Test + public void testInstance_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instance("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + } + + /** + * Test {@link InstancesController#instance(String)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • When {@code 42}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instance(String)} + */ + @Test + public void testInstance_givenMonoFilterReturnJustArrayList_when42_thenCallsCollectList() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instance("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstancesController#instance(String)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@code Data}.
  • + *
  • When {@code 42}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instance(String)} + */ + @Test + public void testInstance_givenMonoFilterReturnJustData_when42_thenCallsCollectList() throws AssertionError { + // Arrange + Mono mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.filter(Mockito.>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.map(Mockito., Object>>any())).thenReturn(mono); + Mono> mono3 = mock(Mono.class); + when(mono3.filter(Mockito.>>any())).thenReturn(mono2); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono3); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instance("42")); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono3).filter(isA(Predicate.class)); + verify(mono).filter(isA(Predicate.class)); + verify(mono2).map(isA(Function.class)); + } + + /** + * Test {@link InstancesController#instance(String)}. + *
    + *
  • Given {@link Mono} {@link Mono#map(Function)} return just {@code Data}.
  • + *
  • When {@code 42}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#instance(String)} + */ + @Test + public void testInstance_givenMonoMapReturnJustData_when42_thenCallsCollectList() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).instance("42")); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).unregister("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister2() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).unregister("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *

    + *
  • Given {@link Flux} {@link Flux#collectList()} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • Then calls {@link Flux#collectList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister_givenFluxCollectListReturnJustArrayList_thenCallsCollectList() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(flux.collectList()).thenReturn(justResult); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).unregister("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *

    + *
  • Given {@link HazelcastEventStore} + * {@link ConcurrentMapEventStore#find(InstanceId)} return fromIterable + * {@link ArrayList#ArrayList()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister_givenHazelcastEventStoreFindReturnFromIterableArrayList() throws AssertionError { + // Arrange + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.find(Mockito.any())).thenReturn(fromIterableResult); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).unregister("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NOT_FOUND, statusCode); + assertEquals(404, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(eventStore).find(isA(InstanceId.class)); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *

    + *
  • Given {@link InstanceRegistry} {@link InstanceRegistry#deregister(InstanceId)} + * return just {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister_givenInstanceRegistryDeregisterReturnJustInstanceIdWithValueIs42() + throws AssertionError { + // Arrange + Mono justResult = Mono.just(InstanceId.of("42")); + when(instanceRegistry.deregister(Mockito.any())).thenReturn(justResult); + + // Act and Assert + FirstStep> createResult = StepVerifier.create(instancesController.unregister("42")); + createResult.assertNext(r -> { + ResponseEntity responseEntity = r; + assertNull(responseEntity.getBody()); + assertTrue(responseEntity.getHeaders().isEmpty()); + HttpStatusCode statusCode = responseEntity.getStatusCode(); + assertTrue(statusCode instanceof HttpStatus); + assertEquals(HttpStatus.NO_CONTENT, statusCode); + assertEquals(204, responseEntity.getStatusCodeValue()); + assertFalse(responseEntity.hasBody()); + return; + }).expectComplete().verify(); + verify(instanceRegistry).deregister(isA(InstanceId.class)); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return just + * {@link ArrayList#ArrayList()}.
  • + *
  • When {@code 42}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister_givenMonoFilterReturnJustArrayList_when42_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono> justResult = Mono.just(new ArrayList<>()); + when(mono.filter(Mockito.>>any())).thenReturn(justResult); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).unregister("42")); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono).filter(isA(Predicate.class)); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *

    + *
  • Given {@link Mono} {@link Mono#filter(Predicate)} return {@link Mono}.
  • + *
  • When {@code 42}.
  • + *
  • Then calls {@link Mono#filter(Predicate)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister_givenMonoFilterReturnMono_when42_thenCallsFilter() throws AssertionError { + // Arrange + Mono> mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito., Object>>any())).thenReturn(justResult); + Mono> mono2 = mock(Mono.class); + when(mono2.filter(Mockito.>>any())).thenReturn(mono); + Flux flux = mock(Flux.class); + when(flux.collectList()).thenReturn(mono2); + HazelcastEventStore eventStore = mock(HazelcastEventStore.class); + when(eventStore.find(Mockito.any())).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).unregister("42")); + createResult.expectError().verify(); + verify(eventStore).find(isA(InstanceId.class)); + verify(flux).collectList(); + verify(mono2).filter(isA(Predicate.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link InstancesController#unregister(String)}. + *
    + *
  • Then calls + * {@link EventsourcingInstanceRepository#computeIfPresent(InstanceId, BiFunction)}.
  • + *
+ *

+ * Method under test: {@link InstancesController#unregister(String)} + */ + @Test + public void testUnregister_thenCallsComputeIfPresent() throws AssertionError { + // Arrange + Mono mono = mock(Mono.class); + Mono justResult = Mono.just("Data"); + when(mono.map(Mockito.>any())).thenReturn(justResult); + EventsourcingInstanceRepository repository = mock(EventsourcingInstanceRepository.class); + when(repository.computeIfPresent(Mockito.any(), + Mockito.>>any())) + .thenReturn(mono); + InstanceRegistry registry = new InstanceRegistry(repository, mock(InstanceIdGenerator.class), + mock(InstanceFilter.class)); + + // Act and Assert + FirstStep> createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).unregister("42")); + createResult.expectError().verify(); + verify(repository).computeIfPresent(isA(InstanceId.class), isA(BiFunction.class)); + verify(mono).map(isA(Function.class)); + } + + /** + * Test {@link InstancesController#events()}. + *

+ * Method under test: {@link InstancesController#events()} + */ + @Test + public void testEvents() throws AssertionError { + // Arrange + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new InstancesController(registry, new InMemoryEventStore()).events()); + createResult.expectComplete().verify(); + } + + /** + * Test {@link InstancesController#events()}. + *

    + *
  • Given {@link InstanceRegistry}.
  • + *
  • Then calls {@link InstanceEventStore#findAll()}.
  • + *
+ *

+ * Method under test: {@link InstancesController#events()} + */ + @Test + public void testEvents_givenInstanceRegistry_thenCallsFindAll() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceEventStore.findAll()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create(instancesController.events()); + createResult.expectComplete().verify(); + verify(instanceEventStore).findAll(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/PathUtilsDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/PathUtilsDiffblueTest.java new file mode 100644 index 00000000000..cce9f138ded --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/PathUtilsDiffblueTest.java @@ -0,0 +1,69 @@ +package de.codecentric.boot.admin.server.web; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class PathUtilsDiffblueTest { + + /** + * Test {@link PathUtils#normalizePath(String)}. + *

    + *
  • When {@code null}.
  • + *
  • Then return {@code null}.
  • + *
+ *

+ * Method under test: {@link PathUtils#normalizePath(String)} + */ + @Test + public void testNormalizePath_whenNull_thenReturnNull() { + // Arrange, Act and Assert + assertNull(PathUtils.normalizePath(null)); + } + + /** + * Test {@link PathUtils#normalizePath(String)}. + *

    + *
  • When {@code Path}.
  • + *
  • Then return {@code /Path}.
  • + *
+ *

+ * Method under test: {@link PathUtils#normalizePath(String)} + */ + @Test + public void testNormalizePath_whenPath_thenReturnPath() { + // Arrange, Act and Assert + assertEquals("/Path", PathUtils.normalizePath("Path")); + } + + /** + * Test {@link PathUtils#normalizePath(String)}. + *

    + *
  • When {@code ///}.
  • + *
  • Then return {@code /}.
  • + *
+ *

+ * Method under test: {@link PathUtils#normalizePath(String)} + */ + @Test + public void testNormalizePath_whenSlashSlashSlash_thenReturnSlash() { + // Arrange, Act and Assert + assertEquals("/", PathUtils.normalizePath("///")); + } + + /** + * Test {@link PathUtils#normalizePath(String)}. + *

    + *
  • When {@code /}.
  • + *
  • Then return empty string.
  • + *
+ *

+ * Method under test: {@link PathUtils#normalizePath(String)} + */ + @Test + public void testNormalizePath_whenSlash_thenReturnEmptyString() { + // Arrange, Act and Assert + assertEquals("", PathUtils.normalizePath("/")); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProviderDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProviderDiffblueTest.java new file mode 100644 index 00000000000..78343d87953 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProviderDiffblueTest.java @@ -0,0 +1,29 @@ +package de.codecentric.boot.admin.server.web.client; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@ContextConfiguration(classes = { BasicAuthHttpHeaderProvider.class }) +@RunWith(SpringJUnit4ClassRunner.class) +public class BasicAuthHttpHeaderProviderDiffblueTest { + + @Autowired + private BasicAuthHttpHeaderProvider basicAuthHttpHeaderProvider; + + /** + * Test {@link BasicAuthHttpHeaderProvider#encode(String, String)}. + *

+ * Method under test: {@link BasicAuthHttpHeaderProvider#encode(String, String)} + */ + @Test + public void testEncode() { + // Arrange, Act and Assert + assertEquals("Basic amFuZWRvZTpodHRwczovL2V4YW1wbGUub3JnL2V4YW1wbGU=", + basicAuthHttpHeaderProvider.encode("janedoe", "https://example.org/example")); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProviderDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProviderDiffblueTest.java new file mode 100644 index 00000000000..d5734c3eb3b --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProviderDiffblueTest.java @@ -0,0 +1,81 @@ +package de.codecentric.boot.admin.server.web.client; + +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import java.util.ArrayList; +import org.junit.Test; +import org.mockito.Mockito; +import org.springframework.http.HttpHeaders; + +public class CompositeHttpHeadersProviderDiffblueTest { + + /** + * Test {@link CompositeHttpHeadersProvider#getHeaders(Instance)}. + *

+ * Method under test: {@link CompositeHttpHeadersProvider#getHeaders(Instance)} + */ + @Test + public void testGetHeaders() { + // Arrange, Act and Assert + assertTrue(new CompositeHttpHeadersProvider(new ArrayList<>()).getHeaders(null).isEmpty()); + } + + /** + * Test {@link CompositeHttpHeadersProvider#getHeaders(Instance)}. + *

    + *
  • Then calls {@link HttpHeadersProvider#getHeaders(Instance)}.
  • + *
+ *

+ * Method under test: {@link CompositeHttpHeadersProvider#getHeaders(Instance)} + */ + @Test + public void testGetHeaders_thenCallsGetHeaders() { + // Arrange + HttpHeadersProvider httpHeadersProvider = mock(HttpHeadersProvider.class); + when(httpHeadersProvider.getHeaders(Mockito.any())).thenReturn(new HttpHeaders()); + + ArrayList delegates = new ArrayList<>(); + delegates.add(httpHeadersProvider); + + // Act + HttpHeaders actualHeaders = new CompositeHttpHeadersProvider(delegates).getHeaders(null); + + // Assert + verify(httpHeadersProvider).getHeaders(isNull()); + assertTrue(actualHeaders.isEmpty()); + } + + /** + * Test {@link CompositeHttpHeadersProvider#getHeaders(Instance)}. + *

    + *
  • Then calls {@link HttpHeadersProvider#getHeaders(Instance)}.
  • + *
+ *

+ * Method under test: {@link CompositeHttpHeadersProvider#getHeaders(Instance)} + */ + @Test + public void testGetHeaders_thenCallsGetHeaders2() { + // Arrange + HttpHeadersProvider httpHeadersProvider = mock(HttpHeadersProvider.class); + when(httpHeadersProvider.getHeaders(Mockito.any())).thenReturn(new HttpHeaders()); + HttpHeadersProvider httpHeadersProvider2 = mock(HttpHeadersProvider.class); + when(httpHeadersProvider2.getHeaders(Mockito.any())).thenReturn(new HttpHeaders()); + + ArrayList delegates = new ArrayList<>(); + delegates.add(httpHeadersProvider2); + delegates.add(httpHeadersProvider); + + // Act + HttpHeaders actualHeaders = new CompositeHttpHeadersProvider(delegates).getHeaders(null); + + // Assert + verify(httpHeadersProvider2).getHeaders(isNull()); + verify(httpHeadersProvider).getHeaders(isNull()); + assertTrue(actualHeaders.isEmpty()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/InstanceWebClientDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/InstanceWebClientDiffblueTest.java new file mode 100644 index 00000000000..c8738c39f01 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/InstanceWebClientDiffblueTest.java @@ -0,0 +1,294 @@ +package de.codecentric.boot.admin.server.web.client; + +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThrows; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.web.client.exception.ResolveInstanceException; +import java.util.List; +import java.util.function.Consumer; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.reactive.function.client.ExchangeFilterFunction; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import reactor.core.publisher.Mono; + +@ContextConfiguration(classes = { InstanceWebClient.Builder.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@RunWith(SpringJUnit4ClassRunner.class) +public class InstanceWebClientDiffblueTest { + + @Autowired + private InstanceWebClient.Builder builder; + + /** + * Test Builder + * {@link InstanceWebClient.Builder#filter(InstanceExchangeFilterFunction)}. + *

+ * Method under test: + * {@link InstanceWebClient.Builder#filter(InstanceExchangeFilterFunction)} + */ + @Test + public void testBuilderFilter() { + // Arrange, Act and Assert + assertSame(builder, builder.filter(mock(InstanceExchangeFilterFunction.class))); + } + + /** + * Test Builder {@link InstanceWebClient.Builder#filters(Consumer)}. + *

+ * Method under test: {@link InstanceWebClient.Builder#filters(Consumer)} + */ + @Test + public void testBuilderFilters() { + // Arrange + Consumer> filtersConsumer = mock(Consumer.class); + doNothing().when(filtersConsumer).accept(Mockito.>any()); + + // Act + InstanceWebClient.Builder actualFiltersResult = builder.filters(filtersConsumer); + + // Assert + verify(filtersConsumer).accept(isA(List.class)); + assertSame(builder, actualFiltersResult); + } + + /** + * Test {@link InstanceWebClient#instance(Instance)} with {@code Instance}. + *

+ * Method under test: {@link InstanceWebClient#instance(Instance)} + */ + @Test + public void testInstanceWithInstance() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenThrow(new ResolveInstanceException("An error occurred")); + Builder builder2 = mock(Builder.class); + when(builder2.filters(Mockito.>>any())).thenReturn(builder); + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenReturn(builder2); + + // Act and Assert + assertThrows(ResolveInstanceException.class, () -> new InstanceWebClient(webClient).instance((Instance) null)); + verify(webClient).mutate(); + verify(builder).build(); + verify(builder2).filters(isA(Consumer.class)); + } + + /** + * Test {@link InstanceWebClient#instance(Instance)} with {@code Instance}. + *

+ * Method under test: {@link InstanceWebClient#instance(Instance)} + */ + @Test + public void testInstanceWithInstance2() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.filters(Mockito.>>any())) + .thenThrow(new ResolveInstanceException("An error occurred")); + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenReturn(builder); + + // Act and Assert + assertThrows(ResolveInstanceException.class, () -> new InstanceWebClient(webClient).instance((Instance) null)); + verify(webClient).mutate(); + verify(builder).filters(isA(Consumer.class)); + } + + /** + * Test {@link InstanceWebClient#instance(Instance)} with {@code Instance}. + *

+ * Method under test: {@link InstanceWebClient#instance(Instance)} + */ + @Test + public void testInstanceWithInstance3() { + // Arrange + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenThrow(new ResolveInstanceException("An error occurred")); + + // Act and Assert + assertThrows(ResolveInstanceException.class, () -> new InstanceWebClient(webClient).instance((Instance) null)); + verify(webClient).mutate(); + } + + /** + * Test {@link InstanceWebClient#instance(Instance)} with {@code Instance}. + *

    + *
  • Given {@link Builder} {@link Builder#build()} return {@link WebClient}.
  • + *
  • Then calls {@link Builder#build()}.
  • + *
+ *

+ * Method under test: {@link InstanceWebClient#instance(Instance)} + */ + @Test + public void testInstanceWithInstance_givenBuilderBuildReturnWebClient_thenCallsBuild() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + Builder builder2 = mock(Builder.class); + when(builder2.filters(Mockito.>>any())).thenReturn(builder); + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenReturn(builder2); + + // Act + new InstanceWebClient(webClient).instance((Instance) null); + + // Assert + verify(webClient).mutate(); + verify(builder).build(); + verify(builder2).filters(isA(Consumer.class)); + } + + /** + * Test {@link InstanceWebClient#instance(Mono)} with {@code Mono}. + *

+ * Method under test: {@link InstanceWebClient#instance(Mono)} + */ + @Test + public void testInstanceWithMono() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenThrow(new ResolveInstanceException("An error occurred")); + Builder builder2 = mock(Builder.class); + when(builder2.filters(Mockito.>>any())).thenReturn(builder); + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenReturn(builder2); + Builder builder3 = mock(Builder.class); + when(builder3.build()).thenReturn(webClient); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder3).build(); + + // Act and Assert + assertThrows(ResolveInstanceException.class, () -> buildResult.instance(mock(Mono.class))); + verify(webClient).mutate(); + verify(builder3).build(); + verify(builder).build(); + verify(builder2).filters(isA(Consumer.class)); + } + + /** + * Test {@link InstanceWebClient#instance(Mono)} with {@code Mono}. + *

+ * Method under test: {@link InstanceWebClient#instance(Mono)} + */ + @Test + public void testInstanceWithMono2() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.filters(Mockito.>>any())) + .thenThrow(new ResolveInstanceException("An error occurred")); + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenReturn(builder); + Builder webClient2 = mock(Builder.class); + when(webClient2.build()).thenReturn(webClient); + InstanceWebClient.Builder builder2 = mock(InstanceWebClient.Builder.class); + when(builder2.webClient(Mockito.any())).thenReturn(InstanceWebClient.builder(webClient2)); + InstanceWebClient buildResult = builder2.webClient(mock(Builder.class)).build(); + + // Act and Assert + assertThrows(ResolveInstanceException.class, () -> buildResult.instance(mock(Mono.class))); + verify(builder2).webClient(isA(Builder.class)); + verify(webClient).mutate(); + verify(webClient2).build(); + verify(builder).filters(isA(Consumer.class)); + } + + /** + * Test {@link InstanceWebClient#instance(Mono)} with {@code Mono}. + *

    + *
  • Given {@link Builder} {@link Builder#filters(Consumer)} return + * {@link Builder}.
  • + *
  • When {@link Mono}.
  • + *
  • Then calls {@link Builder#filters(Consumer)}.
  • + *
+ *

+ * Method under test: {@link InstanceWebClient#instance(Mono)} + */ + @Test + public void testInstanceWithMono_givenBuilderFiltersReturnBuilder_whenMono_thenCallsFilters() { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + Builder builder2 = mock(Builder.class); + when(builder2.filters(Mockito.>>any())).thenReturn(builder); + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenReturn(builder2); + Builder builder3 = mock(Builder.class); + when(builder3.build()).thenReturn(webClient); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder3).build(); + + // Act + buildResult.instance(mock(Mono.class)); + + // Assert + verify(webClient).mutate(); + verify(builder3).build(); + verify(builder).build(); + verify(builder2).filters(isA(Consumer.class)); + } + + /** + * Test {@link InstanceWebClient#instance(Mono)} with {@code Mono}. + *

    + *
  • Given {@link InstanceWebClient.Builder} + * {@link InstanceWebClient.Builder#webClient(Builder)} return builder.
  • + *
  • Then calls {@link InstanceWebClient.Builder#webClient(Builder)}.
  • + *
+ *

+ * Method under test: {@link InstanceWebClient#instance(Mono)} + */ + @Test + public void testInstanceWithMono_givenBuilderWebClientReturnBuilder_thenCallsWebClient() { + // Arrange + InstanceWebClient.Builder builder = mock(InstanceWebClient.Builder.class); + when(builder.webClient(Mockito.any())).thenReturn(InstanceWebClient.builder()); + InstanceWebClient buildResult = builder.webClient(mock(Builder.class)).build(); + + // Act + buildResult.instance(mock(Mono.class)); + + // Assert + verify(builder).webClient(isA(Builder.class)); + } + + /** + * Test {@link InstanceWebClient#instance(Mono)} with {@code Mono}. + *

    + *
  • Then calls {@link InstanceWebClient.Builder#build()}.
  • + *
+ *

+ * Method under test: {@link InstanceWebClient#instance(Mono)} + */ + @Test + public void testInstanceWithMono_thenCallsBuild() { + // Arrange + WebClient webClient = mock(WebClient.class); + when(webClient.mutate()).thenThrow(new ResolveInstanceException("An error occurred")); + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(webClient); + InstanceWebClient buildResult = InstanceWebClient.builder().webClient(builder).build(); + InstanceWebClient.Builder builder2 = mock(InstanceWebClient.Builder.class); + when(builder2.build()).thenReturn(buildResult); + InstanceWebClient.Builder builder3 = mock(InstanceWebClient.Builder.class); + when(builder3.webClient(Mockito.any())).thenReturn(builder2); + InstanceWebClient buildResult2 = builder3.webClient(mock(Builder.class)).build(); + + // Act and Assert + assertThrows(ResolveInstanceException.class, () -> buildResult2.instance(mock(Mono.class))); + verify(builder2).build(); + verify(builder3).webClient(isA(Builder.class)); + verify(webClient).mutate(); + verify(builder).build(); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConverterDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConverterDiffblueTest.java new file mode 100644 index 00000000000..03052a7fcdd --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConverterDiffblueTest.java @@ -0,0 +1,82 @@ +package de.codecentric.boot.admin.server.web.client; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.ArrayList; +import java.util.function.Function; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import reactor.core.publisher.Flux; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { LegacyEndpointConverter.class, String.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class LegacyEndpointConverterDiffblueTest { + + @MockitoBean + private Function, Flux> function; + + @Autowired + private LegacyEndpointConverter legacyEndpointConverter; + + /** + * Test {@link LegacyEndpointConverter#canConvert(Object)}. + *

    + *
  • When empty string.
  • + *
  • Then return {@code true}.
  • + *
+ *

+ * Method under test: {@link LegacyEndpointConverter#canConvert(Object)} + */ + @Test + public void testCanConvert_whenEmptyString_thenReturnTrue() { + // Arrange, Act and Assert + assertTrue(legacyEndpointConverter.canConvert("")); + } + + /** + * Test {@link LegacyEndpointConverter#canConvert(Object)}. + *

    + *
  • When {@code Endpoint Id}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link LegacyEndpointConverter#canConvert(Object)} + */ + @Test + public void testCanConvert_whenEndpointId_thenReturnFalse() { + // Arrange, Act and Assert + assertFalse(legacyEndpointConverter.canConvert("Endpoint Id")); + } + + /** + * Test {@link LegacyEndpointConverter#convert(Flux)}. + *

+ * Method under test: {@link LegacyEndpointConverter#convert(Flux)} + */ + @Test + public void testConvert() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(function.apply(Mockito.>any())).thenReturn(fromIterableResult); + Flux body = Flux.fromIterable(new ArrayList<>()); + + // Act and Assert + FirstStep createResult = StepVerifier.create(legacyEndpointConverter.convert(body)); + createResult.expectComplete().verify(); + verify(function).apply(isA(Flux.class)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConvertersDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConvertersDiffblueTest.java new file mode 100644 index 00000000000..e138e9063b6 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConvertersDiffblueTest.java @@ -0,0 +1,186 @@ +package de.codecentric.boot.admin.server.web.client; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import org.junit.Test; +import org.springframework.core.io.buffer.DataBuffer; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class LegacyEndpointConvertersDiffblueTest { + + /** + * Test {@link LegacyEndpointConverters#health()}. + *

+ * Method under test: {@link LegacyEndpointConverters#health()} + */ + @Test + public void testHealth() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualHealthResult = LegacyEndpointConverters.health(); + + // Assert + assertFalse(actualHealthResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualHealthResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#env()}. + *

+ * Method under test: {@link LegacyEndpointConverters#env()} + */ + @Test + public void testEnv() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualEnvResult = LegacyEndpointConverters.env(); + + // Assert + assertFalse(actualEnvResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualEnvResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#httptrace()}. + *

+ * Method under test: {@link LegacyEndpointConverters#httptrace()} + */ + @Test + public void testHttptrace() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualHttptraceResult = LegacyEndpointConverters.httptrace(); + + // Assert + assertFalse(actualHttptraceResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualHttptraceResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#threaddump()}. + *

+ * Method under test: {@link LegacyEndpointConverters#threaddump()} + */ + @Test + public void testThreaddump() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualThreaddumpResult = LegacyEndpointConverters.threaddump(); + + // Assert + assertFalse(actualThreaddumpResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualThreaddumpResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#liquibase()}. + *

+ * Method under test: {@link LegacyEndpointConverters#liquibase()} + */ + @Test + public void testLiquibase() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualLiquibaseResult = LegacyEndpointConverters.liquibase(); + + // Assert + assertFalse(actualLiquibaseResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualLiquibaseResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#flyway()}. + *

+ * Method under test: {@link LegacyEndpointConverters#flyway()} + */ + @Test + public void testFlyway() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualFlywayResult = LegacyEndpointConverters.flyway(); + + // Assert + assertFalse(actualFlywayResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualFlywayResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#info()}. + *

+ * Method under test: {@link LegacyEndpointConverters#info()} + */ + @Test + public void testInfo() { + // Arrange and Act + LegacyEndpointConverter actualInfoResult = LegacyEndpointConverters.info(); + + // Assert + assertNull(actualInfoResult.convert(null)); + assertFalse(actualInfoResult.canConvert("Endpoint Id")); + } + + /** + * Test {@link LegacyEndpointConverters#beans()}. + *

+ * Method under test: {@link LegacyEndpointConverters#beans()} + */ + @Test + public void testBeans() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualBeansResult = LegacyEndpointConverters.beans(); + + // Assert + assertFalse(actualBeansResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualBeansResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#configprops()}. + *

+ * Method under test: {@link LegacyEndpointConverters#configprops()} + */ + @Test + public void testConfigprops() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualConfigpropsResult = LegacyEndpointConverters.configprops(); + + // Assert + assertFalse(actualConfigpropsResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualConfigpropsResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#mappings()}. + *

+ * Method under test: {@link LegacyEndpointConverters#mappings()} + */ + @Test + public void testMappings() throws AssertionError { + // Arrange and Act + LegacyEndpointConverter actualMappingsResult = LegacyEndpointConverters.mappings(); + + // Assert + assertFalse(actualMappingsResult.canConvert("Endpoint Id")); + FirstStep createResult = StepVerifier.create(actualMappingsResult.convert(null)); + createResult.expectError().verify(); + } + + /** + * Test {@link LegacyEndpointConverters#startup()}. + *

+ * Method under test: {@link LegacyEndpointConverters#startup()} + */ + @Test + public void testStartup() { + // Arrange and Act + LegacyEndpointConverter actualStartupResult = LegacyEndpointConverters.startup(); + + // Assert + assertNull(actualStartupResult.convert(null)); + assertFalse(actualStartupResult.canConvert("Endpoint Id")); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/RefreshInstancesEventDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/RefreshInstancesEventDiffblueTest.java new file mode 100644 index 00000000000..999db18c652 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/RefreshInstancesEventDiffblueTest.java @@ -0,0 +1,19 @@ +package de.codecentric.boot.admin.server.web.client; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class RefreshInstancesEventDiffblueTest { + + /** + * Test {@link RefreshInstancesEvent#RefreshInstancesEvent(Object)}. + *

+ * Method under test: {@link RefreshInstancesEvent#RefreshInstancesEvent(Object)} + */ + @Test + public void testNewRefreshInstancesEvent() { + // Arrange, Act and Assert + assertEquals("Source", new RefreshInstancesEvent("Source").getSource()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/cookies/JdkPerInstanceCookieStoreDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/cookies/JdkPerInstanceCookieStoreDiffblueTest.java new file mode 100644 index 00000000000..25cc1ab44f5 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/cookies/JdkPerInstanceCookieStoreDiffblueTest.java @@ -0,0 +1,125 @@ +package de.codecentric.boot.admin.server.web.client.cookies; + +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import de.codecentric.boot.admin.server.domain.values.InstanceId; +import de.codecentric.boot.admin.server.notify.PagerdutyNotifier; +import java.net.CookieManager; +import java.net.CookiePolicy; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@ContextConfiguration(classes = { JdkPerInstanceCookieStore.class }) +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@RunWith(SpringJUnit4ClassRunner.class) +public class JdkPerInstanceCookieStoreDiffblueTest { + + @Autowired + private JdkPerInstanceCookieStore jdkPerInstanceCookieStore; + + /** + * Test {@link JdkPerInstanceCookieStore#JdkPerInstanceCookieStore()}. + *

+ * Method under test: {@link JdkPerInstanceCookieStore#JdkPerInstanceCookieStore()} + */ + @Test + public void testNewJdkPerInstanceCookieStore() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange, Act and Assert + assertTrue(new JdkPerInstanceCookieStore().createCookieHandler(null) instanceof CookieManager); + } + + /** + * Test {@link JdkPerInstanceCookieStore#JdkPerInstanceCookieStore(CookiePolicy)}. + *

    + *
  • Then createCookieHandler {@code null} return {@link CookieManager}.
  • + *
+ *

+ * Method under test: + * {@link JdkPerInstanceCookieStore#JdkPerInstanceCookieStore(CookiePolicy)} + */ + @Test + public void testNewJdkPerInstanceCookieStore_thenCreateCookieHandlerNullReturnCookieManager() { + // Diffblue Cover was unable to create a Spring-specific test for this Spring + // method. + // Run dcover create --keep-partial-tests to gain insights into why + // a non-Spring test was created. + + // Arrange, Act and Assert + assertTrue(new JdkPerInstanceCookieStore(mock(CookiePolicy.class)) + .createCookieHandler(null) instanceof CookieManager); + } + + /** + * Test {@link JdkPerInstanceCookieStore#getCookieHandler(InstanceId)}. + *

    + *
  • Given {@link JdkPerInstanceCookieStore}.
  • + *
  • When {@link InstanceId} with {@code Value}.
  • + *
+ *

+ * Method under test: {@link JdkPerInstanceCookieStore#getCookieHandler(InstanceId)} + */ + @Test + public void testGetCookieHandler_givenJdkPerInstanceCookieStore_whenInstanceIdWithValue() { + // Arrange, Act and Assert + assertTrue(jdkPerInstanceCookieStore.getCookieHandler(InstanceId.of("Value")) instanceof CookieManager); + } + + /** + * Test {@link JdkPerInstanceCookieStore#getCookieHandler(InstanceId)}. + *

    + *
  • Given {@link JdkPerInstanceCookieStore}.
  • + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link JdkPerInstanceCookieStore#getCookieHandler(InstanceId)} + */ + @Test + public void testGetCookieHandler_givenJdkPerInstanceCookieStore_whenInstanceIdWithValueIs42() { + // Arrange, Act and Assert + assertTrue(jdkPerInstanceCookieStore.getCookieHandler(InstanceId.of("42")) instanceof CookieManager); + } + + /** + * Test {@link JdkPerInstanceCookieStore#getCookieHandler(InstanceId)}. + *

    + *
  • Given {@link JdkPerInstanceCookieStore#JdkPerInstanceCookieStore()}.
  • + *
  • When {@link InstanceId} with value is {@code 42}.
  • + *
+ *

+ * Method under test: {@link JdkPerInstanceCookieStore#getCookieHandler(InstanceId)} + */ + @Test + public void testGetCookieHandler_givenJdkPerInstanceCookieStore_whenInstanceIdWithValueIs422() { + // Arrange + JdkPerInstanceCookieStore jdkPerInstanceCookieStore = new JdkPerInstanceCookieStore(); + InstanceId instanceId = InstanceId.of("42"); + jdkPerInstanceCookieStore.put(instanceId, PagerdutyNotifier.DEFAULT_URI, new HttpHeaders()); + + // Act and Assert + assertTrue(jdkPerInstanceCookieStore.getCookieHandler(InstanceId.of("42")) instanceof CookieManager); + } + + /** + * Test {@link JdkPerInstanceCookieStore#createCookieHandler(InstanceId)}. + *

+ * Method under test: + * {@link JdkPerInstanceCookieStore#createCookieHandler(InstanceId)} + */ + @Test + public void testCreateCookieHandler() { + // Arrange, Act and Assert + assertTrue(jdkPerInstanceCookieStore.createCookieHandler(InstanceId.of("42")) instanceof CookieManager); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/InstanceWebClientExceptionDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/InstanceWebClientExceptionDiffblueTest.java new file mode 100644 index 00000000000..03767c363d8 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/InstanceWebClientExceptionDiffblueTest.java @@ -0,0 +1,58 @@ +package de.codecentric.boot.admin.server.web.client.exception; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class InstanceWebClientExceptionDiffblueTest { + + /** + * Test {@link InstanceWebClientException#InstanceWebClientException(String)}. + *

    + *
  • When {@code An error occurred}.
  • + *
  • Then return Cause is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link InstanceWebClientException#InstanceWebClientException(String)} + */ + @Test + public void testNewInstanceWebClientException_whenAnErrorOccurred_thenReturnCauseIsNull() { + // Arrange and Act + InstanceWebClientException actualInstanceWebClientException = new InstanceWebClientException( + "An error occurred"); + + // Assert + assertEquals("An error occurred", actualInstanceWebClientException.getMessage()); + assertNull(actualInstanceWebClientException.getCause()); + assertEquals(0, actualInstanceWebClientException.getSuppressed().length); + } + + /** + * Test + * {@link InstanceWebClientException#InstanceWebClientException(String, Throwable)}. + *

    + *
  • When {@link Throwable#Throwable()}.
  • + *
  • Then return Cause is {@link Throwable#Throwable()}.
  • + *
+ *

+ * Method under test: + * {@link InstanceWebClientException#InstanceWebClientException(String, Throwable)} + */ + @Test + public void testNewInstanceWebClientException_whenThrowable_thenReturnCauseIsThrowable() { + // Arrange + Throwable cause = new Throwable(); + + // Act + InstanceWebClientException actualInstanceWebClientException = new InstanceWebClientException( + "An error occurred", cause); + + // Assert + assertEquals("An error occurred", actualInstanceWebClientException.getMessage()); + assertEquals(0, actualInstanceWebClientException.getSuppressed().length); + assertSame(cause, actualInstanceWebClientException.getCause()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/ResolveEndpointExceptionDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/ResolveEndpointExceptionDiffblueTest.java new file mode 100644 index 00000000000..6cca9596f93 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/ResolveEndpointExceptionDiffblueTest.java @@ -0,0 +1,56 @@ +package de.codecentric.boot.admin.server.web.client.exception; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ResolveEndpointExceptionDiffblueTest { + + /** + * Test {@link ResolveEndpointException#ResolveEndpointException(String)}. + *

    + *
  • When {@code An error occurred}.
  • + *
  • Then return Cause is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link ResolveEndpointException#ResolveEndpointException(String)} + */ + @Test + public void testNewResolveEndpointException_whenAnErrorOccurred_thenReturnCauseIsNull() { + // Arrange and Act + ResolveEndpointException actualResolveEndpointException = new ResolveEndpointException("An error occurred"); + + // Assert + assertEquals("An error occurred", actualResolveEndpointException.getMessage()); + assertNull(actualResolveEndpointException.getCause()); + assertEquals(0, actualResolveEndpointException.getSuppressed().length); + } + + /** + * Test {@link ResolveEndpointException#ResolveEndpointException(String, Throwable)}. + *

    + *
  • When {@link Throwable#Throwable()}.
  • + *
  • Then return Cause is {@link Throwable#Throwable()}.
  • + *
+ *

+ * Method under test: + * {@link ResolveEndpointException#ResolveEndpointException(String, Throwable)} + */ + @Test + public void testNewResolveEndpointException_whenThrowable_thenReturnCauseIsThrowable() { + // Arrange + Throwable cause = new Throwable(); + + // Act + ResolveEndpointException actualResolveEndpointException = new ResolveEndpointException("An error occurred", + cause); + + // Assert + assertEquals("An error occurred", actualResolveEndpointException.getMessage()); + assertEquals(0, actualResolveEndpointException.getSuppressed().length); + assertSame(cause, actualResolveEndpointException.getCause()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/ResolveInstanceExceptionDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/ResolveInstanceExceptionDiffblueTest.java new file mode 100644 index 00000000000..82b49c73eeb --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/exception/ResolveInstanceExceptionDiffblueTest.java @@ -0,0 +1,56 @@ +package de.codecentric.boot.admin.server.web.client.exception; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ResolveInstanceExceptionDiffblueTest { + + /** + * Test {@link ResolveInstanceException#ResolveInstanceException(String)}. + *

    + *
  • When {@code An error occurred}.
  • + *
  • Then return Cause is {@code null}.
  • + *
+ *

+ * Method under test: + * {@link ResolveInstanceException#ResolveInstanceException(String)} + */ + @Test + public void testNewResolveInstanceException_whenAnErrorOccurred_thenReturnCauseIsNull() { + // Arrange and Act + ResolveInstanceException actualResolveInstanceException = new ResolveInstanceException("An error occurred"); + + // Assert + assertEquals("An error occurred", actualResolveInstanceException.getMessage()); + assertNull(actualResolveInstanceException.getCause()); + assertEquals(0, actualResolveInstanceException.getSuppressed().length); + } + + /** + * Test {@link ResolveInstanceException#ResolveInstanceException(String, Throwable)}. + *

    + *
  • When {@link Throwable#Throwable()}.
  • + *
  • Then return Cause is {@link Throwable#Throwable()}.
  • + *
+ *

+ * Method under test: + * {@link ResolveInstanceException#ResolveInstanceException(String, Throwable)} + */ + @Test + public void testNewResolveInstanceException_whenThrowable_thenReturnCauseIsThrowable() { + // Arrange + Throwable cause = new Throwable(); + + // Act + ResolveInstanceException actualResolveInstanceException = new ResolveInstanceException("An error occurred", + cause); + + // Assert + assertEquals("An error occurred", actualResolveInstanceException.getMessage()); + assertEquals(0, actualResolveInstanceException.getSuppressed().length); + assertSame(cause, actualResolveInstanceException.getCause()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/reactive/CompositeReactiveHttpHeadersProviderDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/reactive/CompositeReactiveHttpHeadersProviderDiffblueTest.java new file mode 100644 index 00000000000..903565a03a5 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/reactive/CompositeReactiveHttpHeadersProviderDiffblueTest.java @@ -0,0 +1,96 @@ +package de.codecentric.boot.admin.server.web.client.reactive; + +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import java.util.ArrayList; +import org.junit.Test; +import org.mockito.Mockito; +import org.springframework.http.HttpHeaders; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +public class CompositeReactiveHttpHeadersProviderDiffblueTest { + + /** + * Test {@link CompositeReactiveHttpHeadersProvider#getHeaders(Instance)}. + *

+ * Method under test: + * {@link CompositeReactiveHttpHeadersProvider#getHeaders(Instance)} + */ + @Test + public void testGetHeaders() throws AssertionError { + // Arrange, Act and Assert + FirstStep createResult = StepVerifier + .create(new CompositeReactiveHttpHeadersProvider(new ArrayList<>()).getHeaders(null)); + createResult.expectComplete().verify(); + } + + /** + * Test {@link CompositeReactiveHttpHeadersProvider#getHeaders(Instance)}. + *

    + *
  • Then calls {@link ReactiveHttpHeadersProvider#getHeaders(Instance)}.
  • + *
+ *

+ * Method under test: + * {@link CompositeReactiveHttpHeadersProvider#getHeaders(Instance)} + */ + @Test + public void testGetHeaders_thenCallsGetHeaders() throws AssertionError { + // Arrange + ReactiveHttpHeadersProvider reactiveHttpHeadersProvider = mock(ReactiveHttpHeadersProvider.class); + Mono justResult = Mono.just(new HttpHeaders()); + when(reactiveHttpHeadersProvider.getHeaders(Mockito.any())).thenReturn(justResult); + + ArrayList delegates = new ArrayList<>(); + delegates.add(reactiveHttpHeadersProvider); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new CompositeReactiveHttpHeadersProvider(delegates).getHeaders(null)); + createResult.assertNext(h -> { + assertTrue(h.isEmpty()); + return; + }).expectComplete().verify(); + verify(reactiveHttpHeadersProvider).getHeaders(isNull()); + } + + /** + * Test {@link CompositeReactiveHttpHeadersProvider#getHeaders(Instance)}. + *

    + *
  • Then calls {@link ReactiveHttpHeadersProvider#getHeaders(Instance)}.
  • + *
+ *

+ * Method under test: + * {@link CompositeReactiveHttpHeadersProvider#getHeaders(Instance)} + */ + @Test + public void testGetHeaders_thenCallsGetHeaders2() throws AssertionError { + // Arrange + ReactiveHttpHeadersProvider reactiveHttpHeadersProvider = mock(ReactiveHttpHeadersProvider.class); + Mono justResult = Mono.just(new HttpHeaders()); + when(reactiveHttpHeadersProvider.getHeaders(Mockito.any())).thenReturn(justResult); + ReactiveHttpHeadersProvider reactiveHttpHeadersProvider2 = mock(ReactiveHttpHeadersProvider.class); + Mono justResult2 = Mono.just(new HttpHeaders()); + when(reactiveHttpHeadersProvider2.getHeaders(Mockito.any())).thenReturn(justResult2); + + ArrayList delegates = new ArrayList<>(); + delegates.add(reactiveHttpHeadersProvider2); + delegates.add(reactiveHttpHeadersProvider); + + // Act and Assert + FirstStep createResult = StepVerifier + .create(new CompositeReactiveHttpHeadersProvider(delegates).getHeaders(null)); + createResult.assertNext(h -> { + assertTrue(h.isEmpty()); + return; + }).expectComplete().verify(); + verify(reactiveHttpHeadersProvider2).getHeaders(isNull()); + verify(reactiveHttpHeadersProvider).getHeaders(isNull()); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/reactive/AdminControllerHandlerMappingDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/reactive/AdminControllerHandlerMappingDiffblueTest.java new file mode 100644 index 00000000000..36bb46fc785 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/reactive/AdminControllerHandlerMappingDiffblueTest.java @@ -0,0 +1,64 @@ +package de.codecentric.boot.admin.server.web.reactive; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.cors.reactive.DefaultCorsProcessor; +import org.springframework.web.util.pattern.PathPatternParser; + +@ContextConfiguration(classes = { AdminControllerHandlerMapping.class, String.class }) +@RunWith(SpringJUnit4ClassRunner.class) +public class AdminControllerHandlerMappingDiffblueTest { + + @Autowired + private AdminControllerHandlerMapping adminControllerHandlerMapping; + + /** + * Test {@link AdminControllerHandlerMapping#AdminControllerHandlerMapping(String)}. + *

+ * Method under test: + * {@link AdminControllerHandlerMapping#AdminControllerHandlerMapping(String)} + */ + @Test + public void testNewAdminControllerHandlerMapping() throws IllegalStateException { + // Arrange and Act + AdminControllerHandlerMapping actualAdminControllerHandlerMapping = new AdminControllerHandlerMapping( + "Admin Context Path"); + + // Assert + assertTrue(actualAdminControllerHandlerMapping.getCorsProcessor() instanceof DefaultCorsProcessor); + PathPatternParser pathPatternParser = actualAdminControllerHandlerMapping.getPathPatternParser(); + assertEquals('/', pathPatternParser.getPathOptions().separator()); + assertNull(actualAdminControllerHandlerMapping.getApplicationContext()); + assertFalse(pathPatternParser.isMatchOptionalTrailingSeparator()); + assertTrue(actualAdminControllerHandlerMapping.getHandlerMethods().isEmpty()); + assertTrue(actualAdminControllerHandlerMapping.getPathPrefixes().isEmpty()); + assertTrue(pathPatternParser.isCaseSensitive()); + assertEquals(Integer.MAX_VALUE, actualAdminControllerHandlerMapping.getOrder()); + } + + /** + * Test {@link AdminControllerHandlerMapping#isHandler(Class)}. + *

    + *
  • When {@code Object}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link AdminControllerHandlerMapping#isHandler(Class)} + */ + @Test + public void testIsHandler_whenJavaLangObject_thenReturnFalse() { + // Arrange + Class beanType = Object.class; + + // Act and Assert + assertFalse(adminControllerHandlerMapping.isHandler(beanType)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/reactive/InstancesProxyControllerDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/reactive/InstancesProxyControllerDiffblueTest.java new file mode 100644 index 00000000000..8d3042166c3 --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/reactive/InstancesProxyControllerDiffblueTest.java @@ -0,0 +1,750 @@ +package de.codecentric.boot.admin.server.web.reactive; + +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.SnapshottingInstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; +import de.codecentric.boot.admin.server.eventstore.InstanceEventStore; +import de.codecentric.boot.admin.server.notify.PagerdutyNotifier; +import de.codecentric.boot.admin.server.services.InstanceFilter; +import de.codecentric.boot.admin.server.services.InstanceIdGenerator; +import de.codecentric.boot.admin.server.services.InstanceRegistry; +import de.codecentric.boot.admin.server.web.InstanceWebProxy; +import de.codecentric.boot.admin.server.web.InstanceWebProxy.InstanceResponse; +import de.codecentric.boot.admin.server.web.client.InstanceWebClient; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Predicate; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.reactivestreams.Publisher; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.server.PathContainer; +import org.springframework.http.server.RequestPath; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.http.server.reactive.ServerHttpRequestDecorator; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.Builder; +import reactor.core.publisher.DirectProcessor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.GroupedFlux; +import reactor.test.StepVerifier; +import reactor.test.StepVerifier.FirstStep; + +@ContextConfiguration(classes = { InstancesProxyController.class, String.class }) +@DisabledInAotMode +@RunWith(SpringJUnit4ClassRunner.class) +public class InstancesProxyControllerDiffblueTest { + + @MockitoBean + private InstanceRegistry instanceRegistry; + + @MockitoBean + private InstanceWebClient instanceWebClient; + + @Autowired + private InstancesProxyController instancesProxyController; + + @Autowired + private Set set; + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest() throws AssertionError { + // Arrange + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(fromIterableResult); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Application Name")); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest2() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + + HttpHeaders httpHeaders = new HttpHeaders(); + httpHeaders.add("https://example.org/example", "https://example.org/example"); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(httpHeaders); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Application Name")); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(flux).flatMap(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest3() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + Flux flux2 = mock(Flux.class); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(flux2.map(Mockito.>any())).thenReturn(fromIterableResult2); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + when(delegate.getBody()).thenReturn(flux2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Application Name")); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).map(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest4() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + HashSet ignoredHeaders = new HashSet<>(); + InstancesProxyController instancesProxyController = new InstancesProxyController("Admin Context Path", + ignoredHeaders, new InstanceRegistry(new EventsourcingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + instanceWebClient); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(builder).build(); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest5() throws AssertionError { + // Arrange + InstanceEventStore eventStore = mock(InstanceEventStore.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(eventStore.findAll()).thenReturn(fromIterableResult); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InstancesProxyController instancesProxyController = new InstancesProxyController("Admin Context Path", + new HashSet<>(), registry, instanceWebClient); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(builder).build(); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest6() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux> fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.groupBy(Mockito.>any())).thenReturn(fromIterableResult); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.findAll()).thenReturn(flux); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InstancesProxyController instancesProxyController = new InstancesProxyController("Admin Context Path", + new HashSet<>(), registry, instanceWebClient); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(builder).build(); + verify(flux).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest7() throws AssertionError { + // Arrange + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + HashSet ignoredHeaders = new HashSet<>(); + InstancesProxyController instancesProxyController = new InstancesProxyController("Admin Context Path", + ignoredHeaders, new InstanceRegistry(new SnapshottingInstanceRepository(new InMemoryEventStore()), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)), + instanceWebClient); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(builder).build(); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *

    + *
  • Given create.
  • + *
+ *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest_givenCreate() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + DirectProcessor createResult = DirectProcessor.create(); + when(delegate.getBody()).thenReturn(createResult); + + // Act and Assert + FirstStep createResult2 = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult2.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Application Name")); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(flux).flatMap(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *
    + *
  • Given {@link Flux} {@link Flux#filter(Predicate)} return {@link Flux}.
  • + *
+ *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest_givenFluxFilterReturnFlux() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.filter(Mockito.>any())).thenReturn(flux); + Flux> flux3 = mock(Flux.class); + when(flux3.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux2); + Flux flux4 = mock(Flux.class); + when(flux4.groupBy(Mockito.>any())).thenReturn(flux3); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.findAll()).thenReturn(flux4); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InstancesProxyController instancesProxyController = new InstancesProxyController("Admin Context Path", + new HashSet<>(), registry, instanceWebClient); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(builder).build(); + verify(flux2).filter(isA(Predicate.class)); + verify(flux).filter(isA(Predicate.class)); + verify(flux3).flatMap(isA(Function.class)); + verify(flux4).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *
    + *
  • Given {@link Flux} {@link Flux#groupBy(Function)} return {@link Flux}.
  • + *
+ *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest_givenFluxGroupByReturnFlux() throws AssertionError { + // Arrange + Flux> flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito., Publisher>>any())) + .thenReturn(fromIterableResult); + Flux flux2 = mock(Flux.class); + when(flux2.groupBy(Mockito.>any())).thenReturn(flux); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.findAll()).thenReturn(flux2); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InstancesProxyController instancesProxyController = new InstancesProxyController("Admin Context Path", + new HashSet<>(), registry, instanceWebClient); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(builder).build(); + verify(flux).flatMap(isA(Function.class)); + verify(flux2).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *
    + *
  • Given {@link HttpHeaders#HttpHeaders()} add {@code Header Name} and + * {@code 42}.
  • + *
+ *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest_givenHttpHeadersAddHeaderNameAnd42() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + + HttpHeaders httpHeaders = new HttpHeaders(); + httpHeaders.add("Header Name", "42"); + httpHeaders.add("https://example.org/example", "https://example.org/example"); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(httpHeaders); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Application Name")); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(flux).flatMap(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *
    + *
  • Then calls {@link Flux#cache()}.
  • + *
+ *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest_thenCallsCache() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + Flux flux2 = mock(Flux.class); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(flux2.cache()).thenReturn(fromIterableResult2); + Flux flux3 = mock(Flux.class); + when(flux3.map(Mockito.>any())).thenReturn(flux2); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + when(delegate.getBody()).thenReturn(flux3); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Application Name")); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(flux2).cache(); + verify(flux).flatMap(isA(Function.class)); + verify(flux3).map(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *
    + *
  • Then calls {@link Flux#filter(Predicate)}.
  • + *
+ *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest_thenCallsFilter() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.filter(Mockito.>any())).thenReturn(fromIterableResult); + Flux> flux2 = mock(Flux.class); + when(flux2.flatMap(Mockito., Publisher>>any())) + .thenReturn(flux); + Flux flux3 = mock(Flux.class); + when(flux3.groupBy(Mockito.>any())).thenReturn(flux2); + InstanceEventStore eventStore = mock(InstanceEventStore.class); + when(eventStore.findAll()).thenReturn(flux3); + InstanceRegistry registry = new InstanceRegistry(new EventsourcingInstanceRepository(eventStore), + mock(InstanceIdGenerator.class), mock(InstanceFilter.class)); + + Builder builder = mock(Builder.class); + when(builder.build()).thenReturn(mock(WebClient.class)); + InstanceWebClient instanceWebClient = InstanceWebClient.builder().webClient(builder).build(); + InstancesProxyController instancesProxyController = new InstancesProxyController("Admin Context Path", + new HashSet<>(), registry, instanceWebClient); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(eventStore).findAll(); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(builder).build(); + verify(flux).filter(isA(Predicate.class)); + verify(flux2).flatMap(isA(Function.class)); + verify(flux3).groupBy(isA(Function.class)); + } + + /** + * Test {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} with + * {@code applicationName}, {@code request}. + *
    + *
  • Then calls {@link InstanceRegistry#getInstances(String)}.
  • + *
+ *

+ * Method under test: + * {@link InstancesProxyController#endpointProxy(String, ServerHttpRequest)} + */ + @Test + public void testEndpointProxyWithApplicationNameRequest_thenCallsGetInstances() throws AssertionError { + // Arrange + Flux flux = mock(Flux.class); + Flux fromIterableResult = Flux.fromIterable(new ArrayList<>()); + when(flux.flatMap(Mockito.>>any())).thenReturn(fromIterableResult); + when(instanceRegistry.getInstances(Mockito.any())).thenReturn(flux); + PathContainer pathContainer = mock(PathContainer.class); + when(pathContainer.value()).thenReturn("https://example.org/example"); + RequestPath requestPath = mock(RequestPath.class); + when(requestPath.pathWithinApplication()).thenReturn(pathContainer); + ServerHttpRequestDecorator delegate = mock(ServerHttpRequestDecorator.class); + when(delegate.getHeaders()).thenReturn(new HttpHeaders()); + when(delegate.getMethod()).thenReturn(HttpMethod.valueOf("https://example.org/example")); + when(delegate.getURI()).thenReturn(PagerdutyNotifier.DEFAULT_URI); + when(delegate.getPath()).thenReturn(requestPath); + Flux fromIterableResult2 = Flux.fromIterable(new ArrayList<>()); + when(delegate.getBody()).thenReturn(fromIterableResult2); + + // Act and Assert + FirstStep createResult = StepVerifier.create( + instancesProxyController.endpointProxy("Application Name", new ServerHttpRequestDecorator(delegate))); + createResult.expectComplete().verify(); + verify(instanceRegistry).getInstances(eq("Application Name")); + verify(pathContainer).value(); + verify(requestPath).pathWithinApplication(); + verify(delegate).getBody(); + verify(delegate).getHeaders(); + verify(delegate).getMethod(); + verify(delegate).getPath(); + verify(delegate).getURI(); + verify(flux).flatMap(isA(Function.class)); + } + +} diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/servlet/AdminControllerHandlerMappingDiffblueTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/servlet/AdminControllerHandlerMappingDiffblueTest.java new file mode 100644 index 00000000000..f2ba39b8ffd --- /dev/null +++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/servlet/AdminControllerHandlerMappingDiffblueTest.java @@ -0,0 +1,72 @@ +package de.codecentric.boot.admin.server.web.servlet; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.util.AntPathMatcher; +import org.springframework.web.cors.DefaultCorsProcessor; +import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMethodMappingNamingStrategy; + +@ContextConfiguration(classes = { AdminControllerHandlerMapping.class, String.class }) +@RunWith(SpringJUnit4ClassRunner.class) +@WebAppConfiguration +public class AdminControllerHandlerMappingDiffblueTest { + + @Autowired + private AdminControllerHandlerMapping adminControllerHandlerMapping; + + /** + * Test {@link AdminControllerHandlerMapping#AdminControllerHandlerMapping(String)}. + *

+ * Method under test: + * {@link AdminControllerHandlerMapping#AdminControllerHandlerMapping(String)} + */ + @Test + public void testNewAdminControllerHandlerMapping() { + // Arrange and Act + AdminControllerHandlerMapping actualAdminControllerHandlerMapping = new AdminControllerHandlerMapping( + "Admin Context Path"); + + // Assert + assertTrue(actualAdminControllerHandlerMapping.getPathMatcher() instanceof AntPathMatcher); + assertTrue(actualAdminControllerHandlerMapping.getCorsProcessor() instanceof DefaultCorsProcessor); + assertTrue(actualAdminControllerHandlerMapping + .getNamingStrategy() instanceof RequestMappingInfoHandlerMethodMappingNamingStrategy); + assertNull(actualAdminControllerHandlerMapping.getDefaultHandler()); + assertNull(actualAdminControllerHandlerMapping.getFileExtensions()); + assertNull(actualAdminControllerHandlerMapping.getCorsConfigurationSource()); + assertNull(actualAdminControllerHandlerMapping.getAdaptedInterceptors()); + assertFalse(actualAdminControllerHandlerMapping.useRegisteredSuffixPatternMatch()); + assertFalse(actualAdminControllerHandlerMapping.useSuffixPatternMatch()); + assertFalse(actualAdminControllerHandlerMapping.useTrailingSlashMatch()); + assertTrue(actualAdminControllerHandlerMapping.getHandlerMethods().isEmpty()); + assertTrue(actualAdminControllerHandlerMapping.getPathPrefixes().isEmpty()); + assertEquals(Integer.MAX_VALUE, actualAdminControllerHandlerMapping.getOrder()); + } + + /** + * Test {@link AdminControllerHandlerMapping#isHandler(Class)}. + *

    + *
  • When {@code Object}.
  • + *
  • Then return {@code false}.
  • + *
+ *

+ * Method under test: {@link AdminControllerHandlerMapping#isHandler(Class)} + */ + @Test + public void testIsHandler_whenJavaLangObject_thenReturnFalse() { + // Arrange + Class beanType = Object.class; + + // Act and Assert + assertFalse(adminControllerHandlerMapping.isHandler(beanType)); + } + +}