Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,6 +17,8 @@
package org.glassfish.jersey.inject.cdi.se;

import java.lang.reflect.Type;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
Expand Down Expand Up @@ -368,9 +370,17 @@ public void testDisposeComposedObjectWithPerLookupFields() {

// All instances should be the same because they are request scoped.
ComposedObject instance = injectionManager.getInstance(ComposedObject.class);
assertEquals("1", instance.getFirst());
assertEquals("2", instance.getSecond());
assertEquals("3", instance.getThird());
Set<String> set1 = new HashSet<String>() {{
add("1");
add("2");
add("3");
}};
Set<String> set2 = new HashSet<String>() {{
add(instance.getFirst().toString());
add(instance.getSecond().toString());
add(instance.getThird().toString());
}};
assertEquals(set1, set2);
});

Supplier<String> cleanedSupplier = atomicSupplier.get();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,6 +17,8 @@
package org.glassfish.jersey.inject.hk2;

import java.lang.reflect.Type;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
Expand Down Expand Up @@ -374,9 +376,17 @@ public void testDisposeComposedObjectWithPerLookupFields() {

// All instances should be the same because they are request scoped.
ComposedObject instance = injectionManager.getInstance(ComposedObject.class);
assertEquals("1", instance.first);
assertEquals("2", instance.second);
assertEquals("3", instance.third);
Set<String> set1 = new HashSet<String>() {{
add("1");
add("2");
add("3");
}};
Set<String> set2 = new HashSet<String>() {{
add(instance.first.toString());
add(instance.second.toString());
add(instance.third.toString());
}};
assertEquals(set1, set2);
});

Supplier<String> cleanedSupplier = atomicSupplier.get();
Expand Down