# Intergration testing of plugin components

**URL:** <https://community.developer.atlassian.com/t/intergration-testing-of-plugin-components/5240>\
**Category:** Bitbucket Server\
**Tags:** springscanner, bitbucket-server, testing\
**Created:** [June 16, 2017, 9:22am UTC](https://community.developer.atlassian.com/t/intergration-testing-of-plugin-components/5240 "2017-06-16T09:22:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktor](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/viktor/32/36146_2.png) [@viktor](https://community.developer.atlassian.com/u/viktor)\
**Post date:** [June 16, 2017, 9:22am UTC](https://community.developer.atlassian.com/t/intergration-testing-of-plugin-components/5240/1 "2017-06-16T09:22:21Z")

</div>

Hi,

Can somebody point to examples of integration tests for BitBucket plugin components, which are not listed in `atlassian-plugin.xml`, but loaded by Spring Scanner?

For example, here is my component (simplified code)

```auto
@Component("repositoryCreatedListener")
public class RepositoryCreatedListener {
    
    @ComponentImport
    private RepositoryHookService rhService;

    @Autowired
    public void setRhService(RepositoryHookService rhService) {
        this.rhService = rhService;
    }

    @EventListener
    public void repositoryCreated(RepositoryCreatedEvent evt) {
        Repository repository = evt.getRepository();
        // useful things happen here
    }

}

```

My attempt to instanciate it during itegration test

```auto
@RunWith(AtlassianPluginsTestRunner.class)
public class RepositoryCreatedListenerTest {

    private final RepositoryCreatedListener newRepositoryListener;

    public RepositoryCreatedListenerTest(RepositoryCreatedListener newRepositoryListener) {
        this.newRepositoryListener = newRepositoryListener;
    }

    @Test
    public void testMyName() {
        assertNotNull(newRepositoryListener);
    }

}

```

results in  
`RepositoryCreatedListenerTest: Could not find resource for test [http://XXX-86LJJ5J:7990/bitbucket/rest/atlassiantestrunner/1.0/runtest/it.org.cbs.bitbucket.repo.impl.RepositoryCreatedListenerTest]. Status: 404 - Not Found`

---

<div class="post-metadata">

**Author:** ![allan.leong](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/allan.leong/32/36630_2.png) [@allan.leong](https://community.developer.atlassian.com/u/allan.leong)\
**Post date:** [May 31, 2018, 12:06pm UTC](https://community.developer.atlassian.com/t/intergration-testing-of-plugin-components/5240/2 "2018-05-31T12:06:00Z")

</div>

Hi @viktor,

Did you manage to solve this in the end?  
Im getting the same problem.

---

<div class="post-metadata">

**Author:** ![viktor](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/viktor/32/36146_2.png) [@viktor](https://community.developer.atlassian.com/u/viktor)\
**Post date:** [May 31, 2018, 12:55pm UTC](https://community.developer.atlassian.com/t/intergration-testing-of-plugin-components/5240/3 "2018-05-31T12:55:22Z")

</div>

Hi @allan.leong, no, unfortunately we gave up on this ;(
