So I am trying to autowire my http object in my test class and I have tried to integrate with @SpringBootTest however my http object still remains null.
My test class looks like this.
//@RunWith(SpringRunner.class)
@SpringBootTest(classes=Http.class)
public class GetItemTests {
private static final Logger LOGGER = LoggerFactory.getLogger(GetItemTests.class);
@Autowired
private Http httpClass;
}
My SpringBootMain class looks like this
@SpringBootConfiguration
@SpringBootApplication
public class SpringBootMain implements CommandLineRunner {
@Bean
ResourceConfig resourceConfig() {
return new ResourceConfig().registerClasses(Version1Api.class,TokenUtilityClass.class, Paypal.class);
}
@Override
public void run(String... args) throws Exception {
//test.authenticationToken();
}
public static void main(String[] args) {
SpringApplication.run(SpringBootMain.class);
}
}
I have tried running with the SpringRunner as well as this but I receive errors about failing to load the application context.