33import com .mongodb .client .MongoClient ;
44import com .mongodb .client .MongoClients ;
55import io .papermc .bibliothek .BibliothekApplication ;
6- import org .evomaster .client .java .controller .AuthUtils ;
76import org .evomaster .client .java .controller .EmbeddedSutController ;
87import org .evomaster .client .java .controller .InstrumentedSutStarter ;
98import org .evomaster .client .java .controller .api .dto .auth .AuthenticationDto ;
1413import org .springframework .boot .SpringApplication ;
1514import org .springframework .context .ConfigurableApplicationContext ;
1615import org .testcontainers .containers .GenericContainer ;
17- import org .testcontainers .containers .startupcheck .OneShotStartupCheckStrategy ;
1816
1917
20- import java .time .Duration ;
21- import java .util .Arrays ;
2218import java .util .List ;
2319import java .util .Map ;
2420import java .util .Collections ;
@@ -56,7 +52,6 @@ public static void main(String[] args) {
5652 private static final GenericContainer mongodbContainer = new GenericContainer ("mongo:" + MONGODB_VERSION )
5753 .withTmpFs (Collections .singletonMap ("/data/db" , "rw" ))
5854 .withExposedPorts (MONGODB_PORT );
59- // .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofSeconds(90)));
6055
6156 private String mongoDbUrl ;
6257
@@ -75,11 +70,9 @@ public EmbeddedEvoMasterController(int port) {
7570 public String startSut () {
7671
7772 mongodbContainer .start ();
78-
7973 mongoDbUrl = "mongodb://" + mongodbContainer .getContainerIpAddress () + ":" + mongodbContainer .getMappedPort (MONGODB_PORT ) + "/" + MONGODB_DATABASE_NAME ;
8074 mongoClient = MongoClients .create (mongoDbUrl );
8175
82- //mongodbContainer.setStartupCheckStrategy( new OneShotStartupCheckStrategy() );
8376
8477
8578 ctx = SpringApplication .run (BibliothekApplication .class ,
@@ -132,28 +125,7 @@ public List<DbSpecification> getDbSpecifications() {
132125 @ Override
133126 public List <AuthenticationDto > getInfoForAuthentication () {
134127 //TODO might need to setup JWT headers here
135- System .out .println ("HERE" );
136-
137- // @Onur Setting JWT Authentication here.
138- return Arrays .asList (
139- AuthUtils .getForJWT (
140- "User1" ,
141- "/api/auth_token/auth1" ,
142- """
143- {"userId": "User1", "password":"User1_Password123"}
144- """ .trim ().stripIndent (),
145- "/token/authToken1" ),
146- AuthUtils .getForJWT (
147- "User2" ,
148- "/api/auth_token/auth2" ,
149- """
150- {"userId": "User2", "password":"User2_Password456"}
151- """ .trim ().stripIndent (),
152- "/token/authToken2" )
153- );
154-
155-
156- //return null;
128+ return null ;
157129 }
158130
159131
0 commit comments