Skip to content

Commit

Permalink
test: 修复Base64PasswordServiceTest的测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
damingerdai committed Nov 8, 2024
1 parent d61a171 commit fe09ce6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
package org.daming.hoteler.security.service.impl;

import org.daming.hoteler.config.prop.SecretProp;
import org.daming.hoteler.config.service.ISecretPropService;
import org.daming.hoteler.config.service.impl.SecretPropServiceImpl;
import org.daming.hoteler.service.IErrorService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;

import static org.junit.jupiter.api.Assertions.*;

@SpringBootTest
//@SpringBootTest(properties = "spring.main.allow-bean-definition-overriding=true")
@ContextConfiguration(classes = Base64PasswordServiceTest.TestConfig.class)
class Base64PasswordServiceTest {

@Configuration
static class TestConfig {

@Bean
public Base64PasswordService md5PasswordService() {
return new Base64PasswordService();
}
}

@Autowired
private Base64PasswordService base64PasswordService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public ISecretPropService secretPropService(SecretProp secretProp) {

@Bean
public DESPasswordService md5PasswordService(IErrorService errorService, ISecretPropService secretPropService) {

return new DESPasswordService(errorService, secretPropService);
}
}
Expand Down

0 comments on commit fe09ce6

Please sign in to comment.