-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.10.x' into renovate/major-micronaut.cache
- Loading branch information
Showing
45 changed files
with
1,112 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: "🔧 Setup GraalVM CE" | ||
uses: graalvm/[email protected].3 | ||
uses: graalvm/[email protected].6 | ||
with: | ||
distribution: 'graalvm' | ||
java-version: ${{ matrix.java }} | ||
|
@@ -70,15 +70,15 @@ jobs: | |
- name: "📊 Publish Test Report" | ||
if: always() | ||
uses: mikepenz/action-junit-report@v4 | ||
uses: mikepenz/action-junit-report@v5 | ||
with: | ||
check_name: Java CI / Test Report (${{ matrix.java }}) | ||
report_paths: '**/build/test-results/test/TEST-*.xml' | ||
check_retries: 'true' | ||
|
||
- name: "📜 Upload binary compatibility check results" | ||
if: matrix.java == '17' | ||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | ||
with: | ||
name: binary-compatibility-reports | ||
path: "**/build/reports/binary-compatibility-*.html" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...tation/src/main/java/io/micronaut/spring/annotation/context/FallbackAnnotationMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed 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 | ||
* | ||
* https://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 io.micronaut.spring.annotation.context; | ||
|
||
import io.micronaut.context.annotation.Secondary; | ||
import io.micronaut.core.annotation.AnnotationValue; | ||
import io.micronaut.inject.annotation.TypedAnnotationMapper; | ||
import io.micronaut.inject.visitor.VisitorContext; | ||
import java.util.List; | ||
import org.springframework.context.annotation.Fallback; | ||
|
||
public class FallbackAnnotationMapper | ||
implements TypedAnnotationMapper<Fallback> { | ||
@Override | ||
public Class<Fallback> annotationType() { | ||
return Fallback.class; | ||
} | ||
|
||
@Override | ||
public List<AnnotationValue<?>> map(AnnotationValue<Fallback> annotation, VisitorContext visitorContext) { | ||
return List.of(AnnotationValue.builder(Secondary.class).build()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
spring-context/src/test/groovy/io/micronaut/spring/annotation/context/FallbackSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.micronaut.spring.annotation.context | ||
|
||
import io.micronaut.context.ApplicationContext | ||
import spock.lang.Specification | ||
|
||
class FallbackSpec extends Specification { | ||
|
||
void "test fallback works"() { | ||
when: | ||
def context = ApplicationContext.run() | ||
|
||
then: | ||
context.getBean(MyInterface) instanceof MyFallback | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
spring-context/src/test/java/io/micronaut/spring/annotation/context/MyFallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.micronaut.spring.annotation.context; | ||
|
||
import org.springframework.context.annotation.Fallback; | ||
|
||
@Fallback | ||
public class MyFallback implements MyInterface { | ||
} |
4 changes: 4 additions & 0 deletions
4
spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.micronaut.spring.annotation.context; | ||
|
||
public interface MyInterface { | ||
} |
9 changes: 9 additions & 0 deletions
9
spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterfaceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.micronaut.spring.annotation.context; | ||
|
||
import io.micronaut.context.annotation.Requires; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@Requires(property = "activation.property") | ||
public class MyInterfaceImpl implements MyInterface { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...tation/src/main/java/io/micronaut/spring/web/annotation/PathVariableAnnotationMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed 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 | ||
* | ||
* https://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 io.micronaut.spring.web.annotation; | ||
|
||
import io.micronaut.core.annotation.AnnotationValue; | ||
import io.micronaut.core.annotation.Nullable; | ||
import io.micronaut.http.annotation.PathVariable; | ||
import io.micronaut.inject.visitor.VisitorContext; | ||
import io.micronaut.spring.annotation.AbstractSpringAnnotationMapper; | ||
|
||
import java.lang.annotation.Annotation; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Maps Spring RequestMapping to Micronaut. | ||
* | ||
* @author graemerocher | ||
* @since 1.0 | ||
*/ | ||
public class PathVariableAnnotationMapper extends AbstractSpringAnnotationMapper { | ||
@Override | ||
public String getName() { | ||
return "org.springframework.web.bind.annotation.PathVariable"; | ||
} | ||
|
||
@Override | ||
protected List<AnnotationValue<?>> mapInternal(AnnotationValue<Annotation> annotation, VisitorContext visitorContext) { | ||
var annotations = new ArrayList<AnnotationValue<?>>(); | ||
|
||
annotations.add(AnnotationValue.builder(PathVariable.class).member("value", annotation.stringValue().orElse("")).build()); | ||
|
||
var isRequired = annotation.booleanValue("required").orElse(true); | ||
if (!isRequired) { | ||
annotations.add(AnnotationValue.builder(Nullable.class).build()); | ||
} | ||
|
||
return annotations; | ||
} | ||
} |
Oops, something went wrong.