# Registering service with injected bundle context using osgi-test

**URL:** <https://bnd.discourse.group/t/registering-service-with-injected-bundle-context-using-osgi-test/143>\
**Category:** GENERAL\
**Created:** [July 15, 2021, 2:25pm UTC](https://bnd.discourse.group/t/registering-service-with-injected-bundle-context-using-osgi-test/143 "2021-07-15T14:25:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jellenelis](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jellenelis/32/88_2.png) [@jellenelis](https://bnd.discourse.group/u/jellenelis)\
**Post date:** [July 15, 2021, 2:25pm UTC](https://bnd.discourse.group/t/registering-service-with-injected-bundle-context-using-osgi-test/143/1 "2021-07-15T14:25:04Z")

</div>

Hi all,

I have been trying out osgi-test the last couple of days by writing several very simple tests that use the functionality provided by BundleContextExtension and ServiceExtension.  
Firstly, thanks for the very simple-to-use integration testing possibilities.  
I wrote a test using both BundleContextExtension and ServiceExtension. I was expecting that if I would have an injected `List<S>` with S a certain type of service, and I would register a service using the BundleContext in the test, the `List<S>` would reflect the newly registered service. A `ServiceAware<S>` also does not seem to reflect the new situation.

Are my expectations wrong?

Kind regards,

Jelle

---

<div class="post-metadata">

**Author:** ![bjhargrave](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/bjhargrave/32/10_2.png) [@bjhargrave](https://bnd.discourse.group/u/bjhargrave)\
**Post date:** [July 15, 2021, 2:51pm UTC](https://bnd.discourse.group/t/registering-service-with-injected-bundle-context-using-osgi-test/143/2 "2021-07-15T14:51:31Z")

</div>

Hi, this group is for the Bnd/Bndtools tools. If you want to ask about the osgi-test project at Eclipse, you should try the [osgi-users@eclipse.org](https://accounts.eclipse.org/mailing-list/osgi-users) mail list.

---

<div class="post-metadata">

**Author:** ![jellenelis](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jellenelis/32/88_2.png) [@jellenelis](https://bnd.discourse.group/u/jellenelis)\
**Post date:** [July 15, 2021, 3:14pm UTC](https://bnd.discourse.group/t/registering-service-with-injected-bundle-context-using-osgi-test/143/3 "2021-07-15T15:14:38Z")

</div>

Thanks, will do, sorry for the inconvenience.
