Skip to content

Commit

Permalink
Fix template
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Jul 21, 2022
1 parent 949723a commit fe352b9
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{#if input.extra-codestarts.contains("integration-tests")}
package {package-name}.it;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.is;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language;
import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest;

public class {class-name-base}CodestartTest {

Expand All @@ -16,11 +15,24 @@ public class {class-name-base}CodestartTest {
.setupStandaloneExtensionTest("{group-id}:{namespace.id}{extension.id}")
.build();

/**
* Make sure the generated code meets the expectations.
* <br>
* The generated code uses mocked data to be immutable and allow snapshot testing.
* <br><br>
*
* Read the doc: <br>
* {@link https://quarkus.io/guides/extension-codestart#integration-test}
*/
@Test
void testContent() throws Throwable {
codestartTest.checkGeneratedSource("org.acme.{class-name-base}Resource");
//codestartTest.checkGeneratedSource("org.acme.SomeClass");
//codestartTest.assertThatGeneratedFileMatchSnapshot(Language.JAVA, "\"src/main/resources/some-resource.ext");
}

/**
* This test runs the build (with tests) on generated projects for all selected languages
*/
@Test
void buildAllProjects() throws Throwable {
codestartTest.buildAllProjects();
Expand Down

0 comments on commit fe352b9

Please sign in to comment.