Skip to content

Commit e650eaa

Browse files
committed
changes after PR review
1 parent 86c1189 commit e650eaa

5 files changed

Lines changed: 30 additions & 80 deletions

File tree

jdk_17_maven/em/embedded/rest/familie-ba-sak/src/main/java/em/embedded/familie/ba/sak/EmbeddedEvoMasterController.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto;
88
import org.evomaster.client.java.controller.api.dto.database.schema.DatabaseType;
99
import org.evomaster.client.java.controller.problem.ProblemInfo;
10+
import org.evomaster.client.java.controller.problem.RestProblem;
1011
import org.evomaster.client.java.sql.DbCleaner;
1112
import org.evomaster.client.java.sql.DbSpecification;
1213
import org.springframework.boot.SpringApplication;
@@ -77,7 +78,10 @@ public List<AuthenticationDto> getInfoForAuthentication() {
7778

7879
@Override
7980
public ProblemInfo getProblemInfo() {
80-
return null;
81+
return new RestProblem(
82+
"http://localhost:" + getSutPort() + "/assets/swagger.json",
83+
null
84+
);
8185
}
8286

8387
@Override

jdk_17_maven/em/embedded/rest/familie-ba-sak/target/classes/logback.xml

Lines changed: 0 additions & 68 deletions
This file was deleted.

jdk_17_maven/em/embedded/rest/familie-tilbake/src/main/java/em/embedded/familie/tilbake/EmbeddedEvoMasterController.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto;
88
import org.evomaster.client.java.controller.api.dto.database.schema.DatabaseType;
99
import org.evomaster.client.java.controller.problem.ProblemInfo;
10+
import org.evomaster.client.java.controller.problem.RestProblem;
1011
import org.evomaster.client.java.sql.DbCleaner;
1112
import org.evomaster.client.java.sql.DbSpecification;
1213
import org.springframework.boot.SpringApplication;
@@ -76,7 +77,10 @@ public List<AuthenticationDto> getInfoForAuthentication() {
7677

7778
@Override
7879
public ProblemInfo getProblemInfo() {
79-
return null;
80+
return new RestProblem(
81+
"http://localhost:" + getSutPort() + "/assets/swagger.json",
82+
null
83+
);
8084
}
8185

8286
@Override

jdk_17_maven/em/embedded/rest/signal-server/src/main/java/em/embedded/textsecuregcm/EmbeddedEvoMasterController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class EmbeddedEvoMasterController extends EmbeddedSutController {
3131

3232
private static final DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:" + REDIS_VERSION);
3333

34+
private static JedisPool jedisPool;
35+
3436
private static final GenericContainer redisContainer = new GenericContainer(REDIS_IMAGE)
3537
.withExposedPorts(REDIS_PORT)
3638
.withEnv("ALLOW_EMPTY_PASSWORD", "yes")
@@ -83,7 +85,7 @@ public List<AuthenticationDto> getInfoForAuthentication() {
8385
@Override
8486
public ProblemInfo getProblemInfo() {
8587
return new RestProblem(
86-
"http://0.0.0.0:" + application.getJettyPort() + "/assets/swagger.json",
88+
"http://localhost:" + application.getJettyPort() + "/assets/swagger.json",
8789
null
8890
);
8991
}
@@ -98,6 +100,7 @@ public String startSut() {
98100
System.setProperty("aws.region", "us-west-2");
99101

100102
redisContainer.start();
103+
jedisPool = new JedisPool(redisContainer.getHost(), redisContainer.getMappedPort(REDIS_PORT));
101104

102105
dynamoDBContainer.start();
103106

@@ -107,7 +110,6 @@ public String startSut() {
107110

108111
//Dirty hack for DW...
109112
System.setProperty("dw.server.applicationConnectors[0].port", "0");
110-
System.setProperty("dw.server.adminConnectors[0].port", "0");
111113

112114
System.setProperty("dw.cacheCluster.configurationUri", redisURL);
113115
System.setProperty("dw.clientPresenceCluster.configurationUri", redisURL);
@@ -157,8 +159,6 @@ public void stopSut() {
157159

158160
@Override
159161
public void resetStateOfSUT() {
160-
JedisPool jedisPool = new JedisPool("0.0.0.0", redisContainer.getFirstMappedPort());
161-
162162
try (Jedis jedis = jedisPool.getResource()) {
163163
jedis.flushAll();
164164
}

jdk_17_maven/em/embedded/rest/tiltaksgjennomforing-api/src/main/java/em/embedded/rest/tiltaksgjennomforing/api/EmbeddedEvoMasterController.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto;
88
import org.evomaster.client.java.controller.api.dto.database.schema.DatabaseType;
99
import org.evomaster.client.java.controller.problem.ProblemInfo;
10+
import org.evomaster.client.java.controller.problem.RestProblem;
1011
import org.evomaster.client.java.sql.DbCleaner;
1112
import org.evomaster.client.java.sql.DbSpecification;
1213
import org.springframework.boot.SpringApplication;
@@ -70,10 +71,17 @@ public String getPackagePrefixesToCover() {
7071
}
7172

7273
@Override
73-
public List<AuthenticationDto> getInfoForAuthentication() { return null; }
74+
public List<AuthenticationDto> getInfoForAuthentication() {
75+
return null;
76+
}
7477

7578
@Override
76-
public ProblemInfo getProblemInfo() { return null; }
79+
public ProblemInfo getProblemInfo() {
80+
return new RestProblem(
81+
"http://localhost:" + getSutPort() + "/assets/swagger.json",
82+
null
83+
);
84+
}
7785

7886
@Override
7987
public SutInfoDto.OutputFormat getPreferredOutputFormat() {
@@ -113,7 +121,8 @@ public String startSut() {
113121
}
114122
}
115123

116-
JdbcTemplate jdbc = ctx.getBean(JdbcTemplate.class);try {
124+
JdbcTemplate jdbc = ctx.getBean(JdbcTemplate.class);
125+
try {
117126
sqlConnection = jdbc.getDataSource().getConnection();
118127
} catch (SQLException e) {
119128
throw new RuntimeException(e);
@@ -138,10 +147,11 @@ public void stopSut() {
138147

139148
@Override
140149
public void resetStateOfSUT() {
141-
// TODO: check and see for any necessary steps required
142-
DbCleaner.clearDatabase(sqlConnection, List.of(), DatabaseType.POSTGRES);
150+
143151
}
144152

145153
@Override
146-
public List<DbSpecification> getDbSpecifications() { return dbSpecification; }
154+
public List<DbSpecification> getDbSpecifications() {
155+
return dbSpecification;
156+
}
147157
}

0 commit comments

Comments
 (0)