Skip to content

Commit

Permalink
Fix mysql delete Error IT
Browse files Browse the repository at this point in the history
  • Loading branch information
ron190 committed Feb 3, 2025
1 parent a88335f commit 169e03b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public void setupInjection() throws Exception {

model.beginInjection();
}

@Override
@RetryingTest(3)
public void listValues() throws JSqlException {
super.listValues();
public void listDatabases() throws JSqlException {
super.listDatabases();
Assertions.assertEquals(
this.injectionModel.getMediatorStrategy().getError(),
this.injectionModel.getMediatorStrategy().getStrategy()
Expand Down
9 changes: 5 additions & 4 deletions model/src/test/java/spring/SpringApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.core.io.ClassPathResource;
import spring.rest.Student;
import spring.rest.StudentForDelete;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -112,12 +113,12 @@ public static void initDatabases() throws Exception {
SpringApp.initMckoi();
}

SpringApp.getPropertiesFilterByProfile()
.forEach(propertyByEngine -> {
SpringApp.getPropertiesFilterByProfile().forEach(propertyByEngine -> {
Configuration configuration = new Configuration();
configuration.addProperties(propertyByEngine.getKey()).configure("hibernate/hibernate.cfg.xml");
configuration.addAnnotatedClass(Student.class);

configuration.addAnnotatedClass(StudentForDelete.class);

StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
try (
SessionFactory factory = configuration.buildSessionFactory(builder.build());
Expand All @@ -130,7 +131,7 @@ public static void initDatabases() throws Exception {
student.setClassName("className");
student.setLastName("lastName");
student.setRollNo("rollNo");
session.persist(student);
session.persist(new StudentForDelete());
transaction.commit();
} catch (Exception e) {
LOGGER.error(e);
Expand Down

0 comments on commit 169e03b

Please sign in to comment.