lundi 1 août 2016

Where to put stub classes in Maven projects

I have a Maven project with the following directory layout:

    .
└── src    
     ├── main
     │    └── ...
     └── test
           └── java
                 └── com.foo
                      ├── stubs
                      │   └── JsonSnippets.java
                      ├── bar
                      │   └── BarTest.java
                      └── ... further tests

Within the BarTest class, I want to use the JsonSnippets class, therefore I have

package com.foo.bar;

import com.foo.stubs.JsonSnippets;

// ...

@Test
public void testWithJsonSnippets() {
    String json = JsonSnippets.SNIPPET_A;
    // ...
}

When I now run mvn test, I get the following error message:

cannot find symbol
[ERROR] symbol:   class JsonSnippets
[ERROR] location: package com.foo.bar

Aucun commentaire:

Enregistrer un commentaire