Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into add-spring-boot-nebula-all
Browse files Browse the repository at this point in the history
# Conflicts:
#	spring-boot-nebula-web-common/src/main/java/com/nebula/web/common/utils/ExpressionUtil.java
  • Loading branch information
weihubeats committed Sep 14, 2024
2 parents 2fa10e8 + c212aad commit 26dda2c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
<maven.compiler.target>11</maven.compiler.target>
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
Expand Down
3 changes: 1 addition & 2 deletions spring-boot-nebula-web-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<artifactId>spring-boot-nebula-common</artifactId>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -40,7 +39,7 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.nebula.web.common.utils;

import com.nebula.web.common.autoconfigure.NebulaWebCommonAutoConfiguration;
Expand All @@ -10,6 +27,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertThrowsExactly;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand All @@ -20,34 +38,34 @@
*/
@SpringBootTest(classes = SpringBeanUtilsTest.TestConfig.class)
public class SpringBeanUtilsTest {

@Test
public void getBean() {
Object bean = SpringBeanUtils.getBean("testBean");
assertTrue(bean instanceof TestBean);
assertInstanceOf(TestBean.class, bean);
TestBean bean1 = SpringBeanUtils.getBean(TestBean.class);
assertTrue(Objects.nonNull(bean1));
assertThrowsExactly(NoSuchBeanDefinitionException.class, () -> SpringBeanUtils.getBean(NoTestBean.class));

}

static final class TestBean {
}

static final class NoTestBean {
}

@Configuration
@EnableAutoConfiguration
@ImportAutoConfiguration({NebulaWebCommonAutoConfiguration.class})
public static class TestConfig {

@Bean
public TestBean testBean() {
return new TestBean();

}

}

}
6 changes: 0 additions & 6 deletions spring-boot-nebula-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down

0 comments on commit 26dda2c

Please sign in to comment.