Skip to content

Commit 8066195

Browse files
committed
Merge branch 'master' of https://github.com/juliuskrah/tutorials into juliuskrah-master
2 parents 1ccdc8f + c9865a0 commit 8066195

5 files changed

Lines changed: 53 additions & 53 deletions

File tree

‎spring-boot/src/main/java/org/baeldung/boot/DemoApplication.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
@SpringBootApplication
77
public class DemoApplication {
88

9-
public static void main(String[] args) {
10-
System.setProperty("spring.config.name", "demo");
11-
SpringApplication.run(DemoApplication.class, args);
12-
}
9+
public static void main(String[] args) {
10+
System.setProperty("spring.config.name", "demo");
11+
SpringApplication.run(DemoApplication.class, args);
12+
}
13+
1314
}

‎spring-boot/src/main/java/org/baeldung/boot/model/Foo.java‎

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@
88

99
@Entity
1010
public class Foo implements Serializable {
11-
private static final long serialVersionUID = 1L;
12-
@Id
13-
@GeneratedValue
14-
private Integer id;
15-
private String name;
16-
17-
public Foo() {
18-
}
19-
20-
public Foo(String name) {
21-
this.name = name;
22-
}
23-
24-
public Integer getId() {
25-
return id;
26-
}
27-
28-
public void setId(Integer id) {
29-
this.id = id;
30-
}
31-
32-
public String getName() {
33-
return name;
34-
}
35-
36-
public void setName(String name) {
37-
this.name = name;
38-
}
39-
11+
private static final long serialVersionUID = 1L;
12+
@Id
13+
@GeneratedValue
14+
private Integer id;
15+
private String name;
16+
17+
public Foo() {
18+
}
19+
20+
public Foo(String name) {
21+
this.name = name;
22+
}
23+
24+
public Integer getId() {
25+
return id;
26+
}
27+
28+
public void setId(Integer id) {
29+
this.id = id;
30+
}
31+
32+
public String getName() {
33+
return name;
34+
}
35+
36+
public void setName(String name) {
37+
this.name = name;
38+
}
4039
}

‎spring-boot/src/main/java/org/baeldung/boot/repository/FooRepository.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
import org.springframework.data.jpa.repository.JpaRepository;
55

66
public interface FooRepository extends JpaRepository<Foo, Integer> {
7-
public Foo findByName(String name);
7+
public Foo findByName(String name);
88
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
@WebAppConfiguration
1212
public class DemoApplicationTests {
1313

14-
@Test
15-
public void contextLoads() {
16-
}
17-
14+
@Test
15+
public void contextLoads() {
16+
}
1817
}

‎spring-boot/src/test/java/org/baeldung/boot/repository/FooRepositoryTest.java‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@
1515

1616
@Transactional
1717
public class FooRepositoryTest extends DemoApplicationTests {
18-
@Autowired
19-
private FooRepository fooRepository;
20-
21-
@Before
22-
public void setUp() {
23-
fooRepository.save(new Foo("Foo"));
24-
fooRepository.save(new Foo("Bar"));
25-
}
26-
27-
@Test
28-
public void testFindByName() {
29-
Foo foo = fooRepository.findByName("Bar");
30-
assertThat(foo, notNullValue());
31-
assertThat(foo.getId(), is(2));
32-
}
18+
@Autowired
19+
private FooRepository fooRepository;
20+
21+
@Before
22+
public void setUp() {
23+
fooRepository.save(new Foo("Foo"));
24+
fooRepository.save(new Foo("Bar"));
25+
}
26+
27+
@Test
28+
public void testFindByName() {
29+
Foo foo = fooRepository.findByName("Bar");
30+
assertThat(foo, notNullValue());
31+
assertThat(foo.getId(), is(2));
32+
}
33+
3334
}

0 commit comments

Comments
 (0)