Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.baeldung.trial;

import org.springframework.stereotype.Component;

@Component
public class ConstructorInjectedBus {

private Driver driver;

public ConstructorInjectedBus(Driver driver) {
this.driver = driver;
}

// standard setters and getters
}
7 changes: 7 additions & 0 deletions spring-core/src/main/java/com/baeldung/trial/Driver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.baeldung.trial;

import org.springframework.stereotype.Component;

@Component
public class Driver {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.baeldung.trial;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SetterInjectedBus {

private Driver driver;

public Driver getDriver() {
return driver;
}

@Autowired
public void setDriver(Driver driver) {
this.driver = driver;
}
}
12 changes: 12 additions & 0 deletions spring-core/src/main/java/com/baeldung/trial/TrialApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.baeldung.trial;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TrialApplication {

public static void main(String[] args) {
SpringApplication.run(TrialApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.baeldung.trial;

import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class TrialApplicationTests {

@Test
public void testSetup() throws Exception {
}
}