Skip to content

Commit

Permalink
[ALFREDOPS-860] fixed very vague bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pvriel committed Jan 6, 2025
1 parent 6a3b60e commit 644291c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion alfred-telemetry-platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-inline:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}"
testImplementation "org.hamcrest:hamcrest-all:${hamcrestVersion}"
testImplementation "org.awaitility:awaitility:${awaitilityVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics;
import org.alfresco.enterprise.repo.cluster.cache.HazelcastSimpleCache;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.MockedStatic;
Expand Down Expand Up @@ -43,6 +44,15 @@ void setup() {
.thenReturn(Map.of("test", hazelcastSimpleCache));
}

@AfterEach
void teardown() {
/*
Don't remove this code.
We have no idea why this is necessary, or what it exactly does, or why it fixes all broken tests, but it does.
*/
Mockito.clearAllCaches();
}

@Test
void testMonitorCacheWithIMapReflection() throws InvocationTargetException, IllegalAccessException {
try (MockedStatic<ReflectionUtil> mock =
Expand Down
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ allprojects {
micrometerVersion = '1.0.6'
jvmExtrasVersion = '0.1.2'

junitJupiterVersion = '5.4.2'
mockitoVersion = '5.2.0'
byteBuddyVersion = '1.14.6'
junitJupiterVersion = '5.10.2'
mockitoVersion = '5.11.0'
hamcrestVersion = '1.3'
awaitilityVersion = '4.1.0'
restAssuredVersion = '5.3.0'
Expand Down

0 comments on commit 644291c

Please sign in to comment.