|
2 | 2 |
|
3 | 3 | import no.nav.tag.tiltaksgjennomforing.TiltaksgjennomforingApplication; |
4 | 4 | import org.evomaster.client.java.controller.EmbeddedSutController; |
| 5 | +import org.evomaster.client.java.controller.InstrumentedSutStarter; |
5 | 6 | import org.evomaster.client.java.controller.api.dto.SutInfoDto; |
6 | 7 | import org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto; |
7 | 8 | import org.evomaster.client.java.controller.api.dto.database.schema.DatabaseType; |
@@ -38,9 +39,24 @@ public class EmbeddedEvoMasterController extends EmbeddedSutController { |
38 | 39 | private Connection sqlConnection; |
39 | 40 | private List<DbSpecification> dbSpecification; |
40 | 41 |
|
| 42 | + public EmbeddedEvoMasterController() { |
| 43 | + this(40100); |
| 44 | + } |
| 45 | + |
| 46 | + public EmbeddedEvoMasterController(int port) { |
| 47 | + setControllerPort(port); |
| 48 | + } |
41 | 49 |
|
42 | 50 | public static void main(String[] args) { |
43 | | - System.out.println("Hello world!"); |
| 51 | + int port = 40100; |
| 52 | + if (args.length > 0) { |
| 53 | + port = Integer.parseInt(args[0]); |
| 54 | + } |
| 55 | + |
| 56 | + EmbeddedEvoMasterController controller = new EmbeddedEvoMasterController(port); |
| 57 | + InstrumentedSutStarter starter = new InstrumentedSutStarter(controller); |
| 58 | + |
| 59 | + starter.start(); |
44 | 60 | } |
45 | 61 |
|
46 | 62 | @Override |
@@ -73,6 +89,7 @@ public String startSut() { |
73 | 89 | postgresContainer.start(); |
74 | 90 |
|
75 | 91 | String postgresURL = "jdbc:postgresql://" + postgresContainer.getHost() + ":" + postgresContainer.getMappedPort(POSTGRES_PORT) + "/tiltaksgjennomforing"; |
| 92 | + |
76 | 93 | ctx = SpringApplication.run(TiltaksgjennomforingApplication.class, new String[]{ |
77 | 94 | "--server.port=0", |
78 | 95 | "--spring.profiles.active=dev", |
|
0 commit comments