File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
operator-framework-core/src
main/java/io/javaoperatorsdk/operator
test/java/io/javaoperatorsdk/operator Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public static String getDefaultResourceControllerName(String rcControllerClassNa
48
48
// if the name is fully qualified, extract the simple class name
49
49
final var lastDot = rcControllerClassName .lastIndexOf ('.' );
50
50
if (lastDot > 0 ) {
51
- rcControllerClassName = rcControllerClassName .substring (lastDot );
51
+ rcControllerClassName = rcControllerClassName .substring (lastDot + 1 );
52
52
}
53
53
return rcControllerClassName .toLowerCase (Locale .ROOT );
54
54
}
Original file line number Diff line number Diff line change
1
+ package io .javaoperatorsdk .operator ;
2
+
3
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4
+
5
+ import io .javaoperatorsdk .operator .sample .simple .TestCustomResourceController ;
6
+ import org .junit .jupiter .api .Test ;
7
+
8
+ class ControllerUtilsTest {
9
+
10
+ @ Test
11
+ void getDefaultResourceControllerName () {
12
+ assertEquals (
13
+ "testcustomresourcecontroller" ,
14
+ ControllerUtils .getDefaultResourceControllerName (
15
+ TestCustomResourceController .class .getCanonicalName ()));
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments