You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2021/07/13 16:29:32 UTC
[sling-whiteboard] 02/03: SLING-10551 - section names must be
capitalized in schema
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
commit 912c4575ea7ab879a8aed29757dcd162f17ee884
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Jul 13 18:24:27 2021 +0200
SLING-10551 - section names must be capitalized in schema
---
.../schema/aggregator/impl/CapitalizeTest.java | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/sling-org-apache-sling-graphql-schema/src/test/java/org/apache/sling/graphql/schema/aggregator/impl/CapitalizeTest.java b/sling-org-apache-sling-graphql-schema/src/test/java/org/apache/sling/graphql/schema/aggregator/impl/CapitalizeTest.java
new file mode 100644
index 0000000..aaca60d
--- /dev/null
+++ b/sling-org-apache-sling-graphql-schema/src/test/java/org/apache/sling/graphql/schema/aggregator/impl/CapitalizeTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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 org.apache.sling.graphql.schema.aggregator.impl;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class CapitalizeTest {
+ @Test
+ public void normalStrings() throws Exception {
+ assertEquals("Voici", DefaultSchemaAggregator.capitalize("voici"));
+ assertEquals("Ou bien", DefaultSchemaAggregator.capitalize("OU BIEN"));
+ }
+
+ @Test
+ public void emptyStrings() throws Exception {
+ assertEquals("", DefaultSchemaAggregator.capitalize(""));
+ assertEquals(null, DefaultSchemaAggregator.capitalize(null));
+ }
+
+ @Test
+ public void shortStrings() throws Exception {
+ assertEquals("A", DefaultSchemaAggregator.capitalize("a"));
+ assertEquals("B", DefaultSchemaAggregator.capitalize("B"));
+ }
+}
\ No newline at end of file