Skip to content

Commit cc27658

Browse files
Doha2012Eugen
authored andcommitted
fix integration test (eugenp#1615)
* upgrade to spring boot 1.5.2 * add full update to REST API * modify ratings controller * upgrade herold * fix integration test * fix integration test * minor fix * fix integration test * fix integration test * minor cleanup
1 parent a5de78c commit cc27658

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎spring-boot/src/main/resources/schema.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
drop table if exists USERS;
2+
13
create table USERS(
24
ID int not null AUTO_INCREMENT,
35
NAME varchar(100) not null,

‎spring-boot/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ public void givenRequestHasBeenMade_whenMeetsFindByVersionOfGivenConditions_then
6363
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType))
6464
.andExpect(jsonPath("$.id", equalTo(1)));
6565
}
66-
}
66+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Insert into Foo values(1,'Foo_Name');
1+
--insert into Foo values(1,'Foo_Name');
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
jdbc.driverClassName=org.h2.Driver
22
jdbc.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
3-
jdbc.username=sa
4-
jdbc.password=sa
3+
jdbc.user=sa
4+
jdbc.pass=sa
55

66
hibernate.dialect=org.hibernate.dialect.H2Dialect
77
hibernate.show_sql=true
8-
hibernate.hbm2ddl.auto=create-drop
8+
hibernate.hbm2ddl.auto=create-drop

‎spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerIntegrationTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
import org.springframework.web.context.WebApplicationContext;
2222

2323
import com.baeldung.spring.web.config.ApplicationConfig;
24+
import com.baeldung.spring.web.config.WebConfig;
2425

2526
@RunWith(SpringJUnit4ClassRunner.class)
2627
@WebAppConfiguration
27-
@ContextConfiguration(classes = { ApplicationConfig.class })
28+
@ContextConfiguration(classes = { ApplicationConfig.class, WebConfig.class })
2829
public class GreetControllerIntegrationTest {
2930

3031
@Autowired

0 commit comments

Comments
 (0)