Question: I have and angular service that I want to test. In one of his methods I am using $http of angular service. I am simply want to mock that function (to be more specific mock $http.post function) that would return whatever I want and inject this mock to my service test.

I am tried to find solution and I found $httpBackend but I am not sure that this could help me.

MyService looks like that:

```
angular.module('app').service('MyService' , function (dependencies) {
    let service = this;
    service.methodToTest = function () {
        $http.post('url').then(function () {
            // Do something
        });
    }
}

```

* I am want to test methodToTest and inject the mock of $http.post()

P.S please remember that $http.post() returns promise so I think that I need to consider in that.

Answer: 
From the docs 

> 
> **pluginManagement**: is an element that is seen along side plugins.
>  Plugin Management contains plugin elements in much the same way,
>  except that rather than configuring plugin information for this
>  particular project build, it is intended to configure project builds
>  that inherit from this one. However, this only configures plugins that
>  are actually referenced within the plugins element in the children.
>  The children have every right to override pluginManagement
>  definitions.
> 
> 
> 

Considering your Inherited POM, the `maven-checkstyle-plugin` used would be the one you've declared first(outside the pluginManagement). Instead of this, for the **inherited `pom.xml`**, to override the configuration, you must specify the same under the `plugins` and not `pluginManagement`. Try simplifying the pom's build tag as --

```
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <!--Note - the version would be inherited-->
            <configuration>
                <configLocation>${project.parent.basedir}/${checkstyle.configLocation}</configLocation>
                <suppressionsFile>${project.parent.basedir}/${checkstyle.suppressionsLocation}</suppressionsFile>
            </configuration>
        </plugin>
    </plugins>
</build>

```

*Edit* : - From the comment, it was visible that the OP was not using the Simple [Inheritance structure](http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Example_1) hence using a *relative path* would solve the problem in such cases.
If your inherited project is in a different repo, you need another approach. Just add the parent as a dependency in the plugin. Note that you can't use this approach in `<reporting>` because it doesn't support plugin dependencies. 

```
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <!--version is inherited-->
            <dependencies>
                <dependency>
                    <groupId>parent.group.id</groupId>
                    <artifactId>parent</artifactId>
                    <version>1.0.0-SNAPSHOT</version>
                </dependency>
            </dependencies>
         </plugin>
    </plugins>
</build>

```

For more info, see 
<https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html>